/* ==========================================================================
   INDEX.CSS - Splash page and main navigation styles
   ========================================================================== */

/* ==========================================================================
   ROOT VARIABLES - Fonts
   ========================================================================== */
:root {
    --font-main: 'Georgia', 'Times New Roman', serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
    --hover-brightness: 140%;
    --border-brightness: 50%;
    --border-shade-color: white;
    --color-contents: #805533;
    --button-border: color-mix(in srgb, var(--color-contents), var(--border-shade-color) var(--border-brightness));
}

/* ==========================================================================
   ROOT VARIABLES - Layer Colors (shared by light and dark mode)
   ========================================================================== */
:root {
    --color-tibetan: #2c5f7f;
    --color-wylie: #5d4037;
    --color-literal: #2e7d32;
    --color-liturgical: #6a1b9a;
    --color-commentary: #f57c00;
    --color-scholar: #00838f;
    --color-epistemic: #ad1457;
    --color-delusion: #c62828;
    --color-cognitive: #455a64;
    --color-glossary: #556b2f;
    --color-contents-nav: #b7c5cc;
}

/* ==========================================================================
   ROOT VARIABLES - Light Mode (default)
   ========================================================================== */
:root {
    --color-bg: #f9f7f1;
    --color-text: #2a2a2a;
    --color-muted: #666;
    --color-accent: #8b5a2b;
    --color-bg-secondary: #f9f7f1;
    --color-bg-tertiary: #f5f5f5;
    --color-border: #ddd;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-nav-bg: #f9f7f1;
    --color-nav-border: #ddd;
    --color-toggle-bg: #f9f7f1;
    --color-toggle-text: #333;
    --color-toggle-border: #999;
    --color-toggle-hover: #eee;
}

/* ==========================================================================
   ROOT VARIABLES - Dark Mode Overrides
   ========================================================================== */
body.dark-mode {
    --color-bg: #1a1a1a;
    --color-bg-secondary: #2d2d2d;
    --color-bg-tertiary: #3a3a3a;
    --color-text: #f0f0f0;
    --color-muted: #aaa;
    --color-border: #444;
    --color-shadow: rgba(0, 0, 0, 0.4);
    --color-nav-bg: #1e1e1e;
    --color-nav-border: #444;
    --color-toggle-bg: #333;
    --color-toggle-text: #fff;
    --color-toggle-border: #666;
    --color-toggle-hover: #444;
    --color-contents: #37474f;
    --button-border: color-mix(in srgb, var(--color-contents), white, var(--border-brightness));
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.6;
    background: var(--color-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.nav-container {
    position: sticky;
    top: 0;
    background: var(--color-nav-bg);
    border-bottom: 2px solid var(--color-nav-border);
    z-index: 1000;
    padding: 0.5em 1em;
    box-shadow: 0 2px 4px var(--color-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    margin: 0 0.5em;
}

.dark-mode-toggle {
    padding: 0.4em 0.8em;
    border: 1px solid var(--button-border);
    border-radius: 4px;
    background: var(--color-contents);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    height: auto;
    box-sizing: border-box;
    min-height: 28px;
    max-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.dark-mode-toggle:hover {
    filter: brightness(var(--hover-brightness));
    transform: translateY(-1px);
}

.nav-tab {
    padding: 0.4em 0.8em;
    border: 1px solid var(--button-border);
    border-radius: 4px;
    background: var(--color-contents);
    font-family: var(--font-main);
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
    height: auto;
    box-sizing: border-box;
    min-height: 28px;
    max-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.nav-tab:hover {
    filter: brightness(var(--hover-brightness));
    transform: translateY(-1px);
}

.nav-tab.active {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255,255,255,0.4);
    font-weight: bold;
}

.nav-tab.introduction.active {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255,255,255,0.4);
    font-weight: bold;
}

.nav-tab.contents.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.layer-dropdown {
    background: var(--color-contents);
    color: var(--color-text);
    border: 1px solid var(--button-border);
    border-radius: 4px;
    padding: 0.4em 0.8em;
    font-family: var(--font-main);
    font-size: 0.85em;
    cursor: pointer;
    outline: none;
    height: auto;
    line-height: 1.4;
    box-sizing: border-box;
    min-height: 28px;
    max-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.layer-dropdown:hover {
    filter: brightness(var(--hover-brightness));
    transform: translateY(-1px);
}

.layer-dropdown:focus {
    box-shadow: none;
}

.layer-dropdown option {
    background: var(--color-bg);
    color: #fff;
}

.chapter-dropdown {
    background: var(--color-contents);
    color: var(--color-text);
    border: 1px solid var(--button-border);
    border-radius: 4px;
    padding: 0.4em 0.8em;
    font-family: var(--font-main);
    font-size: 0.85em;
    cursor: pointer;
    outline: none;
    height: auto;
    line-height: 1.4;
    box-sizing: border-box;
    min-height: 28px;
    max-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.chapter-dropdown:hover {
    filter: brightness(var(--hover-brightness));
    transform: translateY(-1px);
}

.chapter-dropdown:focus {
    box-shadow: none;
}

.chapter-dropdown option {
    background: var(--color-bg);
    color: #fff;
}

.toolbar-nav-btn {
    background: var(--color-contents);
    color: var(--color-text);
    border: 1px solid var(--button-border);
    border-radius: 4px;
    padding: 0.4em 0.8em;
    font-family: var(--font-main);
    font-size: 0.85em;
    cursor: pointer;
    outline: none;
    line-height: 1.4;
    height: auto;
    box-sizing: border-box;
    min-height: 28px;
    max-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.toolbar-nav-btn:hover {
    filter: brightness(var(--hover-brightness));
    transform: translateY(-1px);
}

.toolbar-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   LAYER TAB COLORS
   ========================================================================== */
.nav-tab.tibetan {
    background: var(--color-tibetan);
}

.nav-tab.wylie {
    background: var(--color-wylie);
}

.nav-tab.literal {
    background: var(--color-literal);
}

.nav-tab.liturgical {
    background: var(--color-liturgical);
}

.nav-tab.commentary {
    background: var(--color-commentary);
}

.nav-tab.scholar {
    background: var(--color-scholar);
}

.nav-tab.epistemic {
    background: var(--color-epistemic);
}

.nav-tab.delusion {
    background: var(--color-delusion);
}

.nav-tab.cognitive {
    background: var(--color-cognitive);
}

.nav-tab.glossary.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   CONTENT LAYERS
   ========================================================================== */
.content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.layer-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.layer-content.active {
    display: flex;
}

.layer-header {
    padding: 0.5em 1.5em;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
}

.layer-header .header-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-text);
}

.layer-header .header-info {
    color: var(--color-muted);
    font-size: 0.85em;
}

.layer-header .header-indicator {
    font-size: 0.7em;
    font-weight: bold;
    color: var(--color-text);
}

.iframe-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.layer-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--color-bg);
    min-height: 100%;
}

/* ==========================================================================
   LINE INDICATOR
   ========================================================================== */
.line-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.75em 1em;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    z-index: 1001;
    display: none;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.line-indicator.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   CONSENT MODAL
   ========================================================================== */
.consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 2em;
}

.consent-modal.hidden {
    display: none;
}

.consent-content {
    max-width: 900px;
    text-align: center;
    padding: 0 1em;
}

.consent-header {
    margin-bottom: 1.5em;
}

.consent-header .main-title {
    font-size: 1.1em;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5em;
}

.consent-header .title {
    font-size: 2.2em;
    color: var(--color-tibetan);
    margin: 0.3em 0;
    font-weight: normal;
}

.consent-header .author {
    font-size: 1.1em;
    color: var(--color-muted);
    font-style: italic;
    margin-bottom: 0.5em;
}

.consent-header .subtitle {
    font-size: 1.1em;
    color: var(--color-text);
}

.consent-divider {
    width: 60%;
    height: 1px;
    background: var(--color-border);
    margin: 1.5em auto;
}

.consent-description {
    text-align: justify;
    line-height: 1.8;
    color: var(--color-text);
    font-size: 0.95em;
    margin-bottom: 1.5em;
}

.consent-disclaimer {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5em;
    margin: 1.5em 0;
    text-align: left;
}

.consent-disclaimer ol {
    margin: 0;
    padding-left: 1.5em;
}

.consent-disclaimer li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.consent-agree-btn {
    display: inline-block;
    background: var(--color-tibetan);
    color: #fff;
    border: none;
    padding: 1em 2.5em;
    font-size: 1em;
    font-family: var(--font-main);
    cursor: pointer;
    border-radius: 4px;
    margin-top: 1.5em;
    transition: all 0.2s ease;
}

.consent-agree-btn:hover {
    background: #3a7a9f;
    transform: translateY(-1px);
}

.consent-footer {
    margin-top: 2em;
    color: var(--color-muted);
    font-size: 0.85em;
}

.consent-footer .license {
    margin-bottom: 0.5em;
}

.consent-footer .verse {
    font-style: italic;
    margin: 1em 0;
    line-height: 1.6;
}

.consent-footer .translator {
    margin-top: 1em;
}

.consent-footer .report {
    margin-top: 1em;
    font-size: 0.8em;
}

.consent-footer a {
    color: var(--color-tibetan);
    text-decoration: none;
}

.consent-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   IMAGE CONSENT MODAL
   ========================================================================== */
.consent-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 2em;
}

.consent-image-modal.hidden {
    display: none;
}

.consent-image-content {
    max-width: 900px;
    text-align: center;
    padding: 0 1em;
}

.consent-image-content img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1.5em;
    box-shadow: 0 4px 20px var(--color-shadow);
}

.consent-image-content .image-caption {
    color: var(--color-muted);
    font-style: italic;
    margin-bottom: 1em;
    font-size: 0.9em;
}

.consent-image-content .confirm-text {
    color: var(--color-text);
    font-size: 1.1em;
    margin-bottom: 1em;
}

/* ==========================================================================
   WELCOME SCREEN
   ========================================================================== */
.welcome-screen {
    text-align: center;
    padding: 4em 2em;
    background: var(--color-bg-secondary);
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.welcome-screen h1 {
    font-size: 2.5em;
    color: var(--color-tibetan);
    margin-bottom: 0.5em;
}

.welcome-screen .subtitle {
    font-size: 1.2em;
    color: var(--color-muted);
    margin-bottom: 2em;
}

.welcome-screen .description {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
    color: var(--color-text);
}

.welcome-screen .description p {
    margin-bottom: 1em;
}

/* ==========================================================================
   RESPONSIVE (commented out - preserved from original)
   ========================================================================== */
/*
@media (max-width: 768px) {
    .nav-tab {
        padding: 0.4em 0.6em;
        font-size: 0.75em;
    }

    .nav-tab.introduction {
        padding: 0.4em 0.6em;
        font-size: 0.75em;
    }

    .nav-tab.contents {
        padding: 0.4em 0.6em;
    }

    .nav-divider {
        height: 18px;
        margin: 0 0.25em;
    }

    .consent-header .main-title {
        font-size: 0.9em;
    }

    .consent-header .title {
        font-size: 1.6em;
    }

    .consent-header .author,
    .consent-header .subtitle {
        font-size: 1em;
    }

    .consent-description {
        font-size: 0.9em;
        text-align: left;
    }

    .consent-disclaimer {
        padding: 1em;
    }

    .consent-disclaimer li {
        font-size: 0.85em;
    }

    .consent-agree-btn {
        padding: 0.8em 1.5em;
        font-size: 0.9em;
    }

    .consent-footer {
        font-size: 0.8em;
    }

    .consent-footer .verse {
        font-size: 0.9em;
    }

    .consent-image-content img {
        max-height: 50vh;
    }

    .consent-image-content .confirm-text {
        font-size: 1em;
    }

    .nav-tabs {
        gap: 0.15em;
    }

    .nav-tab {
        padding: 0.4em 0.6em 0.4em 1.4em;
        font-size: 0.75em;
    }

    .nav-tab::before {
        left: 6px;
        width: 6px;
        height: 6px;
    }

    .nav-tab.introduction {
        padding: 0.4em 0.6em 0.4em 1.4em;
        font-size: 0.75em;
    }

    .nav-tab.introduction::before {
        left: 6px;
        width: 6px;
        height: 6px;
    }

    .nav-tab.contents {
        padding: 0.4em 0.6em;
    }

    .nav-divider {
        height: 18px;
        margin: 0 0.25em;
    }
}
*/
