* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-gradient: linear-gradient(135deg, #a8b5c8 0%, #c8d0db 100%);
    --text-dark: #2c3e50;
    --text-light: #6c7a89;
    --white: #ffffff;
}

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    color: var(--text-dark);
    overflow-x: hidden;
    background: 
        linear-gradient(to bottom, 
            rgba(255,255,255,0) 0%, 
            rgba(255,255,255,0.3) 30%, 
            rgba(255,255,255,0.7) 60%, 
            rgba(255,255,255,0.95) 100%
        ),
        url('../images/background.png') center center / cover no-repeat fixed;
    position: relative;
    min-height: 100vh;
}

.stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

.light-rays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: 
        linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%);
}

.top-banner {
    display: none;
}

.mandala-center {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.mandala-pattern {
    width: 40px;
    height: 40px;
    border: 2px solid white;
    border-radius: 50%;
    position: relative;
}

.mandala-pattern::before,
.mandala-pattern::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.main-container {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    background: transparent;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(232, 232, 232, 0.5);
    position: relative;
    z-index: 10000;
}

.mobile-nav-icons {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.logo-icon {
    width: 30px;
    height: 30px;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--text-dark);
}

.lang-switcher {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.lang-switcher a {
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.lang-switcher a.active {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
}

.hero-section {
    background: transparent;
    padding: 20px 40px 15px;
    text-align: center;
    position: relative;
    overflow: visible;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    align-items: stretch;
}

.featured-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 1;
    height: 100%;
}

.featured-dots {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.featured-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-dot.active {
    background: white;
    width: 36px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .featured-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 0;
        grid-template-columns: none;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    
    .featured-grid::-webkit-scrollbar {
        display: none;
    }
    
    .featured-item {
        min-width: 100%;
        flex-shrink: 0;
        scroll-snap-align: center;
    }
    
    .featured-dots {
        display: flex;
    }
}

.featured-book {
    width: 160px;
    height: 220px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.8),
        0 0 80px rgba(255, 250, 220, 0.6),
        0 0 120px rgba(255, 240, 180, 0.4),
        0 0 160px rgba(255, 230, 150, 0.2),
        0 15px 40px rgba(0,0,0,0.15);
    animation: etherealGlow 4s ease-in-out infinite;
}

@keyframes etherealGlow {
    0%, 100% { 
        box-shadow: 
            0 0 40px rgba(255, 255, 255, 0.8),
            0 0 80px rgba(255, 250, 220, 0.6),
            0 0 120px rgba(255, 240, 180, 0.4),
            0 0 160px rgba(255, 230, 150, 0.2),
            0 15px 40px rgba(0,0,0,0.15);
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(255, 255, 255, 1),
            0 0 100px rgba(255, 250, 220, 0.8),
            0 0 150px rgba(255, 240, 180, 0.6),
            0 0 200px rgba(255, 230, 150, 0.3),
            0 15px 40px rgba(0,0,0,0.15);
    }
}

.featured-book img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    margin: 12px 0 6px;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    flex-grow: 1;
    line-height: 1.4;
}

.cta-button {
    display: inline-block;
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(204, 204, 204, 0.5);
    border-radius: 25px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
    margin-top: auto;
}

.cta-button:hover {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
}

.category-section {
    padding: 20px 40px;
    background: transparent;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-dark);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.book-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.book-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.book-info {
    padding: 10px;
    text-align: center;
}

.book-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.book-price {
    color: var(--text-light);
    font-size: 0.9rem;
}

footer {
    background: white;
    padding: 30px 40px;
    text-align: center;
    border-top: 1px solid #e8e8e8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.social-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.social-icon:hover {
    background: var(--text-dark);
    color: white;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.desktop-cart-icon {
    display: flex;
    align-items: center;
}

.desktop-cart-icon .cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(44, 62, 80, 0.1);
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.desktop-cart-icon .cart-link:hover {
    background: rgba(44, 62, 80, 0.2);
    transform: scale(1.1);
}

.desktop-cart-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--text-dark);
}

.desktop-cart-icon .cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu a {
    padding: 6px 15px;
    background: var(--text-dark);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
}

.auth-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 400;
    letter-spacing: 2px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
}

.btn {
    width: 100%;
    padding: 12px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #1a252f;
}

.alert {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.carousel-wrapper {
    overflow: visible;
    border-radius: 10px;
    padding: 20px 0;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
}

.book-card-carousel {
    flex: 0 0 200px;
    position: relative;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.book-card-carousel:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.8),
        0 0 80px rgba(255, 250, 220, 0.6),
        0 0 120px rgba(255, 240, 180, 0.4),
        0 0 160px rgba(255, 230, 150, 0.2),
        0 15px 40px rgba(0,0,0,0.2);
    z-index: 100;
}

.book-link {
    display: block;
    position: relative;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
}

.book-card-carousel img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card-carousel:hover .book-overlay {
    opacity: 1;
}

.book-overlay-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    line-height: 1.3;
}

.book-overlay-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.book-overlay-price {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.add-to-cart-btn {
    background: rgba(255, 215, 0, 0.9);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #ffd700;
    transform: scale(1.05);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.netflix-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.netflix-carousel::-webkit-scrollbar {
    height: 6px;
}

.netflix-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.netflix-carousel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.netflix-carousel:active {
    cursor: grabbing;
}

.netflix-track {
    display: flex;
    gap: 20px;
    padding: 20px 0;
}

.netflix-carousel .book-card-carousel {
    flex: 0 0 200px;
}

.netflix-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.netflix-section .category-title {
    padding: 0 40px;
}

@media (max-width: 1024px) {
    .featured-grid {
        gap: 30px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .book-card-carousel {
        flex: 0 0 calc(33.333% - 14px);
    }
    
    .carousel-container {
        padding: 0 50px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    header .logo {
        font-size: 1.3rem;
        width: 100%;
        justify-content: center;
        order: 1;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
    }
    
    header nav {
        display: none;
    }
    
    .lang-switcher {
        display: none;
    }
    
    .header-actions {
        display: none;
    }
    
    .mobile-nav-icons {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        order: 2;
        width: 100%;
    }
    
    .mobile-icon {
        position: relative;
        width: 40px;
        height: 40px;
        background: rgba(44, 62, 80, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 10001;
    }
    
    .mobile-icon:hover {
        background: rgba(44, 62, 80, 0.2);
        transform: scale(1.1);
    }
    
    .mobile-icon svg {
        width: 20px;
        height: 20px;
        fill: var(--text-dark);
    }
    
    .cart-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-size: 11px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-dropdown {
        position: absolute;
        top: 50px;
        left: 50%;
        transform: translateX(-50%);
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        padding: 10px 0;
        min-width: 180px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 10002;
    }
    
    .mobile-icon.active .mobile-dropdown {
        opacity: 1;
        visibility: visible;
        top: 45px;
    }
    
    .mobile-dropdown a {
        display: block;
        padding: 12px 20px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 0.9rem;
        transition: background 0.2s;
    }
    
    .mobile-dropdown a:hover {
        background: rgba(44, 62, 80, 0.05);
    }
    
    .mobile-dropdown a.active {
        background: var(--text-dark);
        color: white;
    }
    
    .top-banner {
        font-size: 0.75rem;
        padding: 10px 20px;
    }
    
    .hero-section {
        padding: 30px 20px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .category-section {
        padding: 25px 20px;
    }
    
    .category-title {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
    
    .book-card-carousel {
        flex: 0 0 calc(50% - 10px);
    }
    
    .carousel-container {
        padding: 0 40px;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}
