/* Global Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #ddd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header.main-header,
.main-header,
body > header,
header {
    background-color: #000000 !important;
    background: #000000 !important;
    color: white !important;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    flex-wrap: nowrap;
}

.logo {
    flex: 0 0 auto;
    margin-right: 0.75rem;
}

.logo a {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

/* Search Container */
.search-container {
    flex: 0 0 auto;
    margin: 0 0.5rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
    transition: background 0.3s;
}

.search-form:focus-within {
    background: rgba(255, 255, 255, 0.2);
}

.search-input {
    padding: 0.5rem 0.875rem;
    border: none;
    background: transparent;
    color: white;
    width: 180px;
    outline: none;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    padding: 0.5rem 0.875rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #2980b9;
}

.cart-icon {
    position: relative;
    flex: 0 0 auto;
    margin-left: 0.5rem;
}

.cart-icon a {
    color: white;
    font-size: 1.3rem;
    position: relative;
    display: block;
    padding: 0.4rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.mobile-menu-toggle {
    display: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
}

/* Mobile Search Toggle */
.mobile-search-toggle {
    display: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: 0.5rem;
}

/* User Menu & Dropdown */
.user-menu {
    flex: 0 0 auto;
    margin-left: 0.5rem;
    position: relative;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-btn i.fa-user-circle {
    font-size: 1.1rem;
}

.user-btn i.fa-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.user-dropdown:hover .user-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.user-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    min-width: 200px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:first-child {
    border-radius: 10px 10px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.dropdown-item:hover {
    background: var(--light-bg);
}

.dropdown-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* Auth Buttons (Login/Register) */
.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.login-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.register-btn {
    background: var(--secondary-color);
    color: white;
}

.register-btn:hover {
    background: #2980b9;
}

/* Slideshow Styles */
.slideshow-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 500px;
}

.slide {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 800px;
}

.slide-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.slide-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 3;
    transition: background-color 0.3s;
}

.slide-control:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slide-control.prev {
    left: 20px;
}

.slide-control.next {
    right: 20px;
}

.slide-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active,
.indicator:hover {
    background-color: white;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #1a252f;
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background-color: var(--light-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Featured Books Section */
.featured-books-section {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9ff 100%);
}

.featured-books-section .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.featured-books-section .section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.featured-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.featured-book-card {
    padding: 0;
    overflow: hidden;
    text-align: left;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.featured-book-card .book-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-image-container {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: #f8f9fa;
}

.book-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-book-card:hover .book-image-container img {
    transform: scale(1.05);
}

.book-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.book-placeholder i {
    font-size: 4rem;
    opacity: 0.6;
}

.featured-badge-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.featured-badge-overlay .badge {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

.featured-book-card .book-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-book-card .book-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.36rem;
}

.featured-book-card .book-author {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-book-card .book-author i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.featured-book-card .book-price {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f1f5f9 100%);
    border-radius: 10px;
    text-align: center;
}

.featured-book-card .book-price .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.featured-book-card .view-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
    text-decoration: none;
    margin-top: auto;
}

.featured-book-card .view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

@media (max-width: 768px) {
    .featured-books-grid {
        grid-template-columns: 1fr;
    }
}

/* Text Books Section */
.textbooks-section {
    padding: 4rem 0;
    background-color: var(--light-bg);
}

/* Featured Books Compact */
.featured-books-compact {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.featured-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.featured-books-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.featured-book-compact-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    height: 140px;
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: stretch;
}

.featured-book-compact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.compact-image-container {
    position: relative;
    width: 130px;
    min-width: 130px;
    height: 100%;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
}

.compact-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-book-compact-card:hover .compact-image-container img {
    transform: scale(1.1);
}

.compact-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.compact-placeholder i {
    font-size: 2rem;
    opacity: 0.6;
}

.featured-badge-compact {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}

.featured-badge-compact span {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 15px;
    font-size: 0.65rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255,107,107,0.3);
    display: block;
}

.compact-middle {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    border-left: 2px solid #e2e8f0;
    border-right: 2px solid #e2e8f0;
    background: #fafbfc;
}

.book-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-price-compact {
    display: flex;
    align-items: center;
}

.book-price-compact .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.compact-actions {
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
    justify-content: center;
    min-width: 120px;
    background: white;
}

.btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    width: 100%;
    min-width: 100px;
}

.btn-details {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-details:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
    color: white;
}

.btn-cart {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.2);
}

.btn-cart:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 3px 12px rgba(72, 187, 120, 0.3);
    transform: translateY(-1px);
    color: white;
}

.btn-compact i {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .featured-books-grid-compact {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .featured-book-compact-card {
        height: 130px;
        grid-template-columns: 100px 1fr auto;
    }
    
    .compact-image-container {
        width: 100px;
        min-width: 100px;
    }
    
    .compact-middle {
        padding: 0.75rem 1rem;
    }
    
    .book-name {
        font-size: 0.9rem;
    }
    
    .book-price-compact .price {
        font-size: 1rem;
    }
    
    .compact-actions {
        padding: 0.75rem;
        min-width: 100px;
    }
    
    .btn-compact {
        padding: 0.45rem 0.8rem;
        font-size: 0.75rem;
        min-width: 90px;
    }
    
    .compact-placeholder i {
        font-size: 1.8rem;
    }
}

.textbooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.textbook-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.textbook-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.textbook-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.textbook-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.textbook-card p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.book-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.book-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background-color: var(--light-bg);
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #ccc;
}

.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.book-info {
    padding: 1.5rem;
}

.book-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.price {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 0.5rem;
}

.sale-price,
.current-price {
    color: var(--accent-color);
    font-weight: bold;
}

.add-to-cart {
    width: 100%;
}

.no-books {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.no-books i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.view-all-btn {
    text-align: center;
    margin-top: 2rem;
}

/* Footer Styles */
.main-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-size: 1.5rem;
    color: white;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-menu {
        gap: 0.4rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .search-input {
        width: 150px;
        font-size: 0.875rem;
    }
    
    .logo a {
        font-size: 1.2rem;
    }
}

@media (max-width: 1024px) {
    .navbar {
        gap: 0.4rem;
    }
    
    .nav-menu {
        gap: 0.3rem;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.45rem;
        font-size: 0.85rem;
    }
    
    .search-input {
        width: 130px;
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .search-btn {
        padding: 0.4rem 0.75rem;
    }
    
    .logo {
        margin-right: 0.5rem;
    }
    
    .logo a {
        font-size: 1.1rem;
    }
    
    .search-container {
        margin: 0 0.4rem;
    }
    
    .user-menu {
        margin-left: 0.5rem;
    }
    
    .user-name {
        max-width: 70px;
        font-size: 0.85rem;
    }
    
    .user-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .auth-buttons {
        gap: 0.4rem;
    }
    
    .auth-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .cart-icon {
        margin-left: 0.4rem;
    }
    
    .cart-icon a {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        gap: 0.5rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .logo {
        margin-right: 0;
        flex: 1;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Hide search on mobile by default */
    .search-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem;
        background: var(--primary-color);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
        z-index: 100;
    }
    
    .search-container.active {
        display: block;
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .mobile-search-toggle {
        display: block;
    }
    
    .cart-icon {
        margin-left: 0.5rem;
    }
    
    /* User Menu Mobile */
    .user-menu {
        margin-left: 0.5rem;
    }
    
    .user-btn {
        padding: 0.5rem 0.75rem;
    }
    
    .user-name {
        display: none;
    }
    
    .user-btn i.fa-user-circle {
        font-size: 1.4rem;
    }
    
    .user-btn i.fa-chevron-down {
        display: none;
    }
    
    .dropdown-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .dropdown-menu.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .auth-btn {
        justify-content: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .auth-btn i {
        font-size: 1rem;
    }
    
    .slide-content h1 {
        font-size: 2rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Enhanced Textbook Display Styles */
.book-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item {
    font-size: 0.85rem;
    color: var(--text-color);
}

.info-item strong {
    color: var(--primary-color);
    display: inline-block;
    margin-bottom: 0;
    margin-right: 0.35rem;
}

/* Generic wrapper for icon + text rows */
.icon-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Badge Styles */
.cefr-badge,
.curriculum-badge,
.platform-badge,
.age-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 2px;
    font-weight: 500;
}

.cefr-badge {
    background: #6c757d;
}

.curriculum-badge {
    background: #28a745;
}

.platform-badge {
    background: #343a40;
}

.age-badge {
    background: #17a2b8;
}

/* Section Styles */
.cefr-levels,
.curriculum-focus,
.platform-info,
.age-group,
.package-id,
.other-software,
.educational-content {
    margin: 0.8rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.cefr-levels:last-child,
.curriculum-focus:last-child,
.platform-info:last-child,
.age-group:last-child,
.package-id:last-child,
.other-software:last-child,
.educational-content:last-child {
    border-bottom: none;
}

.cefr-levels strong,
.curriculum-focus strong,
.platform-info strong,
.age-group strong,
.package-id strong,
.other-software strong,
.educational-content h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.educational-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.content-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.read-more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.read-more-link:hover {
    text-decoration: underline;
}

/* Enhanced textbook card layout */
.textbooks-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.textbook-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.textbook-actions .btn {
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

/* Responsive adjustments for enhanced display */
@media (max-width: 768px) {
    .book-info-grid {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    
    .textbook-actions {
        flex-direction: column;
    }
    
    .textbook-actions .btn {
        width: 100%;
    }
}

/* Levels Management Styles */
#levels-container {
    margin-bottom: 1rem;
}

.level-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.level-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.level-name {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.level-description {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    min-height: 80px;
    resize: vertical;
}

.remove-level {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    align-self: flex-start;
    transition: background 0.3s;
}

.remove-level:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsive levels management */
@media (max-width: 768px) {
    .level-inputs {
        gap: 0.5rem;
    }
    
    .level-name,
    .level-description {
        font-size: 0.85rem;
    }
    
    .remove-level,
    .btn-secondary {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Frontend Levels Display */
.levels-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.levels-section h4 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.level-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    transition: box-shadow 0.3s;
}

.level-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.level-card .level-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.level-card .level-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Textbook/search cards: show icon + text on the same row */
.textbooks-page .essential-info .info-item,
.search-page .essential-info .info-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem;
}

/* Responsive levels display */
@media (max-width: 768px) {
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .levels-section {
        padding: 0.75rem;
    }
    
    .level-card {
        padding: 0.5rem;
    }
    
    .level-card .level-name {
        font-size: 0.85rem;
    }
    
    .level-card .level-description {
        font-size: 0.75rem;
    }
}

