/* styles.css - OS/2 Warp inspired theme for BIBle Gram version 4.15 */

/* Define OS/2 Warp color palette - Light Mode */
:root {
    --os2-purple: #663399; /* Classic OS/2 purple taskbar */
    --os2-purple-dark: #4d2673; /* Darker purple for depth */
    --os2-purple-light: #8855bb; /* Lighter purple for highlights */
    --os2-teal: #00A7A7; /* OS/2 Warp teal accent */
    --os2-teal-light: #00DCDC; /* Bright teal for highlights */
    --os2-gray: #C0C0C0; /* Classic gray background */
    --os2-dark-gray: #808080; /* Dark gray for borders */
    --os2-light-gray: #E8E8E8; /* Light gray for raised surfaces */
    --os2-white: #FFFFFF; /* White */
    --os2-black: #000000; /* Black text */
    --os2-button: #D4D0C8; /* Classic button color */
    --os2-yellow: #FFFF00; /* Yellow for highlights */

    /* Dark mode colors */
    --dark-bg: #1a1a2e;
    --dark-surface: #16213e;
    --dark-border: #0f3460;
    --dark-text: #e8e8e8;
    --dark-text-muted: #a0a0a0;
    --dark-accent: #e94560;
    --dark-highlight: #533483;
}

/* Dark Mode Styles */
body[data-theme="dark"] {
    background-color: var(--dark-bg);
    background-image: linear-gradient(135deg, var(--dark-bg) 0%, #0f0f23 100%);
    color: var(--dark-text);
}

body[data-theme="dark"] h1 {
    background: linear-gradient(180deg, #533483 0%, #3d2464 50%, #2a1845 100%);
    border-bottom-color: #2a1845;
}

body[data-theme="dark"] .stats-bar {
    background: linear-gradient(180deg, #3d2464 0%, #2a1845 100%);
    border-bottom-color: #2a1845;
}

body[data-theme="dark"] form {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.1),
                inset -2px -2px 0 rgba(0,0,0,0.5),
                2px 2px 8px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] label {
    color: var(--dark-text);
}

body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] input[type="time"],
body[data-theme="dark"] select {
    background-color: #0f0f23;
    color: var(--dark-text);
    border-color: var(--dark-border) #2a2a4a #2a2a4a var(--dark-border);
}

body[data-theme="dark"] input[type="submit"],
body[data-theme="dark"] button {
    background: linear-gradient(180deg, #4a4a6a 0%, #3a3a5a 50%, #2a2a4a 100%);
    color: var(--dark-text);
    border-color: #5a5a7a #2a2a4a #2a2a4a #5a5a7a;
}

body[data-theme="dark"] input[type="submit"]:hover,
body[data-theme="dark"] button:hover {
    background: linear-gradient(180deg, #5a5a7a 0%, #4a4a6a 50%, #3a3a5a 100%);
}

body[data-theme="dark"] .results-container {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
}

body[data-theme="dark"] table {
    background-color: #0f0f23;
    border-color: var(--dark-border);
}

body[data-theme="dark"] th {
    background: linear-gradient(180deg, #533483 0%, #3d2464 100%);
}

body[data-theme="dark"] td {
    border-color: var(--dark-border);
    color: var(--dark-text);
}

body[data-theme="dark"] tr:nth-child(even) {
    background-color: #1a1a3a;
}

body[data-theme="dark"] tr:hover {
    background-color: #2a2a5a;
    background-image: linear-gradient(90deg, transparent 0%, rgba(83,52,131,0.3) 50%, transparent 100%);
}

body[data-theme="dark"] tr.main-verse {
    background-color: #4a3a00 !important;
}

body[data-theme="dark"] .notes-panel {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
}

body[data-theme="dark"] #notesTextarea {
    background-color: #0f0f23;
    color: var(--dark-text);
    border-top-color: var(--dark-border);
}

body[data-theme="dark"] .notes-footer {
    background: linear-gradient(180deg, #2a2a4a 0%, var(--dark-surface) 100%);
    border-top-color: var(--dark-border);
}

body[data-theme="dark"] .translation-checkbox {
    background-color: rgba(255,255,255,0.1);
}

body[data-theme="dark"] .translation-checkbox:hover {
    background-color: rgba(255,255,255,0.2);
}

body[data-theme="dark"] .book-selection-grid {
    background-color: #0f0f23;
    border-color: var(--dark-border) #2a2a4a #2a2a4a var(--dark-border);
}

body[data-theme="dark"] .book-checkbox {
    background-color: rgba(255,255,255,0.1);
}

body[data-theme="dark"] .book-checkbox:hover {
    background-color: rgba(83,52,131,0.4);
}

body[data-theme="dark"] .result-count {
    background: linear-gradient(180deg, #2a5a5a 0%, #1a4a4a 100%);
}

body[data-theme="dark"] p {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

body[data-theme="dark"] .random-hint {
    color: var(--dark-text-muted);
}

body[data-theme="dark"] .modal-panel {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
}

body[data-theme="dark"] .modal-header {
    background: linear-gradient(180deg, #533483 0%, #3d2464 100%);
    border-bottom-color: #2a1845;
}

body[data-theme="dark"] .modal-content {
    color: var(--dark-text);
}

body[data-theme="dark"] .comparison-verse {
    background-color: #1a1a3a;
    border-color: var(--dark-border);
}

body[data-theme="dark"] .comparison-cell {
    background-color: #0f0f23;
    border-color: var(--dark-border);
}

body[data-theme="dark"] .comparison-translation {
    background: linear-gradient(180deg, #533483 0%, #3d2464 100%);
}

body[data-theme="dark"] .main-verse-group {
    background-color: #3a3a00 !important;
    border-color: #5a5a00 !important;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'System', 'Arial', sans-serif;
    background-color: var(--os2-teal);
    background-image:
        linear-gradient(135deg, var(--os2-teal) 0%, var(--os2-teal-light) 100%);
    color: var(--os2-black);
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 1rem;
}

/* OS/2 Warp style header/taskbar */
h1 {
    color: var(--os2-white);
    background: linear-gradient(180deg, var(--os2-purple-light) 0%, var(--os2-purple) 50%, var(--os2-purple-dark) 100%);
    font-size: 1.5rem;
    padding: 0.6rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 4px 8px rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid var(--os2-purple-dark);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-weight: bold;
    margin-bottom: 0;
}

.header-link {
    color: var(--os2-teal-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-link:hover {
    color: var(--os2-yellow);
    text-decoration: underline;
}

.header-link:visited {
    color: var(--os2-teal-light);
}

/* Stats bar */
.stats-bar {
    background: linear-gradient(180deg, var(--os2-purple) 0%, var(--os2-purple-dark) 100%);
    color: var(--os2-white);
    padding: 0.4rem;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--os2-purple-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 3.2rem;
    z-index: 999;
}

.stat-item {
    font-size: 0.9rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    cursor: help;
    padding: 0.2rem 0.5rem;
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
}

h2 {
    color: var(--os2-white);
    background: linear-gradient(180deg, var(--os2-purple-light) 0%, var(--os2-purple) 100%);
    font-size: 1.3rem;
    padding: 0.5rem;
    margin: 0;
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Form styling with OS/2 3D bevel effect */
form {
    max-width: 100%;
    margin: 0.3rem;
    background-color: var(--os2-gray);
    padding: 0.8rem;
    border-radius: 0;
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.7),
        inset -2px -2px 0 rgba(0,0,0,0.5),
        2px 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--os2-dark-gray);
    flex-grow: 0;
}

label {
    color: var(--os2-black);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    display: block;
    font-weight: bold;
}

/* Form line layout (3 lines on desktop) */
.form-line {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-line > label:first-child {
    min-width: 100px;
    margin: 0;
}

.query-fields {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.field-inline label {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
}

.field-inline input,
.field-inline select {
    margin: 0;
    width: auto;
}

.field-inline input[type="number"] {
    width: 60px;
}

.field-inline select {
    min-width: 120px;
}

.radio-inline,
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 0.6rem;
    margin-bottom: 0;
    font-weight: normal;
    font-size: 0.9rem;
    gap: 0.2rem;
}

.radio-inline input[type="radio"],
.checkbox-inline input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.2rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    max-width: 100%;
}

.translation-checkbox {
    white-space: nowrap;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
    transition: background-color 0.2s;
}

.translation-checkbox:hover {
    background-color: rgba(255,255,255,0.6);
}

.translation-abbrev {
    font-weight: bold;
    user-select: none;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.4rem;
    margin-bottom: 0.4rem;
    border: 2px solid;
    border-color: var(--os2-dark-gray) var(--os2-light-gray) var(--os2-light-gray) var(--os2-dark-gray);
    background-color: var(--os2-white);
    color: var(--os2-black);
    font-size: 1rem;
    touch-action: manipulation;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.2);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: 2px dotted var(--os2-black);
    outline-offset: 2px;
}

input[type="radio"],
input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 1.8rem;
    height: 1.8rem;
    accent-color: var(--os2-purple);
}

input[type="radio"] + label,
input[type="checkbox"] + label {
    display: inline-flex;
    align-items: center;
    color: var(--os2-black);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    touch-action: manipulation;
}

/* OS/2 style buttons */
input[type="submit"],
button {
    background: linear-gradient(180deg, var(--os2-light-gray) 0%, var(--os2-button) 50%, var(--os2-dark-gray) 100%);
    color: var(--os2-black);
    padding: 0.6rem;
    border: 2px solid;
    border-color: var(--os2-white) var(--os2-dark-gray) var(--os2-dark-gray) var(--os2-white);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    transition: all 0.1s ease;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.8),
        inset -1px -1px 0 rgba(0,0,0,0.4),
        2px 2px 4px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
}

input[type="submit"]:hover,
button:hover {
    background: linear-gradient(180deg, var(--os2-white) 0%, var(--os2-light-gray) 50%, var(--os2-button) 100%);
}

input[type="submit"]:active,
button:active {
    border-color: var(--os2-dark-gray) var(--os2-white) var(--os2-white) var(--os2-dark-gray);
    box-shadow:
        inset -1px -1px 0 rgba(255,255,255,0.8),
        inset 1px 1px 2px rgba(0,0,0,0.4);
    transform: translate(1px, 1px);
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.button-group button {
    width: auto;
    flex: 1;
    padding: 0.8rem;
    font-size: 1.2rem;
}

/* Results table with OS/2 styling */
.results-container {
    margin: 0.3rem;
    background-color: var(--os2-gray);
    border: 2px solid var(--os2-dark-gray);
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.7),
        inset -2px -2px 0 rgba(0,0,0,0.5),
        2px 2px 8px rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-controls {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.filter-controls label {
    font-size: 1rem;
    margin: 0;
}

.filter-controls input[type="text"] {
    width: 200px;
    margin: 0;
    padding: 0.3rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--os2-white);
    border: 2px solid var(--os2-dark-gray);
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.1);
}

th, td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--os2-dark-gray);
    text-align: left;
    font-size: 0.95rem;
}

th {
    background: linear-gradient(180deg, var(--os2-purple-light) 0%, var(--os2-purple) 100%);
    color: var(--os2-white);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

tr:nth-child(even) {
    background-color: var(--os2-light-gray);
}

tr:hover {
    background-color: var(--os2-teal-light);
    background-image: linear-gradient(90deg, transparent 0%, rgba(0,220,220,0.3) 50%, transparent 100%);
}

/* No results message */
p {
    margin: 0.3rem;
    font-size: 1rem;
    color: var(--os2-black);
    text-align: center;
    padding: 0.5rem;
    background-color: var(--os2-gray);
    border: 2px solid var(--os2-dark-gray);
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.7),
                inset -2px -2px 0 rgba(0,0,0,0.5);
}

/* Field groups */
.field-group {
    background-color: rgba(255,255,255,0.5);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--os2-dark-gray);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.7),
                inset -1px -1px 0 rgba(0,0,0,0.3);
}

/* Responsive design */
@media (min-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    form {
        max-width: 60%;
        margin: 0.3rem auto;
    }

    .results-container {
        max-width: 98%;
        margin: 0.3rem auto;
    }

    th, td {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    h1 {
        font-size: 2rem;
    }

    form {
        max-width: 50%;
    }

    .results-container {
        max-width: 98%;
    }
}

/* Phone-specific adjustments */
@media (max-width: 480px) {
    body {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.2rem;
        padding: 0.5rem;
    }

    .stats-bar {
        gap: 0.5rem;
        padding: 0.3rem;
        top: 2.5rem;
    }

    .stat-item {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }

    form {
        margin: 0.5rem;
        padding: 1rem;
    }

    /* Revert to vertical layout on mobile */
    .form-line {
        flex-direction: column;
        align-items: stretch;
    }

    .form-line > label:first-child {
        min-width: auto;
        margin-bottom: 0.3rem;
    }

    .query-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .field-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .field-inline label {
        margin-bottom: 0.2rem;
    }

    .field-inline input,
    .field-inline select {
        width: 100% !important;
    }

    .checkbox-group {
        flex-wrap: wrap;
    }

    .radio-inline,
    .checkbox-inline {
        margin-bottom: 0.5rem;
    }

    .translation-checkbox {
        flex: 0 0 auto;
    }

    input[type="text"],
    input[type="number"],
    select {
        font-size: 1rem;
        padding: 0.6rem;
        width: 100%;
    }

    input[type="radio"],
    input[type="checkbox"] {
        width: 1.4rem;
        height: 1.4rem;
    }

    input[type="submit"],
    button {
        padding: 0.9rem;
        font-size: 1.2rem;
    }

    .results-container {
        margin: 0.5rem;
        padding: 0.5rem;
    }

    table {
        font-size: 0.95rem;
        display: block;
        overflow-x: auto;
    }

    th, td {
        padding: 0.6rem;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-controls input[type="text"] {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }
}

/* Hide verse/keyword fields toggle animation */
#verse_fields, #keyword_fields {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

#verse_fields[style*="display: none"],
#keyword_fields[style*="display: none"] {
    opacity: 0;
    max-height: 0;
}

#verse_fields[style*="display: block"],
#keyword_fields[style*="display: block"] {
    opacity: 1;
    max-height: 1000px;
}

/* Result count badge */
.result-count {
    background: linear-gradient(180deg, var(--os2-teal-light) 0%, var(--os2-teal) 100%);
    color: var(--os2-black);
    padding: 0.5rem 1rem;
    border: 2px solid;
    border-color: var(--os2-white) var(--os2-dark-gray) var(--os2-dark-gray) var(--os2-white);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.5);
    font-weight: bold;
    border-radius: 4px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Notes Panel (Desktop Only) */
.notes-panel {
    display: none; /* Hidden by default, shown on desktop */
    position: fixed;
    right: 1rem;
    top: 6rem;
    width: 300px;
    background-color: var(--os2-gray);
    border: 2px solid var(--os2-dark-gray);
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.7),
        inset -2px -2px 0 rgba(0,0,0,0.5),
        4px 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 998;
}

.notes-header {
    background: linear-gradient(180deg, var(--os2-purple-light) 0%, var(--os2-purple) 100%);
    color: var(--os2-white);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--os2-purple-dark);
    cursor: grab;
    user-select: none;
}

.notes-header:active {
    cursor: grabbing;
}

.drag-icon {
    font-size: 1.2rem;
    margin-right: 0.3rem;
    opacity: 0.7;
    letter-spacing: -2px;
}

.notes-header h3 {
    margin: 0;
    font-size: 1rem;
    background: none;
    box-shadow: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    padding: 0;
    flex: 1;
}

.notes-buttons {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.notes-download-btn,
.notes-save-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.85rem !important;
    width: auto !important;
    margin: 0;
}

.notes-save-btn {
    background: linear-gradient(180deg, #90EE90 0%, #50C850 50%, #308030 100%) !important;
}

.notes-save-btn:hover {
    background: linear-gradient(180deg, #B0FFB0 0%, #70E870 50%, #50A050 100%) !important;
}

#notesTextarea {
    width: 100%;
    height: 400px;
    padding: 0.5rem;
    border: none;
    border-top: 2px solid var(--os2-dark-gray);
    background-color: var(--os2-white);
    color: var(--os2-black);
    font-family: 'System', 'Arial', monospace;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 200px;
    max-height: 600px;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.2);
}

#notesTextarea:focus {
    outline: 2px dotted var(--os2-purple);
    outline-offset: -2px;
}

.notes-footer {
    padding: 0.4rem;
    background: linear-gradient(180deg, var(--os2-button) 0%, var(--os2-gray) 100%);
    border-top: 2px solid var(--os2-dark-gray);
    text-align: center;
}

.notes-link {
    color: var(--os2-purple);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: color 0.2s ease;
}

.notes-link:hover {
    color: var(--os2-teal);
    text-decoration: underline;
}

.notes-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--os2-dark-gray) 50%);
    border-top: 2px solid var(--os2-white);
    border-left: 2px solid var(--os2-white);
}

.notes-resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, var(--os2-purple) 50%);
}

/* Show notes panel on desktop */
@media (min-width: 1024px) {
    .notes-panel {
        display: block;
    }

    .results-container {
        margin-right: 320px; /* Make room for notes panel */
    }
}

/* Adjust for very large screens */
@media (min-width: 1400px) {
    .notes-panel {
        width: 350px;
    }

    .results-container {
        margin-right: 370px;
    }
}

/* Random Verse Feature Styles */
.random-fields-container {
    flex-direction: column;
    gap: 0.5rem;
}

.random-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.book-select-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.9rem !important;
    width: auto !important;
    min-width: 50px;
}

.book-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.3rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: var(--os2-white);
    border: 2px solid;
    border-color: var(--os2-dark-gray) var(--os2-light-gray) var(--os2-light-gray) var(--os2-dark-gray);
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.2);
}

.book-checkbox {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.3rem;
    background-color: rgba(255,255,255,0.5);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.book-checkbox:hover {
    background-color: rgba(0, 167, 167, 0.3);
}

.book-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.book-abbrev {
    font-weight: normal;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Color coding for OT/NT */
.ot-book {
    border-left: 3px solid var(--os2-purple);
}

.nt-book {
    border-left: 3px solid var(--os2-teal);
}

.random-hint {
    font-size: 0.85rem;
    color: var(--os2-dark-gray);
    margin: 0.3rem 0 0 0;
    padding: 0.3rem;
    font-style: italic;
    background: none;
    border: none;
    box-shadow: none;
    text-align: left;
}

/* Main verse highlight in random results */
tr.main-verse {
    background-color: var(--os2-yellow) !important;
    font-weight: bold;
}

tr.main-verse:hover {
    background-color: #FFFF88 !important;
}

/* Mobile adjustments for random verse */
@media (max-width: 480px) {
    .book-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        max-height: 150px;
    }

    .book-checkbox {
        font-size: 0.8rem;
        padding: 0.15rem 0.2rem;
    }

    .random-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .random-controls .field-inline {
        flex-direction: row;
        justify-content: space-between;
    }

    .book-select-btn {
        flex: 1;
    }
}

/* ========== HEADER CONTROLS ========== */
h1 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-title {
    flex: 1;
    text-align: center;
}

.header-controls {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.header-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--os2-white);
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
}

.header-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

@media (max-width: 480px) {
    h1 {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-controls {
        width: 100%;
        justify-content: center;
    }

    .header-btn {
        padding: 0.4rem 0.6rem;
        font-size: 1.1rem;
    }
}

/* ========== COMPARISON VIEW ========== */
.comparison-container {
    max-width: 100%;
}

.comparison-verse {
    background-color: var(--os2-white);
    border: 2px solid var(--os2-dark-gray);
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
}

.verse-reference-header {
    background: linear-gradient(180deg, var(--os2-purple-light) 0%, var(--os2-purple) 100%);
    color: var(--os2-white);
    padding: 0.5rem 1rem;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.comparison-grid {
    display: grid;
    gap: 0;
}

.comparison-cell {
    border-right: 1px solid var(--os2-dark-gray);
    border-bottom: 1px solid var(--os2-dark-gray);
}

.comparison-cell:last-child {
    border-right: none;
}

.comparison-translation {
    background: linear-gradient(180deg, var(--os2-teal-light) 0%, var(--os2-teal) 100%);
    color: var(--os2-black);
    padding: 0.3rem 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    border-bottom: 1px solid var(--os2-dark-gray);
}

.comparison-text {
    padding: 0.8rem;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 80px;
}

.main-verse-group {
    background-color: var(--os2-yellow) !important;
    border-color: #cc9900 !important;
}

.main-verse-group .verse-reference-header {
    background: linear-gradient(180deg, #ffcc00 0%, #cc9900 100%);
    color: var(--os2-black);
    text-shadow: none;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr !important;
    }

    .comparison-cell {
        border-right: none;
    }
}

/* ========== MODAL PANELS ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1100;
}

.modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background-color: var(--os2-gray);
    border: 2px solid var(--os2-dark-gray);
    border-radius: 4px;
    box-shadow: 4px 4px 20px rgba(0,0,0,0.5);
    z-index: 1200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(180deg, var(--os2-purple-light) 0%, var(--os2-purple) 100%);
    color: var(--os2-white);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--os2-purple-dark);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    background: none;
    box-shadow: none;
    padding: 0;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--os2-white);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    width: auto !important;
}

.modal-close:hover {
    background: rgba(255,255,255,0.4);
}

.modal-content {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* ========== READING PLANS STYLES ========== */
.plan-selector {
    margin-bottom: 1rem;
}

.plan-selector select {
    width: 100%;
}

.plan-info {
    margin-bottom: 1rem;
}

.plan-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--os2-purple);
}

.plan-progress {
    margin-top: 0.8rem;
}

.progress-bar {
    background-color: var(--os2-light-gray);
    border: 2px solid var(--os2-dark-gray);
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.progress-fill {
    background: linear-gradient(180deg, var(--os2-teal-light) 0%, var(--os2-teal) 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 0.9rem;
    color: var(--os2-dark-gray);
}

.today-reading {
    background-color: var(--os2-white);
    border: 2px solid var(--os2-dark-gray);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.today-reading h4 {
    margin: 0 0 0.5rem 0;
    color: var(--os2-purple);
}

#todayPassages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.reading-link {
    display: inline-block;
    background: linear-gradient(180deg, var(--os2-light-gray) 0%, var(--os2-button) 100%);
    color: var(--os2-black);
    padding: 0.4rem 0.8rem;
    border: 2px solid;
    border-color: var(--os2-white) var(--os2-dark-gray) var(--os2-dark-gray) var(--os2-white);
    text-decoration: none;
    font-weight: bold;
    border-radius: 2px;
}

.reading-link:hover {
    background: linear-gradient(180deg, var(--os2-white) 0%, var(--os2-light-gray) 100%);
}

.reading-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reading-nav button {
    flex: 1;
    min-width: 100px;
}

#markCompleteBtn.completed {
    background: linear-gradient(180deg, #90EE90 0%, #50C850 50%, #308030 100%) !important;
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
}

.plan-actions button {
    flex: 1;
}

/* ========== NOTIFICATION STYLES ========== */
.notification-settings {
    margin: 1rem 0;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.setting-row label {
    min-width: 150px;
    margin: 0;
}

.setting-row input,
.setting-row select {
    flex: 1;
    margin: 0;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.notification-actions button {
    flex: 1;
    min-width: 120px;
}

#enableNotifBtn {
    background: linear-gradient(180deg, #90EE90 0%, #50C850 50%, #308030 100%) !important;
}

#disableNotifBtn {
    background: linear-gradient(180deg, #FF9090 0%, #C85050 50%, #803030 100%) !important;
}

.notification-error {
    background-color: #ffcccc;
    border: 2px solid #cc0000;
    color: #800000;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.notification-note {
    font-size: 0.85rem;
    color: var(--os2-dark-gray);
    font-style: italic;
    margin: 0;
    padding: 0.5rem;
    background: none;
    border: none;
    box-shadow: none;
    text-align: left;
}

@media (max-width: 480px) {
    .setting-row {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-row label {
        min-width: auto;
        margin-bottom: 0.3rem;
    }

    .notification-actions {
        flex-direction: column;
    }

    .notification-actions button {
        width: 100%;
    }
}

/* ========== DARK MODE BUTTON INDICATOR ========== */
body[data-theme="dark"] .header-btn {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

body[data-theme="dark"] .header-btn:hover {
    background: rgba(255,255,255,0.2);
}

body[data-theme="dark"] .plan-info h4,
body[data-theme="dark"] .today-reading h4 {
    color: var(--os2-teal-light);
}

body[data-theme="dark"] .today-reading {
    background-color: #0f0f23;
    border-color: var(--dark-border);
}

body[data-theme="dark"] .reading-link {
    background: linear-gradient(180deg, #4a4a6a 0%, #3a3a5a 100%);
    color: var(--dark-text);
    border-color: #5a5a7a #2a2a4a #2a2a4a #5a5a7a;
}

body[data-theme="dark"] .reading-link:hover {
    background: linear-gradient(180deg, #5a5a7a 0%, #4a4a6a 100%);
}

body[data-theme="dark"] .progress-bar {
    background-color: #2a2a4a;
    border-color: var(--dark-border);
}

body[data-theme="dark"] #progressText {
    color: var(--dark-text-muted);
}

body[data-theme="dark"] .notification-note {
    color: var(--dark-text-muted);
}

body[data-theme="dark"] .notification-error {
    background-color: #3a1a1a;
    border-color: #802020;
    color: #ff8080;
}
