/* ========================================
   OFFLINE DASHBOARD STYLES
   ======================================== */

:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-gold: #fbbf24;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --card-bg: white;
    --text-primary: #0f172a;
    --text-secondary: #475569;
}

[data-theme="light"] body {
    background: #f8fafc;
}

[data-theme="light"] .card {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .section-title {
    color: #0f172a;
}

/* LIGHT MODE FIXES */
[data-theme="light"] .btn-back-home {
    background: #0f172a;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .tool-card {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

[data-theme="light"] .tool-card:hover {
    background: rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

[data-theme="light"] .btn-add,
[data-theme="light"] .icon-btn-bible {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

[data-theme="light"] .btn-add:hover,
[data-theme="light"] .icon-btn-bible:hover {
    background: #cbd5e1;
}

[data-theme="light"] button[onclick="copyVerse()"],
[data-theme="light"] button[onclick="loadDailyVerse(true)"] {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .prayer-item {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #1e293b;
}

[data-theme="light"] .prayer-filter {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

[data-theme="light"] .prayer-filter.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

[data-theme="light"] #offline-dashboard p,
[data-theme="light"] .prayer-list div {
    color: #334155;
}

[data-theme="light"] .tool-card span {
    color: #1e293b;
    font-weight: 600;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
}

/* HEADER */
header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, white, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.offline-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.offline-status-dot {
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* MAIN CONTAINER */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: white;
}

/* DASHBOARD GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    font-size: 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--accent-primary);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

/* DAILY VERSE */
#verse-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
}

#verse-ref {
    text-align: right;
    font-weight: 700;
    color: var(--accent-secondary);
}

/* PRAYER WIDGET */
.prayer-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.prayer-list::-webkit-scrollbar {
    width: 6px;
}

.prayer-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.prayer-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.prayer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prayer-item input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

.prayer-item.completed span {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    color: white;
    font-family: inherit;
}

button.btn-add {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

/* TOOLS GRID */
.tools-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.tool-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.btn-back-home {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    color: var(--bg-dark);
    padding: 1rem 2rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bible Paper Style for Results */
.bible-paper {
    background: #fffcf5 !important;
    color: #1e293b !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 2rem;
}

.icon-btn-bible {
    background: rgba(180, 83, 9, 0.1);
    color: #b45309;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-bible:hover {
    background: rgba(180, 83, 9, 0.2);
    transform: scale(1.1);
}

.icon-btn-bible.delete {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.icon-btn-bible.delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* BIBLE VIEW (Offline) */
.bible-view {
    display: none;
}

.bible-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.prayer-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.prayer-filter.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

#mode-reference,
.search-panel {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 1rem !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        height: 60px !important;
    }

    .brand h1 { font-size: 1.1rem !important; }
    .brand i { font-size: 1.2rem !important; }

    header > div:last-child { gap: 0.5rem !important; }

    .offline-badge {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.65rem !important;
    }

    main { padding: 1rem !important; }

    .section-title {
        font-size: 1.5rem !important;
        text-align: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* 🆕 UTILITY CLASSES FROM INLINE STYLES */
.prayer-count-badge {
    font-size: 0.8rem;
    background: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.prayer-filters-container {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.prayer-filters-container::-webkit-scrollbar {
    display: none;
}

.prayer-search-input {
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.prayer-list-box {
    max-height: 180px;
}

.ml-auto-flex {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-group-mb {
    margin-bottom: 1rem;
}

.btn-save-full {
    width: 100%;
    padding: 0.5rem;
}

.btn-add-full {
    width: 100%;
    padding: 0.5rem;
    margin-top: 1rem;
}

/* 🆕 VERSE CARD & HEADER CLASSES */
.flex-gap-1 {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-theme-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.verse-card-custom {
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    min-height: 320px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.verse-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.verse-card-header {
    margin-bottom: 0.5rem;
}

.verse-icon {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-gold);
}

.verse-sync-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.verse-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 0.5rem;
}

.verse-main-text {
    font-size: 1.4rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-style: italic;
    font-family: 'Merriweather', 'Georgia', serif;
    color: var(--text-primary);
    text-align: center;
}

.verse-reference {
    text-align: right;
    font-weight: 800;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.verse-actions {
    margin-top: auto;
    display: flex;
    gap: 0.8rem;
}

.verse-action-btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    height: 42px;
}

.verse-action-btn-primary {
    flex: 1;
    font-size: 0.85rem;
    background: var(--accent-primary);
    border: none;
    height: 42px;
}

.card-cta-compact {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.text-desc-sm {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.btn-cta-secondary {
    width: 100%;
    background: var(--accent-secondary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-cta-success {
    width: 100%;
    margin-top: 0.5rem;
    background: var(--success) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-group-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-dark-card {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    padding: 10px;
}

.textarea-dark-card {
    width: 100%;
    min-height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.w-100 {
    width: 100% !important;
}

/* 🆕 BIBLE SECTION CLASSES */
.bible-search-card {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.bible-results-area {
    margin-top: 2rem;
    display: none;
}

.btn-bible-primary {
    width: 100%;
    border: none !important;
    background: #b45309 !important;
    color: white !important;
}

.btn-bible-secondary {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: transparent !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-control-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.gap-sm { gap: 0.5rem; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }

/* 🆕 EDITOR & FOOTER CLASSES */
.editor-area {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-title {
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    width: 100%;
}

.editor-content {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.editor-status {
    color: var(--text-secondary);
    align-self: center;
    margin-right: auto;
    font-size: 0.9rem;
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.offline-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
}

.footer-version {
    margin-bottom: 0.5rem;
}

/* 🆕 SEARCH & NOTES CLASSES */
.btn-back-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-row-card {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group-flex {
    flex: 1;
    min-width: 200px;
}

.form-group-fixed-sm {
    width: 100px;
}

.form-label-dark {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.select-dark-card {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn-search-action {
    height: fit-content;
    margin-bottom: 2px;
}

.btn-search-clear {
    height: fit-content;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.notes-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: 70vh;
}

.notes-sidebar {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.notes-list-box {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .notes-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .form-group-fixed-sm {
        width: 100%;
    }
}




