/* ============================================
   NARRATIVE WEBSITE - BOSS.CSS
   ============================================ */

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* ============================================
   INDEX PAGE - MAIN CONTAINER
   ============================================ */

.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.primary-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.primary-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* ============================================
   NARRATIVE GRID
   ============================================ */

.narrative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.narrative-card {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.narrative-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.narrative-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.narrative-card .topic {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.narrative-card .description {
    color: #555;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.narrative-card .sections {
    color: #95a5a6;
    font-size: 0.85rem;
    font-style: italic;
}

/* ============================================
   NARRATIVE PAGE - NAVIGATION
   ============================================ */

.narrative-nav {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--white);
    border-radius: 5px;
    transition: var(--transition);
    font-size: 1rem;
}

.back-btn:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.narrative-nav h1 {
    font-size: 1.5rem;
    flex-grow: 1;
}

/* ============================================
   SPLIT PANE LAYOUT
   ============================================ */

.split-pane {
    display: flex;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.text-pane {
    flex: 0.67;
    overflow-y: auto;
    padding: 3rem;
    background-color: var(--white);
}

.media-pane {
    flex: 1;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ============================================
   TEXT CONTENT STYLES
   ============================================ */

.narrative-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--light-bg);
}

.header-content {
    font-size: 1.1rem;
}

.narrative-section {
    margin-bottom: 1rem;
    padding: 1rem 0;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.narrative-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.1rem;
    color: var(--text-color);
}

.narrative-section .subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.1rem;
    color: #1C4F7A;
    font-weight: bold;
    opacity: 1;
}

.narrative-section .blue-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.1rem;
    color: #1C4F7A;
    opacity: 1;
}

/* ============================================
   MEDIA CONTENT STYLES
   ============================================ */

.media-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.media-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.media-image {
    max-width: 100%;
    max-height: calc(100% - 80px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.media-iframe {
    width: 100%;
    height: calc(100% - 80px);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Caption Styles */
.media-caption {
    width: 100%;
    max-width: 800px;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    border-left: 3px solid var(--secondary-color);
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color);
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: auto;
}

/* Media Navigation Controls */
.media-nav {
    position: absolute;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.media-nav-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.media-nav-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.media-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.media-counter {
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.media-placeholder {
    text-align: center;
    color: #95a5a6;
    font-size: 1.2rem;
}

/* Fade-in animation for media transitions */
.fade-in {
    animation: mediaFadeIn 0.3s ease;
}

@keyframes mediaFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   SCROLL EFFECTS
   ============================================ */

/* Active section (in viewport) */
.narrative-section {
    scroll-margin-top: 100px;
}

/* Make current section more prominent */
.text-pane:has(.narrative-section) .narrative-section {
    opacity: 0.6;
}

.narrative-section:hover {
    opacity: 1;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */

.error {
    color: var(--accent-color);
    background-color: #ffe6e6;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid var(--accent-color);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .split-pane {
        flex-direction: column;
        height: auto;
    }

    .text-pane {
        padding: 2rem;
    }

    .media-pane {
        position: relative;
        height: 50vh;
        top: 0;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .narrative-grid {
        grid-template-columns: 1fr;
    }

    .narrative-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .narrative-nav h1 {
        font-size: 1.2rem;
    }

    .text-pane {
        padding: 1.5rem;
    }

    .header-content {
        font-size: 1rem;
    }

    .narrative-section p {
        font-size: 1rem;
    }
}
