/* Bible Devotion - Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FAF5EB;
}

::-webkit-scrollbar-thumb {
    background: #C9A961;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D4A853;
}

/* Selection color */
::selection {
    background: rgba(201, 169, 97, 0.3);
    color: #2C2420;
}

/* Focus styles - accessibility */
*:focus-visible {
    outline: 2px solid #C9A961;
    outline-offset: 2px;
}

/* Light Mode Core Styles */
body {
    background: linear-gradient(135deg, #FDF8F0 0%, #FAF5EB 50%, #F5ECD7 100%);
    min-height: 100vh;
}

.devotion-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(237, 228, 211, 0.5);
    transition: all 0.3s ease;
}

.devotion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(44, 36, 32, 0.08);
}

.scripture-box {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(156, 175, 136, 0.08) 100%);
    border-left: 3px solid #C9A961;
}

.btn-primary {
    background: linear-gradient(135deg, #C9A961 0%, #D4A853 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.4);
}

.btn-secondary {
    border: 1px solid #C9A961;
    color: #C9A961;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(201, 169, 97, 0.08);
    border-color: #D4A853;
}

.theme-pill {
    transition: all 0.2s ease;
}

.theme-pill:hover {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C9A961;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hero-gradient {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(156, 175, 136, 0.1) 50%, rgba(245, 230, 224, 0.1) 100%);
}

.verse-text {
    line-height: 1.8;
    letter-spacing: 0.01em;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.floating-verse {
    position: relative;
}

.floating-verse::before {
    content: '"';
    font-family: 'Cormorant Garamond', serif;
    font-size: 6rem;
    color: rgba(201, 169, 97, 0.15);
    position: absolute;
    top: -1rem;
    left: -1rem;
    line-height: 1;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 97, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(201, 169, 97, 0); }
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* HTMX loading states */
.htmx-request .btn-primary {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request .btn-primary::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Scripture highlight */
.scripture-box {
    position: relative;
    overflow: hidden;
}

.scripture-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #C9A961, #9CAF88);
}

/* Card hover effects */
.devotion-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.devotion-card:hover {
    transform: translateY(-2px);
}

/* Theme pills */
.theme-pill {
    transition: all 0.2s ease;
}

.theme-pill:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Prayer box styling */
.prayer-box {
    background: linear-gradient(135deg, rgba(156, 175, 136, 0.08) 0%, rgba(201, 169, 97, 0.05) 100%);
    border-left: 3px solid #9CAF88;
}

/* Reading progress indicator */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #C9A961, #9CAF88);
    z-index: 100;
    transition: width 0.1s ease;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .hero-gradient h1 {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .devotion-card {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    
    .scripture-box {
        padding: 1.5rem;
    }
    
    .verse-text {
        font-size: 1.1rem;
    }
}

/* Touch-friendly buttons */
@media (pointer: coarse) {
    .btn-primary,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================
   DARK MODE — Comprehensive Sunset/Twilight Theme
   User-specified color scheme:
   - Azure: #53F2FD (primary complement)
   - Deep Violet: #614051 / #380a29 (split complementary)
   - Teal: #8DDCDC (analogous contrast)
   ============================================= */
[data-theme="dark"] {
    /* Core background & text */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1628;
    --bg-card: #1e1a30;
    --bg-card-hover: #252040;
    --text-primary: #f0e6d3;
    --text-secondary: #c8beb4;
    --text-muted: #a09890;
    --border-color: rgba(83, 242, 253, 0.12);
    --border-light: rgba(255, 255, 255, 0.06);
    
    /* Accent colors */
    --accent-azure: #53F2FD;
    --accent-teal: #8DDCDC;
    --accent-violet: #614051;
    --accent-violet-light: #7a5a6e;
    --accent-gold: #C9A961;
    --accent-rose: #c9a9a6;
}

/* ── Body & Backgrounds ── */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1628 40%, #1e1a30 70%, #0f0f23 100%);
    color: var(--text-primary);
}

[data-theme="dark"] .bg-parchment,
[data-theme="dark"] .bg-cream,
[data-theme="dark"] .bg-wheat,
[data-theme="dark"] .bg-sand {
    background: var(--bg-card) !important;
}

[data-theme="dark"] .bg-mist,
[data-theme="dark"] .bg-blush {
    background: rgba(97, 64, 81, 0.2) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-white\/80,
[data-theme="dark"] .bg-white\/90,
[data-theme="dark"] .bg-white\/95 {
    background: var(--bg-card) !important;
}

[data-theme="dark"] .bg-rose\/5 {
    background: rgba(201, 169, 166, 0.08) !important;
}

[data-theme="dark"] .bg-gold\/5 {
    background: rgba(201, 169, 97, 0.1) !important;
}

[data-theme="dark"] .bg-yellow-50\/50 {
    background: rgba(201, 169, 97, 0.15) !important;
}

[data-theme="dark"] .bg-sky-50\/50 {
    background: rgba(83, 242, 253, 0.12) !important;
}

[data-theme="dark"] .bg-purple-50\/50 {
    background: rgba(97, 64, 81, 0.4) !important;
}

/* Dark mode overlay for loading screen (data-theme, not @media) */
[data-theme="dark"] .bg-cream\/95 {
    background: var(--bg-card) !important;
}

[data-theme="dark"] .text-cream\/70 {
    color: rgba(240, 230, 211, 0.7) !important;
}

[data-theme="dark"] .text-cream\/80 {
    color: rgba(240, 230, 211, 0.8) !important;
}

[data-theme="dark"] .text-cream\/50 {
    color: rgba(240, 230, 211, 0.5) !important;
}

[data-theme="dark"] .bg-gold\/10 {
    background: rgba(201, 169, 97, 0.15) !important;
}

[data-theme="dark"] .bg-wheat\/30 {
    background: rgba(30, 26, 48, 0.9) !important;
}

/* ── Navigation ── */
[data-theme="dark"] nav {
    background: rgba(15, 15, 35, 0.92) !important;
    border-bottom-color: rgba(83, 242, 253, 0.1) !important;
}

[data-theme="dark"] nav .nav-link {
    color: var(--text-muted) !important;
}

[data-theme="dark"] nav .nav-link:hover,
[data-theme="dark"] nav .nav-link.active {
    color: var(--accent-azure) !important;
}

[data-theme="dark"] .hover\:bg-sand\/50:hover {
    background: rgba(30, 26, 48, 0.8) !important;
}

/* ── Text Colors ── */
[data-theme="dark"] .text-ink {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-charcoal {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-stone {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-taupe {
    color: #b8a890 !important;
}

[data-theme="dark"] .text-rose {
    color: var(--accent-rose) !important;
}

[data-theme="dark"] .text-gold {
    color: var(--accent-gold) !important;
}

[data-theme="dark"] .text-sage {
    color: #b8c8a8 !important;
}

[data-theme="dark"] .text-olive {
    color: #8aaa60 !important;
}

/* ── Buttons ── */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #C9A961 0%, #D4A853 100%) !important;
    color: #0f0f23 !important;
    border: none;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #D4A853 0%, #C9A961 100%) !important;
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3) !important;
}

[data-theme="dark"] .btn-secondary {
    border-color: rgba(201, 169, 97, 0.4) !important;
    color: #C9A961 !important;
}

[data-theme="dark"] .btn-secondary:hover {
    border-color: #C9A961 !important;
    background: rgba(201, 169, 97, 0.1) !important;
}

/* ── Cards & Containers ── */
[data-theme="dark"] .devotion-card {
    background: var(--bg-card) !important;
    border-color: rgba(83, 242, 253, 0.1) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .devotion-card:hover {
    border-color: rgba(83, 242, 253, 0.25) !important;
}

[data-theme="dark"] .border-sand,
[data-theme="dark"] .border-sand\/50,
[data-theme="dark"] .border-sand\/30 {
    border-color: var(--border-light) !important;
}

[data-theme="dark"] .border-rose\/20 {
    border-color: rgba(201, 169, 166, 0.15) !important;
}

/* ── Scripture/Verse Boxes ── */
[data-theme="dark"] .scripture-box {
    background: linear-gradient(135deg, rgba(83, 242, 253, 0.05) 0%, rgba(97, 64, 81, 0.15) 100%) !important;
}

[data-theme="dark"] .scripture-box::before {
    background: linear-gradient(to bottom, var(--accent-azure), var(--accent-teal)) !important;
}

[data-theme="dark"] .verse-text {
    color: #e0ddd0 !important;
}

/* ── Section Styles ── */
[data-theme="dark"] .story-section {
    background: linear-gradient(135deg, rgba(83, 242, 253, 0.06) 0%, rgba(30, 26, 48, 0.9) 100%) !important;
    border-bottom-color: rgba(83, 242, 253, 0.1) !important;
}

[data-theme="dark"] .reflection-section,
[data-theme="dark"] .reflect-section {
    background: linear-gradient(135deg, rgba(97, 64, 81, 0.15) 0%, rgba(30, 26, 48, 0.9) 100%) !important;
    border-bottom-color: rgba(97, 64, 81, 0.15) !important;
}

[data-theme="dark"] .prayer-section {
    background: linear-gradient(135deg, rgba(141, 220, 220, 0.06) 0%, rgba(30, 26, 48, 0.9) 100%) !important;
    border-bottom-color: rgba(141, 220, 220, 0.1) !important;
}

[data-theme="dark"] .application-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06) 0%, rgba(30, 26, 48, 0.9) 100%) !important;
    border-bottom-color: rgba(201, 169, 97, 0.1) !important;
}

[data-theme="dark"] .prayer-box {
    background: linear-gradient(135deg, rgba(141, 220, 220, 0.08) 0%, rgba(83, 242, 253, 0.05) 100%) !important;
    border-left-color: var(--accent-teal) !important;
}

/* ─── Hero Section ── */
[data-theme="dark"] .hero-gradient {
    background: linear-gradient(135deg, #1a1628 0%, #252040 50%, #1e1a30 100%) !important;
}

[data-theme="dark"] .hero-gradient h1 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .hero-gradient p {
    color: var(--text-secondary) !important;
}

/* ── Stats / Cards ── */
[data-theme="dark"] .stat-card {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
}

[data-theme="dark"] .stat-card .stat-label {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .stat-card .stat-value {
    color: var(--accent-azure) !important;
}

/* ── Theme Pills ── */
[data-theme="dark"] .theme-pill {
    background: rgba(30, 26, 48, 0.8) !important;
    border-color: rgba(83, 242, 253, 0.15) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .theme-pill:hover {
    border-color: var(--accent-azure) !important;
    background: rgba(83, 242, 253, 0.08) !important;
}

[data-theme="dark"] .theme-pill.active {
    background: rgba(83, 242, 253, 0.12) !important;
    border-color: var(--accent-azure) !important;
    color: var(--accent-azure) !important;
}

/* ── Form Elements ── */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: rgba(30, 26, 48, 0.8) !important;
    border-color: rgba(83, 242, 253, 0.15) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--accent-azure) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 242, 253, 0.15) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted) !important;
}

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

/* ── Links ── */
[data-theme="dark"] a {
    color: var(--accent-azure);
}

[data-theme="dark"] a:hover {
    color: var(--accent-teal);
}

/* ── Tags / Badges ── */
[data-theme="dark"] .tag,
[data-theme="dark"] .badge {
    background: rgba(83, 242, 253, 0.1) !important;
    color: var(--accent-azure) !important;
}

/* ── Footer ── */
[data-theme="dark"] footer,
[data-theme="dark"] .footer {
    background: #0a0a18 !important;
    border-top-color: rgba(83, 242, 253, 0.08) !important;
}

[data-theme="dark"] footer .text-stone,
[data-theme="dark"] footer .text-taupe {
    color: #807870 !important;
}

/* ── Scrollbar ── */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f0f23 !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--accent-violet) !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-violet-light) !important;
}

/* ── Selection ── */
[data-theme="dark"] ::selection {
    background: rgba(83, 242, 253, 0.3) !important;
    color: #0f0f23 !important;
}

/* ── Focus Visible ── */
[data-theme="dark"] *:focus-visible {
    outline-color: var(--accent-azure) !important;
}

/* ── HTMX Loading ── */
[data-theme="dark"] .htmx-request .btn-primary {
    opacity: 0.6;
}

/* ── Theme Select / Cards ── */
[data-theme="dark"] .theme-card,
[data-theme="dark"] .category-card {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
}

[data-theme="dark"] .theme-card:hover,
[data-theme="dark"] .category-card:hover {
    border-color: rgba(83, 242, 253, 0.25) !important;
}

/* ── Toast / Flash Messages ── */
[data-theme="dark"] .toast,
[data-theme="dark"] .flash-message {
    background: var(--bg-card) !important;
    border-color: rgba(83, 242, 253, 0.15) !important;
}

/* ── Mobile Menu ── */
[data-theme="dark"] .mobile-menu {
    background: rgba(15, 15, 35, 0.98) !important;
}

[data-theme="dark"] .mobile-menu a {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .mobile-menu a:hover {
    color: var(--accent-azure) !important;
    background: rgba(83, 242, 253, 0.05) !important;
}

/* ── Login / Auth Pages ── */
[data-theme="dark"] .auth-card {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
}

[data-theme="dark"] .auth-card .auth-title {
    color: var(--accent-azure) !important;
}

/* ── About / Contact ── */
[data-theme="dark"] .about-card {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
}

/* ── Print override ── */
@media print {
    [data-theme="dark"] body {
        background: white !important;
        color: black !important;
    }
    [data-theme="dark"] .devotion-card {
        background: white !important;
        border: 1px solid #ddd !important;
    }
}

/* ── Transition for smooth theme switch ── */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Print styles - beautiful output */
@media print {
    nav, .no-print, button, form {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    
    .devotion-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .scripture-box {
        background: #f9f9f9 !important;
        border-left: 3px solid #999 !important;
    }
    
    a {
        text-decoration: none !important;
        color: black !important;
    }
    
    .verse-text {
        font-size: 14pt;
    }
    
    /* Show URL for links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        break-after: avoid;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
}

/* Accessibility: high contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .devotion-card {
        border: 1px solid currentColor;
    }
    
    .scripture-box {
        border-left-width: 6px;
    }
}

/* Sticky section headers for long devotions */
.sticky-header {
    position: sticky;
    top: 4rem;
    z-index: 10;
    background: inherit;
    padding: 0.5rem 0;
}

/* Great Commission highlight */
.gc-highlight {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.08) 0%, rgba(255, 152, 0, 0.05) 100%);
    border-left: 4px solid #FF5722;
}

/* Devotion typography — nicer fonts for reading */
.story-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06) 0%, rgba(255, 248, 240, 0.5) 100%);
    border-bottom: 1px solid rgba(201, 169, 97, 0.15);
}

.reflection-section {
    background: linear-gradient(135deg, rgba(156, 175, 136, 0.06) 0%, rgba(245, 250, 240, 0.5) 100%);
    border-bottom: 1px solid rgba(156, 175, 136, 0.15);
}

.reflect-section {
    background: linear-gradient(135deg, rgba(244, 160, 160, 0.04) 0%, rgba(255, 240, 245, 0.3) 100%);
}

.prayer-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.04) 0%, rgba(240, 248, 255, 0.3) 100%);
}

.application-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.03) 0%, rgba(245, 240, 230, 0.3) 100%);
}

.story-text p,
.body-text p {
    margin-bottom: 1.25rem;
}

.story-text p:last-child,
.body-text p:last-child {
    margin-bottom: 0;
}

/* Better paragraph spacing for devotion text */
.verse-text {
    font-family: 'Georgia', 'Palatino', 'Times New Roman', serif;
    line-height: 1.8;
    font-size: 1.15rem;
    color: #3D352E;
}

@media (min-width: 640px) {
    .verse-text {
        font-size: 1.25rem;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .story-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(44, 36, 32, 0.9) 100%);
    border-bottom: 1px solid rgba(201, 169, 97, 0.1);
}

[data-theme="dark"] .reflection-section {
    background: linear-gradient(135deg, rgba(156, 175, 136, 0.08) 0%, rgba(44, 36, 32, 0.9) 100%);
    border-bottom: 1px solid rgba(156, 175, 136, 0.1);
}

[data-theme="dark"] .reflect-section {
    background: linear-gradient(135deg, rgba(244, 160, 160, 0.06) 0%, rgba(44, 36, 32, 0.8) 100%);
}

[data-theme="dark"] .prayer-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06) 0%, rgba(44, 36, 32, 0.8) 100%);
}

[data-theme="dark"] .application-section {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.04) 0%, rgba(44, 36, 32, 0.8) 100%);
}

/* Responsive typography */
@media (min-width: 1536px) {
    html {
        font-size: 18px;
    }
}

/* Bigger fonts on mobile */
@media (max-width: 640px) {
    body {
        font-size: 17px;
    }
    .devotion-card .whitespace-pre-wrap {
        font-size: 1.1rem !important;
        line-height: 2;
    }
    .devotion-card h1 {
        font-size: 1.75rem !important;
    }
    .devotion-card h2 {
        font-size: 1.3rem !important;
    }
    .verse-text {
        font-size: 1.15rem !important;
    }
}

/* Crop transparent padding from logo images (original: 559px, content: 103-455) */
.logo-crop {
    overflow: hidden;
    line-height: 0;
}
.logo-crop img {
    margin-top: -18.4%;
    margin-bottom: -18.6%;
    display: block;
}
