:root {
    --bg-color: #121212;
    --text-color: #f5f5f5;
    --accent-color: #c5a059;
    --rubric-color: #8c2d19; /* A classic liturgical red for instructions */
    --hover-bg: #2a2a2a;
    --border-color: rgba(197, 160, 89, 0.3);
    --font-serif: 'Crimson Text', serif;
    --font-header: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}

[data-theme="light"] {
    --bg-color: #fcfcfc;
    --text-color: #1a1a1a;
    --accent-color: #b08d55;
    --rubric-color: #c0392b;
    --hover-bg: #f0f0f0;
    --border-color: rgba(176, 141, 85, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0 1rem;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.accessibility-controls {
    position: absolute;
    top: 1rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.accessibility-controls button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.accessibility-controls button:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-color);
}

.icon-btn svg {
    display: block;
}


.progress-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 0 2rem;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    position: relative;
    margin-bottom: 1rem;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.progress-bar li {
    position: relative;
    z-index: 2;
    background: var(--bg-color);
    padding: 0 15px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-color);
    opacity: 0.4;
    transition: all 0.4s ease;
}

.progress-bar li.active-step {
    opacity: 1;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(197, 160, 89, 0.8);
    font-weight: 600;
}

.phase-summary {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-color);
    margin-top: 0.75rem;
    opacity: 0.8;
}

#current-phase-name {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#current-phase-summary {
    font-style: italic;
}

/* App Container Layout */
.app-container {
    display: flex;
    margin-top: 60px; /* Offset for top nav */
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* Liturgy Scroll Column */
.liturgy-column {
    flex: 1;
    padding: 4rem 10%;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.liturgy-content h1 {
    font-family: var(--font-header);
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    font-weight: 500;
}

.section-title {
    color: var(--accent-color);
    font-family: var(--font-header);
    text-align: center;
    margin-top: 6rem;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

/* Remove top margin for the very first section title if desired, or keep spacing consistent */
.liturgy-section:first-child .section-title {
    margin-top: 0;
}

.liturgical-text {
    max-width: 650px;
    margin: 0 auto;
    font-size: 1.25rem;
}

.rubric {
    color: var(--rubric-color);
    font-style: italic;
    font-size: 1rem;
    margin: 2rem 0 1rem;
    font-family: var(--font-sans);
    text-align: center;
}

.verse {
    margin-bottom: 0.5rem;
}

.response {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 2rem;
}

.keyword, .liturgy-link {
    border-bottom: 1.5px solid var(--accent-color);
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0 2px;
    color: inherit;
    text-decoration: none;
}

.keyword:hover, .liturgy-link:hover {
    background-color: var(--hover-bg);
}

/* Sidebar (Patristic Library) */
.sidebar {
    width: 400px;
    background-color: #1a1a1a;
    padding: 2rem;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-header h2 {
    font-family: var(--font-header);
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.content-body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.8;
}

.content-body h3 {
    font-family: var(--font-header);
    color: var(--accent-color);
    margin: 1.5rem 0 1rem;
}

.placeholder-text {
    opacity: 0.5;
    font-style: italic;
    margin-top: 5rem;
    text-align: center;
}

.mobile-only-btn {
    display: none;
    margin-top: 2rem;
    width: 100%;
    padding: 1rem;
    background: none;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .top-nav {
        padding: 0.5rem 0 0.5rem;
    }

    .accessibility-controls {
        position: relative;
        top: auto;
        right: auto;
        justify-content: flex-end;
        padding: 0 1rem;
        margin-bottom: 0.5rem;
    }

    .app-container {
        flex-direction: column;
        margin-top: 140px; /* Increased offset for controls + nav */
        height: calc(100vh - 140px);
    }

    .liturgy-column {
        padding: 2rem 5%;
        border-right: none;
    }

    .sidebar {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        height: 70vh;
        z-index: 200;
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        border-top: 1.5px solid var(--accent-color);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    }

    .sidebar.active {
        transform: translateY(-70vh);
    }

    .mobile-only-btn {
        display: block;
    }

    .progress-container {
        padding: 0 1rem;
        width: 100%;
    }

    .progress-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 1.5rem;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        font-size: 0.75rem;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .progress-bar::-webkit-scrollbar {
        display: none;
    }

    .progress-bar li {
        flex: 0 0 auto;
        padding: 0;
    }

    .progress-bar::before {
        display: none; /* Hide line on mobile */
    }

    .phase-summary {
        font-size: 0.75rem;
        line-height: 1.3;
        padding: 0 0.5rem;
    }
}
