:root {
    --gradient-start: #f5ebe0;
    --gradient-end: #e8dcc9;
    --card-background: rgba(255, 253, 248, 0.95);
    --accent: #8b5a3c;
    --accent-dark: #5d3a1a;
    --text-color: #2c2416;
    --text-light: #8a7968;
    --border-color: rgba(139, 90, 60, 0.12);
    --shadow: 0 12px 40px rgba(139, 90, 60, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    margin: 0;
    padding: 30px 20px;
    background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
}

/* Subtle paper texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 90, 60, 0.03) 2px, rgba(139, 90, 60, 0.03) 4px);
    pointer-events: none;
    z-index: 1;
}

.passage-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.passage-header {
    text-align: center;
    color: var(--accent-dark);
    margin-bottom: 30px;
    padding: 30px;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.night-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.night-toggle:hover {
    background: rgba(139, 90, 60, 0.05);
    transform: scale(1.1);
}

.passage-header h1 {
    margin: 0 0 12px;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.passage-subtitle {
    opacity: 0.8;
    font-style: italic;
    font-size: 1.1rem;
    margin: 0;
}

.passage-card {
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px;
    min-height: 400px;
    border: 1px solid var(--border-color);
}

.passage-loading {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
}

.passage-loading .spinner {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.passage-error {
    border-left: 4px solid var(--accent);
    background: rgba(139, 90, 60, 0.08);
    color: var(--accent-dark);
    padding: 24px;
    border-radius: 12px;
    font-size: 1.05rem;
}

.passage-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px 0;
}

.verse-row {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    position: relative;
    line-height: 1.9;
}

/* Beautiful drop cap for first verse */
.verse-row:first-child .verse-text::first-letter {
    font-size: 3.8em;
    font-weight: 700;
    float: left;
    line-height: 0.85;
    margin: 0.08em 0.15em 0 0;
    color: var(--accent-dark);
    font-family: 'Georgia', serif;
}

.verse-number {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
    min-width: 45px;
    text-align: right;
    padding-top: 4px;
    opacity: 0.8;
}

.verse-text {
    flex: 1;
    font-size: 1.2rem;
    line-height: 1.9;
    color: var(--text-color);
    font-family: 'Georgia', 'Times New Roman', serif;
    text-align: justify;
    hyphens: auto;
}

.passage-footer {
    margin-top: 30px;
    text-align: center;
}

.back-link {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: inline-block;
    background: var(--card-background);
    transition: all 0.2s ease;
}

.back-link:hover {
    background: rgba(139, 90, 60, 0.05);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Night Mode */
body.night-mode {
    --gradient-start: #1a1614;
    --gradient-end: #2d2520;
    --card-background: rgba(40, 35, 30, 0.95);
    --accent: #d4a574;
    --accent-dark: #f0d0a0;
    --text-color: #e8dcc9;
    --text-light: #b09a7f;
    --border-color: rgba(212, 165, 116, 0.2);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body.night-mode::before {
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(212, 165, 116, 0.02) 2px, rgba(212, 165, 116, 0.02) 4px);
}

body.night-mode .verse-row:first-child .verse-text::first-letter {
    color: var(--accent-dark);
}

@media (max-width: 600px) {
    body {
        padding: 20px 15px;
    }

    .passage-card {
        padding: 25px 20px;
    }

    .passage-header {
        padding: 25px 20px;
    }

    .passage-header h1 {
        font-size: 2rem;
    }

    .verse-row {
        gap: 15px;
    }

    .verse-number {
        min-width: 35px;
        font-size: 0.85rem;
    }

    .verse-text {
        font-size: 1.1rem;
        text-align: left;
    }

    .night-toggle {
        top: 15px;
        right: 15px;
    }
}

/* Version Dropdown */
.version-dropdown {
    position: relative;
    display: inline-block;
}

.version-btn {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.version-btn:hover {
    background: rgba(139, 90, 60, 0.05);
    border-color: var(--accent);
}

.dropdown-arrow {
    font-size: 0.7em;
    opacity: 0.7;
    transition: transform 0.2s;
}

.version-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.version-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    margin-top: 8px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.version-dropdown.open .version-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.version-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 4px;
    transition: background 0.2s;
}

.version-option:hover {
    background: rgba(139, 90, 60, 0.08);
}

.version-option.active {
    background: var(--accent);
    color: #fff;
}

.version-code {
    font-weight: bold;
    font-size: 0.85em;
    text-transform: uppercase;
    min-width: 35px;
    text-align: center;
    background: rgba(0,0,0,0.05);
    padding: 2px 4px;
    border-radius: 4px;
}

.version-option.active .version-code {
    background: rgba(255,255,255,0.2);
}

.version-name {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Night mode adjustments */
body.night-mode .version-menu {
    background: #1a1f2e;
    border-color: #2d3748;
}

body.night-mode .version-btn {
    background: #1a1f2e;
    border-color: #2d3748;
    color: #e2e8f0;
}

body.night-mode .version-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.night-mode .version-option.active {
    background: var(--accent);
    color: #fff;
}

