/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme (Default) */
    --bg-primary: #faf9f6;
    --bg-secondary: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --accent: #8b7355;
    --accent-light: #a68b6f;
    --border: #e8e6e1;
    --shadow: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e8e6e1;
    --text-secondary: #b8b5b0;
    --accent: #c9a882;
    --accent-light: #d4b896;
    --border: #3d3d3d;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
}

[data-theme="warm"] {
    --bg-primary: #fff8f0;
    --bg-secondary: #ffffff;
    --text-primary: #4a3a2a;
    --text-secondary: #6b5d4f;
    --accent: #c97d60;
    --accent-light: #d49075;
    --border: #f0e8dc;
    --shadow: rgba(201, 125, 96, 0.1);
    --shadow-hover: rgba(201, 125, 96, 0.2);
}

[data-theme="cool"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --accent: #4a90a4;
    --accent-light: #5ba3b8;
    --border: #e2e8f0;
    --shadow: rgba(74, 144, 164, 0.1);
    --shadow-hover: rgba(74, 144, 164, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-hover);
    border-color: var(--accent);
}

.btn-icon.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.icon {
    font-size: 18px;
}

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

#volumeSlider {
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Verse Section */
.verse-section {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    background-image: url('images/pray.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

/* Overlay for better text readability */
.verse-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    z-index: 0;
}

[data-theme="dark"] .verse-section::before {
    background: rgba(26, 26, 26, 0.85);
}

[data-theme="warm"] .verse-section::before {
    background: rgba(255, 248, 240, 0.85);
}

[data-theme="cool"] .verse-section::before {
    background: rgba(240, 244, 248, 0.85);
}

.verse-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.verse-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 400;
    transition: font-size 0.3s ease;
    position: relative;
    z-index: 1;
}

.verse-reference {
    font-size: 18px;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 30px;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.verse-category {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.verse-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Features Panel */
.features-panel {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px var(--shadow);
}

.feature-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--accent);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timer */
.timer-container {
    text-align: center;
}

.timer-display {
    font-size: 64px;
    font-weight: 300;
    color: var(--accent);
    margin: 30px 0;
    font-family: 'Inter', monospace;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.timer-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.timer-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.timer-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-hover);
}

/* Journal */
.journal-container textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.journal-container textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.journal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.journal-list {
    margin-top: 20px;
}

.journal-entry {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
}

.journal-entry-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.journal-entry-text {
    color: var(--text-primary);
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.journal-entry-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-edit {
    background: var(--accent);
    color: white;
}

/* Requests */
.request-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.request-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.request-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.requests-list {
    max-height: 400px;
    overflow-y: auto;
}

.request-item {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--accent);
}

.request-item.answered {
    opacity: 0.6;
    border-left-color: var(--text-secondary);
}

.request-item-content {
    flex: 1;
}

.request-item-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-answered {
    background: var(--accent);
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-style: italic;
}

/* Favorites */
.favorites-container {
    max-height: 500px;
    overflow-y: auto;
}

.favorite-item {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 8px var(--shadow-hover);
}

.favorite-item-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: 'Cormorant Garamond', serif;
}

.favorite-item-reference {
    font-size: 14px;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 10px;
}

.favorite-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.btn-icon.favorite-active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-icon.favorite-active .icon {
    filter: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: var(--text-primary);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--accent);
}

#fontSizeValue {
    color: var(--accent);
    font-weight: 500;
}

.backup-restore-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.backup-restore-buttons button {
    flex: 1;
    min-width: 150px;
}

.setting-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* Focus Mode */
body.focus-mode .header,
body.focus-mode .features-panel {
    display: none;
}

body.focus-mode .verse-section {
    padding: 100px 20px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.focus-mode .verse-text {
    font-size: 36px;
}

.focus-exit {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 4px 10px var(--shadow);
    cursor: pointer;
    display: none;
    font-size: 14px;
    z-index: 1100;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.focus-exit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--shadow-hover);
}

body.focus-mode .focus-exit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Category Section */
.category-section {
    margin-top: 40px;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
}

.category-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.category-header p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.category-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    background: var(--bg-primary);
}

.category-group-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.category-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.category-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.category-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 10px var(--shadow-hover);
}


/* Responsive */
@media (max-width: 768px) {
    .verse-text {
        font-size: 22px;
    }

    .timer-display {
        font-size: 48px;
    }

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

    .audio-controls,
    .header-actions {
        justify-content: center;
    }

    .timer-controls {
        flex-direction: column;
    }

    .timer-btn {
        width: 100%;
    }

    .request-input {
        flex-direction: column;
    }

    body.focus-mode .verse-text {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .verse-text {
        font-size: 20px;
    }

    .features-panel {
        padding: 20px;
    }

    .category-section {
        padding: 20px;
    }
}

/* All Verses Section */
.all-verses-section {
    margin-top: 40px;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
}

.verses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.verse-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.verse-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px var(--shadow-hover);
    border-color: var(--accent);
}

.verse-card-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-family: 'Cormorant Garamond', serif;
}

.verse-card-reference {
    font-size: 13px;
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
}

@media (max-width: 768px) {
    .verses-grid {
        grid-template-columns: 1fr;
    }
    
    .all-verses-section {
        padding: 20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

