/* Custom Properties */
:root {
    --mystical-primary: #1a1b3a;
    --mystical-secondary: #2d1b69;
    --mystical-accent: #d4af37;
    --mystical-purple: #6a4c93;
    --mystical-blue: #264653;
    --mystical-light: #f8f9fa;
    --mystical-gradient: linear-gradient(135deg, #1a1b3a 0%, #2d1b69 50%, #6a4c93 100%);
    --mystical-text: #2c3e50;
    --mystical-text-light: #6c757d;
}

/* Base Styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--mystical-text);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

/* Navigation */
.mystical-nav {
    background: rgba(26, 27, 58, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--mystical-accent) !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--mystical-accent) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: var(--mystical-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    background: var(--mystical-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(106, 76, 147, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(45, 27, 105, 0.2) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.mystical-accent {
    color: var(--mystical-accent);
    position: relative;
}

.mystical-accent::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--mystical-accent), transparent);
    animation: shimmer 2s infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.btn-mystical {
    background: var(--mystical-accent);
    border: none;
    color: var(--mystical-primary);
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-mystical:hover {
    background: #f1c40f;
    color: var(--mystical-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 28px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--mystical-accent);
    color: var(--mystical-accent);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    animation: bounce 2s infinite;
}

/* Sections */
.mystical-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.section-title {
    font-size: 2.5rem;
    color: var(--mystical-primary);
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--mystical-accent);
}

.section-subtitle {
    color: var(--mystical-text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.mystical-icon {
    width: 80px;
    height: 80px;
    background: var(--mystical-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: transform 0.3s ease;
}

.mystical-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.mystical-icon i {
    font-size: 2rem;
    color: white;
}

/* Featured Section */
.featured-section {
    background: var(--mystical-primary);
    color: white;
}

.featured-section .section-title {
    color: white;
}

.featured-section .section-title::after {
    background: var(--mystical-accent);
}

.book-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.book-cover {
    width: 120px;
    height: 180px;
    background: var(--mystical-gradient);
    border-radius: 8px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--mystical-accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.book-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--mystical-accent);
}

.book-author {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.book-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.difficulty-badge {
    background: var(--mystical-accent);
    color: var(--mystical-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.btn-read-more {
    background: transparent;
    border: 1px solid var(--mystical-accent);
    color: var(--mystical-accent);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-read-more:hover {
    background: var(--mystical-accent);
    color: var(--mystical-primary);
    text-decoration: none;
}

/* Footer */
.mystical-footer {
    background: var(--mystical-primary);
    color: white;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--mystical-accent);
}

.social-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--mystical-accent);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .book-card {
        padding: 1.5rem;
    }

    .mystical-icon {
        width: 60px;
        height: 60px;
    }

    .mystical-icon i {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .btn-lg {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.loading:nth-child(1) { animation-delay: 0.1s; }
.loading:nth-child(2) { animation-delay: 0.2s; }
.loading:nth-child(3) { animation-delay: 0.3s; }

/* Book Detail Page Styles */
.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--mystical-accent);
    color: var(--mystical-primary);
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1rem;
}

.section-card {
    margin-bottom: 2rem;
}

.mystical-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.mystical-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.section-controls .btn {
    transition: all 0.3s ease;
}

.section-controls .btn:hover {
    transform: translateY(-2px);
}

.mind-map-preview {
    transition: all 0.3s ease;
}

.mind-map-preview:hover {
    transform: scale(1.05);
}

.mind-map-placeholder {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px dashed rgba(255, 255, 255, 0.3) !important;
    transition: all 0.3s ease;
}

.mind-map-placeholder:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--mystical-accent) !important;
}

.loading-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.loading-placeholder .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.modal-header {
    background: rgba(0, 0, 0, 0.1);
}

.modal-body audio {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
}

/* Book Detail Hero Section */
.mystical-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--mystical-accent);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .mystical-title {
        font-size: 2rem;
    }

    .section-controls .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .mind-map-preview {
        margin-top: 1rem;
    }
}