/* Main stylesheet for Harsh Book Store */
/* Made by Harsh Kumar Sahu - BCA 4th Sem */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Top Header */
.top-header {
    background-color: #2c3e50;
    color: white;
    padding: 8px 0;
    text-align: center;
    font-size: 14px;
}

/* Main Header */
header {
    background-color: #e74c3c;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 26px;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 3px;
}

nav ul li a:hover {
    background-color: #c0392b;
}

.cart-count {
    background-color: yellow;
    color: black;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

/* Banner */
.banner {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.banner h2 {
    font-size: 40px;
    margin-bottom: 15px;
}

.banner p {
    font-size: 18px;
    margin-bottom: 20px;
}

.banner .btn {
    background-color: #e74c3c;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
}

.banner .btn:hover {
    background-color: #c0392b;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 28px;
    margin: 30px 0;
    color: #2c3e50;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.book-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 10px;
}

.book-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #2c3e50;
    height: 40px;
    overflow: hidden;
}

.book-card .author {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

.book-card .price {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
}

.book-card .btn {
    background-color: #27ae60;
    color: white;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 3px;
    display: inline-block;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.book-card .btn:hover {
    background-color: #229954;
}

/* Forms */
.form-container {
    background-color: white;
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

.form-container .btn {
    background-color: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.form-container .btn:hover {
    background-color: #2980b9;
}

.form-container p {
    text-align: center;
    margin-top: 15px;
}

.form-container p a {
    color: #e74c3c;
    text-decoration: none;
}

/* Messages */
.alert {
    padding: 12px;
    margin: 15px 0;
    border-radius: 3px;
    text-align: center;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Book Detail Page */
.book-detail {
    background-color: white;
    padding: 30px;
    margin: 30px 0;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.book-detail-img {
    flex: 1;
    min-width: 250px;
}

.book-detail-img img {
    width: 100%;
    max-width: 300px;
    border-radius: 5px;
}

.book-detail-info {
    flex: 2;
    min-width: 300px;
}

.book-detail-info h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.book-detail-info .author {
    color: #7f8c8d;
    font-size: 18px;
    margin-bottom: 15px;
}

.book-detail-info .price {
    color: #e74c3c;
    font-size: 28px;
    font-weight: bold;
    margin: 15px 0;
}

.book-detail-info .description {
    margin: 20px 0;
    line-height: 1.8;
}

/* Cart Table */
.cart-table {
    width: 100%;
    background-color: white;
    border-collapse: collapse;
    margin: 20px 0;
}

.cart-table th,
.cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background-color: #2c3e50;
    color: white;
}

.cart-table img {
    width: 60px;
    height: 80px;
    object-fit: cover;
}

.cart-table .remove-btn {
    background-color: #e74c3c;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
}

.cart-total {
    text-align: right;
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background-color: white;
}

/* About Page */
.about-section {
    background-color: white;
    padding: 40px;
    margin: 30px 0;
    border-radius: 5px;
}

.about-owner {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    margin-top: 30px;
}

.about-owner img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #e74c3c;
}

.about-owner-info {
    flex: 1;
    min-width: 300px;
}

.about-owner-info h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 10px;
}

.about-owner-info p {
    margin-bottom: 10px;
    line-height: 1.8;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 40px 0 10px 0;
    margin-top: 50px;
}

.footer-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-col h3 {
    margin-bottom: 15px;
    color: #e74c3c;
}

.footer-col p,
.footer-col ul li a {
    color: #ecf0f1;
    font-size: 14px;
    text-decoration: none;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 5px;
}

.footer-col ul li a:hover {
    color: #e74c3c;
}

.copyright {
    text-align: center;
    border-top: 1px solid #34495e;
    padding-top: 15px;
    font-size: 14px;
}

/* Search box */
.search-box {
    text-align: center;
    margin: 20px 0;
}

.search-box input {
    padding: 10px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.search-box button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }
    nav ul {
        margin-top: 15px;
        justify-content: center;
    }
    nav ul li {
        margin: 5px;
    }
    .banner h2 {
        font-size: 28px;
    }
}
