/**
 * Story List Page - Styles
 * Premium design for the chapter listing page
 */

/* ========================================
   Hero Section
   ======================================== */

.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--gradient-hero);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/desktop/Prologue - 16x9.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.85;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-8);
    max-width: 800px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-2xl);
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    color: #f97316;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s ease-out;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-8);
    color: #f97316;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s ease-out 0.1s backwards;
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    animation: slideUp 0.6s ease-out 0.2s backwards;
}

/* Language Toggle */
.language-toggle {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 2;
    display: flex;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    padding: var(--space-1);
}

.language-toggle button {
    padding: var(--space-2) var(--space-4);
    border: none;
    background: transparent;
    color: white;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.language-toggle button.active {
    background: white;
    color: var(--color-primary);
}

.language-toggle button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   Synopsis Section
   ======================================== */

.synopsis-section {
    padding: var(--space-16) 0;
    background: var(--color-bg);
}

.synopsis-content {
    max-width: 800px;
    margin: 0 auto;
}

.synopsis-title {
    text-align: center;
    margin-bottom: var(--space-8);
    color: var(--color-text-primary);
}

.synopsis-text {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    white-space: pre-line;
}

/* ========================================
   Chapters Section
   ======================================== */

.chapters-section {
    padding: var(--space-16) 0;
    background: var(--color-surface);
}

.chapters-title {
    text-align: center;
    margin-bottom: var(--space-12);
    color: var(--color-text-primary);
}

.act-group {
    margin-bottom: var(--space-12);
}

.act-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-primary);
}

.act-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    color: white;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-lg);
}

.act-name {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

/* ========================================
   Chapter Card
   ======================================== */

.chapter-card {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.chapter-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.chapter-card:active {
    transform: translateY(-4px);
}

.chapter-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-border);
}

.chapter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.chapter-card:hover .chapter-image img {
    transform: scale(1.05);
}

.chapter-duration {
    position: absolute;
    bottom: var(--space-3);
    right: var(--space-3);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.chapter-content {
    padding: var(--space-5);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chapter-number {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.chapter-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-3);
    line-height: var(--line-height-tight);
}

.chapter-meta {
    display: flex;
    gap: var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin-top: auto;
}

.chapter-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 767px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-lg);
    }

    .language-toggle {
        top: var(--space-4);
        right: var(--space-4);
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .synopsis-section,
    .chapters-section {
        padding: var(--space-8) 0;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .chapter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .chapter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Loading State
   ======================================== */

.loading-skeleton {
    background: linear-gradient(90deg,
            var(--color-border) 25%,
            var(--color-bg) 50%,
            var(--color-border) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.chapter-card.loading .chapter-image {
    background: var(--color-border);
}

.chapter-card.loading .chapter-title,
.chapter-card.loading .chapter-number {
    height: 1em;
    background: var(--color-border);
    border-radius: var(--radius-sm);
}