@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;800&family=Crimson+Pro:wght@400;600&display=swap');

.story-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background: #f5f1e8;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.hero-section {
    position: relative;
    text-align: center;
    color: #2c1810;
    margin-bottom: 4rem;
    border-radius: 15px;
    overflow: hidden;
    height: 400px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(139, 69, 19, 0.1);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #8b4513, #d4a76a);
    opacity: 0.7;
}

.hero-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-section h1 {
    font-family: 'Cinzel', serif;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    color: #2c1810;
}

.hero-section h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b4513, transparent);
}

.hero-section p {
    font-family: 'Crimson Pro', serif;
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    color: #333;
    line-height: 1.9;
    margin-bottom: 1.8rem;
    text-align: justify;
    letter-spacing: 0.3px;
}

.timeline-section {
    margin-bottom: 4rem;
    padding: 30px 0;
    margin: 40px 0;
}

.timeline-section h2 {
    font-family: 'Cinzel', serif;
    text-align: center;
    margin-bottom: 2rem;
    color: #5c2810;
    font-size: 2.2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
    font-weight: 600;
}

.timeline {
    position: relative;
}

.timeline-item {
    padding: 25px;
    border-left: 4px solid #8b4513;
    margin-left: 25px;
    position: relative;
    margin-bottom: 35px;
    background: #fdfbf7;
    border-radius: 0 20px 20px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 25px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b4513;
    box-shadow: 0 0 0 5px rgba(139, 69, 19, 0.2);
}

.timeline-date {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.culture-section {
    padding: 2rem 0;
    background: #fdfbf7;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    display: flex;
    gap: 30px;
    align-items: start;
    border: 1px solid rgba(139, 69, 19, 0.1);
    transition: transform 0.3s ease;
}

.culture-section:hover {
    transform: translateY(-5px);
}

.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.culture-item {
    background: #fdfbf7;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    display: flex;
    gap: 30px;
    align-items: start;
    border: 1px solid rgba(139, 69, 19, 0.1);
    transition: transform 0.3s ease;
}

.culture-item:hover {
    transform: translateY(-5px);
}

.culture-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.culture-item img:hover {
    transform: scale(1.02);
}

.culture-item h3 {
    font-family: 'Cinzel', serif;
    padding: 1rem;
    margin: 0;
    color: #5c2810;
    font-size: 1.8rem;
    margin: 2rem 0 1.5rem;
    font-weight: 600;
}

.culture-item p {
    font-family: 'Crimson Pro', serif;
    padding: 0 1rem 1rem;
    margin: 0;
    color: #333;
    line-height: 1.9;
    margin-bottom: 1.8rem;
    font-size: 1.2rem;
    text-align: justify;
    letter-spacing: 0.3px;
}

/* Modern UI and Animation Styles for Story Page */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #f1c40f;
    --text-color: #34495e;
    --background-color: #ecf0f1;
    --timeline-color: #3498db;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--background-color);
}

.timeline-item {
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease forwards;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.timeline-title {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.timeline-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: left;
    animation: titleLine 0.6s ease forwards 0.5s;
}

.timeline-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--timeline-color);
    color: white;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1rem;
    transform: translateX(-20px);
    opacity: 0;
    animation: slideIn 0.6s ease forwards;
}

.character-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin: 1.5rem 0;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.character-image:hover {
    transform: scale(1);
}

.cultural-section, .battle-section, .traditions-section, .artifact-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--accent-color);
    transform: translateX(-20px);
    opacity: 0;
    animation: slideIn 0.6s ease forwards 0.3s;
}

.quote-section {
    font-style: italic;
    font-size: 1.2rem;
    color: var(--primary-color);
    padding: 2rem;
    position: relative;
    margin: 2rem 0;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 0.5s;
}

.quote-section::before,
.quote-section::after {
    content: '"';
    font-size: 4rem;
    color: var(--secondary-color);
    position: absolute;
    opacity: 0.2;
}

.quote-section::before {
    top: -10px;
    left: 0;
}

.quote-section::after {
    bottom: -40px;
    right: 0;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes titleLine {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-container {
        padding: 1rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

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

    .character-image {
        height: 300px;
    }
}

/* Scroll Animation Trigger */
.timeline-item {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark mode adjustments */
body.dark {
    background: #1a1a1a;
}

body.dark .story-container {
    background: #1a1a1a;
}

body.dark .hero-section {
    background: #242526;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark .hero-section h1,
body.dark .hero-section h2,
body.dark .hero-section h3 {
    color: #d4a76a;
}

body.dark .hero-section p {
    color: #e0e0e0;
}

body.dark .timeline-item {
    background: #2a2a2a;
    border-left-color: #d4a76a;
}

body.dark .timeline-item::before {
    background: #d4a76a;
    box-shadow: 0 0 0 5px rgba(212, 167, 106, 0.2);
}

body.dark .timeline-date {
    color: #d4a76a;
}

body.dark .culture-section {
    background: #242526;
    border-color: rgba(212, 167, 106, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .story-container {
        margin-left: 0;
        padding: 15px;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section {
        padding: 25px;
    }

    .culture-section {
        flex-direction: column;
        padding: 20px;
    }

    .culture-item img {
        width: 100%;
    }

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

    .subsection-title {
        font-size: 1.5rem;
    }

    .story-text {
        font-size: 1.1rem;
    }
}

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--secondary-color);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Story Navigation */
.story-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.story-nav:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.story-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.story-nav li {
    margin: 15px 0;
}

.story-nav .nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 15px 8px 35px;
    border-radius: 20px;
    display: block;
}

.story-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--timeline-color);
    transition: all 0.3s ease;
}

.story-nav .nav-link:hover {
    color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
}

.story-nav .nav-link:hover::before {
    transform: translateY(-50%) scale(1.5);
    background: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color);
}

.story-nav .nav-link.active {
    color: white;
    background: var(--timeline-color);
}

.story-nav .nav-link.active::before {
    background: white;
    transform: translateY(-50%) scale(1.2);
}

/* Dark mode adjustments */
body.dark .story-nav {
    background: rgba(30, 30, 30, 0.95);
}

body.dark .story-nav .nav-link {
    color: #fff;
}

body.dark .story-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .story-nav {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        transform: none;
        border-radius: 15px 15px 0 0;
        padding: 10px;
    }

    .story-nav ul {
        display: flex;
        overflow-x: auto;
        padding: 5px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .story-nav li {
        margin: 0 10px;
        flex-shrink: 0;
    }

    .story-nav .nav-link {
        white-space: nowrap;
        padding: 8px 15px;
    }

    .story-nav .nav-link::before {
        display: none;
    }
}
