:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    /* Improved contrast from #6b7280 */
    --text-placeholder: #6b7280;
    /* Separate placeholder color */
    --bg-body: #ffffff;
    --bg-input: #f3f4f6;
    --border-color: #e5e7eb;
    --font-family: 'Inter', sans-serif;
    /* Accessibility */
    --focus-ring: rgba(59, 130, 246, 0.5);
    --focus-ring-offset: 2px;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Reduced gap slightly as sections now have padding */
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 10px;
}

.main-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.main-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --- GROUP CONTAINERS (Settings, Quick Play, Bible) --- */
.group-container {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    /* Visual depth for hierarchy */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Header for groups (Settings, Bible, etc) */
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Make header clickable only if it's collapsible */
.group-container.collapsible .group-header {
    cursor: pointer;
    margin-bottom: 0;
    /* Remove margin when collapsed, added back via padding in content */
    user-select: none;
    /* Accessibility: make focusable via keyboard */
    border-radius: 8px;
    padding: 8px;
    margin: -8px;
}

/* Focus state for collapsible headers */
.group-container.collapsible .group-header:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: var(--focus-ring-offset);
}

.group-header h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.chevron-icon {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

/* Content Area inside Groups */
.group-content {
    transition: all 0.3s ease-in-out;
    opacity: 1;
    max-height: 1000px;
    /* Arbitrary large height for animation */
    overflow: hidden;
}

/* If collapsible header has margin when open */
.group-container.collapsible .group-content {
    margin-top: 15px;
}

/* Collapsed State */
.group-container.collapsed .group-content {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
}

.group-container.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

/* --- FORM ELEMENTS --- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group.full-width {
    grid-column: span 2;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group label span {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.form-select,
.form-input {
    padding: 12px 16px;
    /* Changed to white to contrast with the gray group container */
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-primary);
    width: 100%;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-input {
    background-image: none;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Controls Area */
.controls-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.control-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn {
    background: var(--bg-input);
    border: none;
    border-radius: 8px;
    /* Improved touch target: minimum 44x44px */
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

/* Focus state for icon buttons */
.icon-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: var(--focus-ring-offset);
}

/* Quick Play & Bible specific styling inheriting form group-container */
.quick-group {
    margin-bottom: 20px;
}

.quick-group:last-child {
    margin-bottom: 0;
}

.quick-group h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.quick-btn span {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.quick-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Focus state for quick buttons */
.quick-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: var(--focus-ring-offset);
}

.quick-btn.playing {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-btn.playing span {
    color: white;
}

/* Disabled state for quick buttons (while audio is playing) */
.quick-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quick-btn:disabled:hover {
    border-color: var(--border-color);
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Bible Controls */
.bible-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bible-select-group {
    display: flex;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.bible-select-group .form-select {
    min-width: 100px;
}

.verse-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.verse-range span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.verse-range .form-select {
    width: 85px;
    /* Increased from 75px to fit text */
    min-width: 70px;
    padding-left: 10px;
    padding-right: 32px;
}

.bible-preview {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 60px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.bible-preview.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Focus state for action buttons */
.action-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: var(--focus-ring-offset);
}

.action-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.action-btn span {
    font-size: 1.2rem;
}

/* Secondary action button variant */
.action-btn.secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: var(--primary-color);
}

/* Bible action buttons container */
.bible-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Action Buttons Main */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#audio-visualizer {
    width: 100%;
    height: 16px;
    background: linear-gradient(90deg, #e5e7eb, #f3f4f6);
    border-radius: 8px;
    margin-top: 8px;
    transition: background 0.3s ease;
}

/* Enhanced visualizer during recording */
.recording~#audio-visualizer,
.btn-wrapper:has(.recording) #audio-visualizer {
    background: linear-gradient(90deg, #fecaca, #fee2e2);
}

.circle-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.circle-btn span {
    font-size: 32px;
}

.circle-btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.circle-btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.circle-btn.primary.recording {
    background-color: var(--danger-color);
    animation: pulse 2s infinite, glow 2s infinite;
}

.circle-btn.primary.recording:hover {
    background-color: var(--danger-hover);
}

/* Focus state for circle buttons */
.circle-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.circle-btn.secondary {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.circle-btn.secondary:hover:not(:disabled) {
    background-color: #e5e7eb;
    transform: translateY(-2px);
}

.circle-btn:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.btn-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Transcript Grid */
.transcript-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.text-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.text-panel h3 {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.text-content {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 20px;
    height: 300px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    text-align: left;
}

.text-content.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Muted TTS Button */
.icon-btn.muted {
    background: var(--danger-color);
    color: white;
}

.icon-btn.muted:hover {
    background: var(--danger-hover);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 10px;
}

.status-bar.hidden {
    display: none;
}

.status-bar.error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.status-bar.success {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

/* Translation Pending Indicator */
.translation-pending {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #eff6ff;
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin: 8px 0;
}

.translation-pending.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .input-group.full-width {
        grid-column: span 1;
    }

    .transcript-grid {
        grid-template-columns: 1fr;
    }

    /* Improved Bible controls for mobile */
    .bible-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .bible-select-group {
        flex-direction: column;
        gap: 8px;
    }

    .bible-select-group .form-select {
        width: 100%;
        min-width: unset;
    }

    .verse-range {
        justify-content: center;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================== */
/* ENHANCED UI/UX ADDITIONS   */
/* ========================== */

/* Glow animation for recording state */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.6);
    }
}

/* Empty State Styles */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state .empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state .empty-subtitle {
    font-size: 0.9rem;
    color: var(--text-placeholder);
    font-style: normal;
}

/* Keyboard Shortcut Hints */
kbd {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: var(--font-family);
    margin-left: 6px;
    color: var(--text-secondary);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #059669;
}

.toast.error {
    background: #dc2626;
}

/* Bible Verse Highlight (in translation output) */
.bible-verse-highlight {
    background-color: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.bible-verse-highlight:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background-color: #e0f2fe;
}

.bible-verse-highlight .verse-ref {
    font-weight: 600;
    color: #0369a1;
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.bible-verse-highlight .verse-text {
    color: #0c4a6e;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Processing Indicator */
.processing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin: 4px 0;
}

.processing-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: processing-pulse 1.4s infinite ease-in-out;
}

.processing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.processing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes processing-pulse {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Timestamp for transcript segments */
.segment-timestamp {
    font-size: 0.75rem;
    color: var(--text-placeholder);
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

/* Transcript segment styling */
.transcript-segment {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.transcript-segment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 500;
}

.skip-link:focus {
    top: 16px;
}

/* ========================== */
/* DARK MODE SUPPORT          */
/* ========================== */

/* System preference: dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #60a5fa;
        --primary-hover: #3b82f6;
        --danger-color: #f87171;
        --danger-hover: #ef4444;
        --text-primary: #f3f4f6;
        --text-secondary: #d1d5db;
        --text-placeholder: #9ca3af;
        --bg-body: #111827;
        --bg-input: #1f2937;
        --border-color: #374151;
        --focus-ring: rgba(96, 165, 250, 0.5);
    }

    :root:not([data-theme="light"]) body {
        color-scheme: dark;
    }

    :root:not([data-theme="light"]) .form-select,
    :root:not([data-theme="light"]) .form-input {
        background-color: #374151;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    }

    :root:not([data-theme="light"]) .form-input {
        background-image: none;
    }

    :root:not([data-theme="light"]) .quick-btn {
        background: #374151;
        border-color: #4b5563;
    }

    :root:not([data-theme="light"]) .bible-preview {
        background: #374151;
    }

    :root:not([data-theme="light"]) .status-bar {
        background: #422006;
        border-color: #854d0e;
        color: #fef3c7;
    }

    :root:not([data-theme="light"]) .status-bar.error {
        background: #450a0a;
        border-color: #7f1d1d;
        color: #fecaca;
    }

    :root:not([data-theme="light"]) .status-bar.success {
        background: #052e16;
        border-color: #166534;
        color: #bbf7d0;
    }

    :root:not([data-theme="light"]) .bible-verse-highlight {
        background-color: #1e3a5f;
        border-left-color: #38bdf8;
    }

    :root:not([data-theme="light"]) .bible-verse-highlight:hover {
        background-color: #1e3a8a;
    }

    :root:not([data-theme="light"]) .bible-verse-highlight .verse-ref {
        color: #7dd3fc;
    }

    :root:not([data-theme="light"]) .bible-verse-highlight .verse-text {
        color: #bae6fd;
    }

    :root:not([data-theme="light"]) .processing-indicator {
        background: #1e3a5f;
    }

    :root:not([data-theme="light"]) kbd {
        background: #374151;
        border-color: #4b5563;
    }

    :root:not([data-theme="light"]) .circle-btn:disabled {
        background-color: #374151;
        color: #6b7280;
    }

    :root:not([data-theme="light"]) .action-btn:disabled {
        background: #374151;
        color: #6b7280;
    }

    :root:not([data-theme="light"]) .transcript-segment {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
}

/* Manual dark theme override */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --danger-color: #f87171;
    --danger-hover: #ef4444;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-placeholder: #9ca3af;
    --bg-body: #111827;
    --bg-input: #1f2937;
    --border-color: #374151;
    --focus-ring: rgba(96, 165, 250, 0.5);
}

[data-theme="dark"] body {
    color-scheme: dark;
}

[data-theme="dark"] .form-select,
[data-theme="dark"] .form-input {
    background-color: #374151;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

[data-theme="dark"] .form-input {
    background-image: none;
}

[data-theme="dark"] .quick-btn {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .bible-preview {
    background: #374151;
}

[data-theme="dark"] .status-bar {
    background: #422006;
    border-color: #854d0e;
    color: #fef3c7;
}

[data-theme="dark"] .status-bar.error {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fecaca;
}

[data-theme="dark"] .status-bar.success {
    background: #052e16;
    border-color: #166534;
    color: #bbf7d0;
}

[data-theme="dark"] .bible-verse-highlight {
    background-color: #1e3a5f;
    border-left-color: #38bdf8;
}

[data-theme="dark"] .bible-verse-highlight:hover {
    background-color: #1e3a8a;
}

[data-theme="dark"] .bible-verse-highlight .verse-ref {
    color: #7dd3fc;
}

[data-theme="dark"] .bible-verse-highlight .verse-text {
    color: #bae6fd;
}

[data-theme="dark"] .processing-indicator {
    background: #1e3a5f;
}

[data-theme="dark"] kbd {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .circle-btn:disabled {
    background-color: #374151;
    color: #6b7280;
}

[data-theme="dark"] .action-btn:disabled {
    background: #374151;
    color: #6b7280;
}

[data-theme="dark"] .transcript-segment {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ========================== */
/* SMOOTH SCROLL              */
/* ========================== */

html {
    scroll-behavior: smooth;
}

/* For transcript areas, add smooth scrolling */
.text-content {
    scroll-behavior: smooth;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    html,
    .text-content {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================== */
/* PLAYLIST STYLES            */
/* ========================== */

.playlist-container {
    margin-top: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
}

.playlist-header h5 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.playlist-header h5 span {
    font-size: 1.1rem;
}

.playlist-actions {
    display: flex;
    gap: 4px;
}

.icon-btn.small {
    min-width: 32px;
    min-height: 32px;
    padding: 6px;
}

.icon-btn.small span {
    font-size: 1.1rem;
}

.playlist-items {
    max-height: 200px;
    overflow-y: auto;
}

.playlist-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

.playlist-empty-state span {
    font-size: 2rem;
    color: #d1d5db;
    margin-bottom: 8px;
}

.playlist-empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background: #f9fafb;
}

.playlist-item.playing {
    background: #eff6ff;
    border-left: 3px solid var(--primary-color);
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-ref {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.playlist-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.playlist-item-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.playlist-item-btn:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

.playlist-item-btn.play:hover {
    background: var(--primary-color);
    color: white;
}

.playlist-item-btn.remove:hover {
    background: var(--danger-color);
    color: white;
}

.playlist-item-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playlist-item-btn:disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}

.playlist-item-btn span {
    font-size: 1.1rem;
}

/* Mobile adjustments for playlist */
@media (max-width: 640px) {
    .playlist-item {
        padding: 8px 10px;
    }

    .playlist-item-preview {
        display: none;
    }
}

/* Range Slider Styles */
.form-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Range value display */
.range-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

/* Silero settings group with inline layout */
.silero-settings {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
}

.silero-settings label {
    flex-shrink: 0;
    min-width: fit-content;
}

.silero-settings .form-range {
    flex: 1;
}

/* Hint icon tooltip */
.hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: help;
    border-radius: 50%;
    margin-left: 4px;
    transition: color 0.2s;
}

.hint-icon:hover {
    color: var(--primary-color);
}

/* ================================ */
/* INSTANT CSS TOOLTIPS             */
/* ================================ */

.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    padding: 10px 14px;
    background: #1f2937;
    color: white;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 8px;
    white-space: pre-line;
    min-width: 200px;
    max-width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* Instant appear */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    pointer-events: none;
}

/* Arrow */
.has-tooltip::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 100%;
    margin-top: 2px;
    border: 6px solid transparent;
    border-bottom-color: #1f2937;
    z-index: 1001;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s;
    pointer-events: none;
}

.has-tooltip:hover::after,
.has-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ensure tooltip doesn't overflow on mobile */
@media (max-width: 640px) {
    .has-tooltip::after {
        left: -10px;
        min-width: 180px;
        max-width: 220px;
        font-size: 0.75rem;
    }

    .has-tooltip::before {
        left: 15px;
    }
}