/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #f5f5f5;
}

/* Header Styles */
header {
    background: white;
    padding: 12px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Logo */
.logo {
    flex: 0 0 120px;
    margin-right: 20px;
}

.myntra_home {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Search Bar */
.search_bar {
    flex: 0 0 500px;
    position: relative;
    margin: 0 20px;
}

.search_bar input {
    width: 100%;
    padding: 10px 100px 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px; /* Updated radius */
    font-size: 14px;
    background: #f8f9fa;
}

/* Search Button Styles */
#searchBtn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#searchBtn:hover {
    background: #218838;
    transform: translateY(-50%) scale(1.02);
}

/* Navigation */
.nav_bar {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-left: auto;
}

.nav_bar a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.3s;
}

.nav_bar a:hover {
    color: #28a745;
}

/* Main Content */
main {
    margin-top: 80px;
    padding: 20px;
    max-width: 1400px;
    margin: 80px auto 0;
}

/* Banner */
.banner_container {
    margin-bottom: 30px;
}

.banner_image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Category Heading */
.categary_heading {
    text-align: center;
    margin: 30px 0;
}

.categary_heading h10 {
    font-size: 24px;
    color: #333;
    line-height: 1.4;
}

/* Book Grid */
.book_items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px;
}

.book_item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 420px; /* Increased height to accommodate full image */
}

.book_item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.click_here {
    width: 100%;
    height: auto; /* Changed from fixed height */
    max-height: 280px; /* Maximum height */
    object-fit: contain; /* Changed from cover to contain */
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Download Button Styles - Matching Search Button */
.book_item p a {
    display: inline-block;
    padding: 8px 20px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: normal;
    transition: all 0.3s ease;
    border: none;
    min-width: 120px;
    text-align: center;
    margin: 10px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.book_item p a:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Title Styles */
.book_item h3 {
    margin: 10px 0;
    font-size: 14px;
    min-height: 40px;
    flex-grow: 0; /* Prevents title from stretching */
}

/* Footer Styles */
.site-footer {
    background: #333;
    color: white;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Responsive Design */
@media screen and (min-width: 1400px) {
    .header-container,
    main,
    .footer-content {
        max-width: 1600px;
    }

    .book_items {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media screen and (max-width: 1200px) {
    .book_items {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 992px) {
    header {
        flex-wrap: wrap;
    }

    .logo {
        flex: 0 0 100px;
    }

    .search_bar {
        flex: 1;
        margin: 0 10px;
    }

    .nav_bar {
        gap: 20px;
    }

    .book_items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    header {
        position: relative;
        padding: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
    }

    .logo {
        flex: 0 0 40px;
        margin: 0;
        order: 1;
    }

    .myntra_home {
        height: 40px;
        width: auto;
    }

    .search_bar {
        flex: 1;
        order: 2;
        margin: 0 0 0 10px;
        min-width: 200px;
    }

    .nav_bar {
        flex: 0 0 100%;
        order: 3;
        justify-content: center;
        margin-top: 10px;
        gap: 15px;
    }

    /* Banner Fixes for Mobile */
    main {
        margin-top: 0;
        padding: 10px;
    }

    .banner_container {
        margin: 10px -10px 20px;
    }

    .banner_image {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
        border-radius: 0;
    }

    /* Book Grid Adjustments */
    .book_items {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 0;
    }

    .click_here {
        height: 180px;
    }

    /* Search Bar Adjustments */
    .search_bar input {
        padding: 8px 80px 8px 10px;
        font-size: 13px;
    }

    #searchBtn {
        padding: 6px 15px;
        font-size: 13px;
    }

    /* Mobile Responsive Button */
    .book_item p a {
        padding: 6px 15px;
        font-size: 13px;
        min-width: 100px;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 375px) {
    .logo {
        flex: 0 0 35px;
    }

    .myntra_home {
        height: 35px;
    }

    .search_bar {
        flex: 1;
    }

    .nav_bar a {
        font-size: 13px;
        padding: 5px 8px;
    }

    .book_items {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .click_here {
        height: 160px;
    }

    #searchBtn, 
    .book_item p a {
        padding: 5px 12px;
        font-size: 12px;
    }

    .book_item p a {
        min-width: 90px;
    }
}

/* Search Results Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book_item.search-visible {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.book_item.search-hidden {
    display: none;
}

