/* Css/story-detail.css - Full Version with Option 1 Characters */

/* === Variables === */
:root {
    --color-theme-accent: #e6739f;
    --color-theme-rgb: 230, 115, 159;
    --color-text-black: #000000;
    --color-text-very-dark: #1a1a1a;
    --color-text-medium: #495057;
    --color-text-light: #6c757d;
    --color-background-page: #f8f9fa;
    --color-background-card: white;
    --color-border-light: #dee2e6;
    --color-status-ongoing-text: #b37400;
    --color-status-ongoing-bg: 255, 165, 0;
    --color-status-completed-text: #1c6420;
    --color-status-completed-bg: 76, 175, 80;
    --color-tags-text: #44446b;
    --color-tags-bg: 100, 100, 150;
    --font-readable-body: 'Inter', sans-serif;
}

/* === ADDED: Keyframes for Glow Pulse Animation === */
@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.1))
                drop-shadow(0px 0px 12px rgba(255, 255, 255, 0.3));
        opacity: 0.85; /* Base opacity - Adjust if needed */
    }
    50% {
        filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.15))
                drop-shadow(0px 0px 22px rgba(255, 255, 255, 0.5));
        opacity: 1; /* Peak opacity */
    }
}
/* ================================================ */

/* === ADDED: Wrapper for Positioning Context === */
.page-wrapper-with-chars {
    position: relative;
    overflow-x: hidden;
    padding-top: 1px;
    padding-bottom: 1px;
}
/* ============================================== */


/* === Main Container Styling === */
.story-detail-container {
    max-width: 1100px;
    margin: 80px auto; /* Increased top/bottom margin */
    padding: 35px 45px;
    background: var(--color-background-card, white);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.09);
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    position: relative;
    z-index: 1; /* Above side characters */
}
@keyframes fadeIn { to { opacity: 1; } }
.story-detail-container.aos-animate { opacity: 1; }


/* === Column Layout === */
.story-detail-left { flex: 1.2; min-width: 320px; }
.story-detail-right { flex: 0.8; min-width: 300px; }


/* === Cover Media Styling === */
.story-cover-media { width: 100%; margin-bottom: 30px; position: relative; background-color: #f0f0f0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.story-cover { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.story-cover-placeholder { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #ccc; }
.story-cover-media video[style*="display: block"] ~ #media-placeholder,
.story-cover-media img[style*="display: block"] ~ #media-placeholder { display: none; }


/* === Text Content Styling === */
.story-info-header { /* Using Bootstrap d-flex align-items-center mb-2 */ }
.story-title { font-size: 2.6rem; font-weight: 700; color: var(--color-text-very-dark, #1a1a1a); line-height: 1.2; }
.story-pairing { font-size: 1.1rem; font-weight: 600; color: var(--color-text-medium, #495057); margin-bottom: 15px; display: inline-block; }
/* Status */
.story-status { display: inline-block; padding: 5px 12px; border-radius: 15px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; background-color: rgba(var(--color-status-ongoing-bg, 255, 165, 0), 0.15); color: var(--color-status-ongoing-text, #b37400); border: 1px solid rgba(var(--color-status-ongoing-bg, 255, 165, 0), 0.3); }
.story-status.status-completed { background-color: rgba(var(--color-status-completed-bg, 76, 175, 80), 0.15); color: var(--color-status-completed-text, #1c6420); border-color: rgba(var(--color-status-completed-bg, 76, 175, 80), 0.3); }
/* Tags */
.story-tags { flex-wrap: wrap; gap: 8px; } /* display: flex; set by JS */
.tag-badge { background-color: rgba(var(--color-tags-bg, 100, 100, 150), 0.1); color: var(--color-tags-text, #44446b); padding: 4px 10px; border-radius: 15px; font-size: 0.8rem; font-weight: 500; border: 1px solid rgba(var(--color-tags-bg, 100, 100, 150), 0.2); white-space: nowrap; transition: transform 0.2s ease; }
.tag-badge:hover { transform: translateY(-1px); }
/* Synopsis */
.story-synopsis-wrapper { margin-top: 25px; border-top: 1px solid var(--color-border-light, #dee2e6); padding-top: 25px; }
.synopsis-heading { font-size: 1.3rem; font-weight: 700; color: var(--color-text-very-dark, #1a1a1a); margin-bottom: 15px; }
.story-synopsis { font-size: 1rem; line-height: 1.7; color: var(--color-text-black, #000000); font-family: var(--font-readable-body, 'Inter', sans-serif); }
/* Actions */
.story-actions { display: flex; gap: 15px; flex-wrap: wrap; }
.action-btn { background-color: #f0f0f0; border: 1px solid #ddd; color: #555; padding: 8px 18px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: all 0.25s ease; display: inline-flex; align-items: center; gap: 8px; }
.action-btn:hover { background-color: #e0e0e0; color: #333; border-color: #ccc; transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.action-btn i { font-size: 1rem; line-height: 1; transition: color 0.25s ease, transform 0.25s ease; }
.action-btn:hover i { transform: scale(1.1); }
.action-btn.active { background-color: var(--color-theme-accent, #e6739f); color: white; border-color: var(--color-theme-accent, #e6739f); }
.action-btn.active:hover { background-color: #d6638f; border-color: #d6638f; }
.action-btn.active i { color: white; }


/* === UPDATED: Flanking Character Image Styles === */
.side-character-img {
    position: absolute;
    bottom: 2%; /* Adjust distance from bottom */
    max-height: 80vh; /* Increased size */
    max-width: 450px;  /* Increased size */
    width: auto;
    height: auto;
    z-index: 0; /* Behind main content */
    pointer-events: none;
    display: none; /* Hide initially */
    /* Base filter for initial state */
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.1))
            drop-shadow(0px 0px 12px rgba(255, 255, 255, 0.3));
    opacity: 0; /* Start fully transparent */
    transition: opacity 1s ease-in-out; /* Smooth fade-in */
}

.char-left {
    left: 2%; /* Adjust positioning */
    transform: translateX(0);
}

.char-right {
    right: 2%; /* Adjust positioning */
    transform: translateX(0);
}

/* Apply animation and final opacity when shown by JS */
.side-character-img[style*="display: block"] {
    opacity: 0.85; /* Base opacity - Adjust 0 to 1 */
    animation: glowPulse 5s ease-in-out infinite; /* Apply the animation */
}

/* Hide flanking images on smaller screens */
@media (max-width: 1400px) {
    .side-character-img {
        max-height: 70vh;
        max-width: 350px;
        left: 1%;
        right: 1%;
    }
}
@media (max-width: 1200px) {
    .side-character-img {
        display: none !important;
    }
}
/* === END OF Flanking Character Styles === */


/* === Chapter List Styling === */
.chapter-list-wrapper { background-color: #fdfdfd; padding: 20px 25px; border-radius: 10px; border: 1px solid var(--color-border-light, #dee2e6); height: 100%; box-sizing: border-box; }
.chapters-heading { font-size: 1.3rem; font-weight: 700; color: var(--color-text-very-dark, #1a1a1a); margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--color-border-light, #dee2e6); }
.chapter-list { list-style: none; padding: 0; margin: 0; max-height: 500px; overflow-y: auto; }
.chapter-list::-webkit-scrollbar { width: 6px; }
.chapter-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.chapter-list::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }
.chapter-list::-webkit-scrollbar-thumb:hover { background-color: #aaa; }
.chapter-list li { margin-bottom: 0; border-bottom: 1px solid #f0f0f0; transition: background-color 0.2s ease; }
.chapter-list li:last-child { border-bottom: none; }
.chapter-list li:hover { background-color: #f7f7f7; }
.chapter-list a { display: block; padding: 12px 10px; text-decoration: none; color: var(--color-text-black, #000000); font-size: 0.95rem; transition: color 0.2s ease, padding-left 0.2s ease; font-family: var(--font-readable-body, 'Inter', sans-serif); font-weight: 500; }
.chapter-list a:hover { color: var(--color-theme-accent, #e6739f); padding-left: 15px; }
.chapter-loading { padding: 15px 10px; color: var(--color-text-light, #6c757d); font-style: italic; text-align: center; font-family: var(--font-readable-body, 'Inter', sans-serif); }


/* === Responsive Adjustments === */
@media (max-width: 992px) { .story-detail-container { padding: 20px 30px; gap: 30px; } }
@media (max-width: 768px) { .story-detail-container { flex-direction: column; margin: 50px auto; padding: 20px 15px; } .story-title { font-size: 2.2rem; } .chapter-list-wrapper { height: auto; } .chapter-list { max-height: none; overflow-y: visible; } .story-info-header { flex-wrap: wrap; } .story-status { margin-top: 5px; } }
@media (max-width: 576px) { .story-title { font-size: 2rem; } .story-pairing { font-size: 1rem; } .synopsis-heading, .chapters-heading { font-size: 1.2rem; } .story-actions { justify-content: center; } }