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

body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Dark theme (default) */
body.dark {
    background-color: #1a1a1a;
    color: #e8e8e8;
}

body.dark header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #444;
}

body.dark .psalm {
    background-color: #242424;
    border: 1px solid #404040;
}

body.dark .settings-panel {
    background-color: rgba(0, 0, 0, 0.9);
}

body.dark .settings-content {
    background-color: #2d2d2d;
    border: 1px solid #444;
}

body.dark button {
    background-color: #404040;
    color: #e8e8e8;
    border: 1px solid #666;
}

body.dark button:hover {
    background-color: #505050;
}

body.dark input[type="time"],
body.dark select {
    background-color: #404040;
    color: #e8e8e8;
    border: 1px solid #666;
}

/* Light theme */
body.light {
    background-color: #f9f9f9;
    color: #333;
}

body.light header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
}

body.light .psalm {
    background-color: #fff;
    border: 1px solid #e0e0e0;
}

body.light .settings-panel {
    background-color: rgba(0, 0, 0, 0.5);
}

body.light .settings-content {
    background-color: #fff;
    border: 1px solid #ddd;
}

body.light button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

body.light button:hover {
    background-color: #e0e0e0;
}

body.light input[type="time"],
body.light select {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
}

/* Header */
header {
    padding: 2rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: normal;
}

header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: normal;
    opacity: 0.8;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Main content */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

#psalms-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.psalm {
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.psalm h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: normal;
}

.psalm h4 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    text-align: center;
    font-style: italic;
    font-weight: normal;
}

.psalm .subtitle {
    text-align: center;
    font-style: italic;
    opacity: 0.7;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.psalm .verse {
    margin-bottom: 1.2rem;
    padding-left: 1rem;
    line-height: 1.8;
    white-space: pre-line;
}

.psalm .verse:last-child {
    margin-bottom: 0;
}

.no-psalms {
    text-align: center;
    font-style: italic;
    opacity: 0.7;
    font-size: 1.1rem;
    margin-top: 3rem;
}

/* Buttons */
button {
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

button:hover {
    opacity: 0.9;
}

/* Settings panel */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.settings-panel.show {
    display: flex;
}

.settings-content {
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-content h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: normal;
}

.time-range {
    margin-bottom: 1.5rem;
}

.time-range label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

input[type="time"],
select {
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
}

input[type="time"] {
    font-family: monospace;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.setting-group select {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.2rem;
    }
    
    .psalm {
        padding: 1.5rem;
    }
    
    .psalm h3 {
        font-size: 1.5rem;
    }
    
    .time-inputs {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .psalm {
        padding: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 200px;
    }
}

/* Font size variations */
body.font-small {
    font-size: 0.85rem;
}

body.font-small header h1 {
    font-size: 2rem;
}

body.font-small header h2 {
    font-size: 1.2rem;
}

body.font-small .psalm h3 {
    font-size: 1.4rem;
}

body.font-small .psalm h4 {
    font-size: 1rem;
}

body.font-medium {
    font-size: 1rem;
}

body.font-large {
    font-size: 1.15rem;
}

body.font-large header h1 {
    font-size: 3rem;
}

body.font-large header h2 {
    font-size: 1.8rem;
}

body.font-large .psalm h3 {
    font-size: 2.2rem;
}

body.font-large .psalm h4 {
    font-size: 1.4rem;
}

body.font-extra-large {
    font-size: 1.3rem;
}

body.font-extra-large header h1 {
    font-size: 3.5rem;
}

body.font-extra-large header h2 {
    font-size: 2rem;
}

body.font-extra-large .psalm h3 {
    font-size: 2.5rem;
}

body.font-extra-large .psalm h4 {
    font-size: 1.6rem;
}

body.font-extra-large .psalm .verse {
    line-height: 2;
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    header {
        border-bottom: 1px solid #ccc !important;
    }
    
    .controls, .settings-panel {
        display: none !important;
    }
    
    .psalm {
        border: 1px solid #ccc !important;
        background: white !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Small caps for Lord */
.lord-smallcaps {
    font-variant: small-caps;
    font-weight: normal;
}


/* Alternating line indentation */
.line-even {
    display: inline;
    padding-left: 0;
}

.line-odd {
    display: inline;
    padding-left: 2rem;
}


/* Period navigation */
.period-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.period-navigation h2 {
    margin: 0;
    min-width: 200px;
    text-align: center;
}

.nav-arrow {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.3rem 0.6rem;
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
}

.nav-arrow:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

body.light .nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.1);
}


/* Title with settings gear */
.title-with-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.title-with-settings h1 {
    margin: 0;
}

.settings-gear {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.5rem;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 3rem;
}

.settings-gear:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg) scale(1.1);
}

body.light .settings-gear:hover {
    background-color: rgba(0, 0, 0, 0.1);
}


/* About link in settings */
.about-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid;
    border-color: inherit;
    font-size: 0.9rem;
    opacity: 0.8;
}

.about-link a {
    color: inherit;
    text-decoration: underline;
}

.about-link a:hover {
    opacity: 0.8;
}

body.dark .about-link {
    border-color: #444;
}

body.light .about-link {
    border-color: #ddd;
}


/* Auto mode controls */
.auto-mode-controls {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.auto-mode-btn {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.auto-mode-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: scale(1.05);
}

body.light .auto-mode-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}
