/* Custom styles complementing Tailwind */
.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
    font-weight: 700;
    color: #111827;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.lesson-content h1 { font-size: 1.5rem; }
.lesson-content h2 { font-size: 1.25rem; }
.lesson-content h3 { font-size: 1.125rem; }

.lesson-content strong { font-weight: 700; }
.lesson-content em { font-style: italic; }

.lesson-content p {
    margin-bottom: 1rem;
    line-height: 1.75;
    text-align: justify;
}

.lesson-content ul, .lesson-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.lesson-content blockquote,
.lesson-content .bible-quote {
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-style: italic;
    color: #78350f;
    position: relative;
}
.lesson-content blockquote::before {
    content: '\201C';
    font-size: 3rem;
    position: absolute;
    top: -0.25rem;
    left: 0.75rem;
    color: #f59e0b;
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.lesson-content figure {
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
}
.lesson-content figure img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
}
.lesson-content figcaption {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 0.5rem;
}
.lesson-content figcaption a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}
.lesson-content figcaption a:hover {
    color: #3b82f6;
}

/* Verse links */
.verse-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    white-space: nowrap;
}
.verse-link:hover {
    color: #1d4ed8;
    text-decoration-style: solid;
}
.verse-link::after {
    content: '\1F4D6';
    font-size: 0.65em;
    margin-left: 2px;
    opacity: 0.5;
}

/* Verse Popup */
.verse-popup {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}
.verse-popup-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.verse-popup-header h3 {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.verse-popup-body {
    padding: 1.25rem;
}
.verse-popup-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #374151;
    font-style: italic;
    text-align: center;
}
.verse-popup-ref {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}
.verse-popup-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.verse-popup-close:hover {
    background: rgba(255,255,255,0.3);
}
.verse-popup-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}
.verse-popup-loading .spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 0.75rem;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Quiz option selected state */
.option-label:has(input:checked) {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Smooth focus states */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* No horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
img, video, table {
    max-width: 100%;
    height: auto;
}
.lesson-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Force Arial on lesson content — overrides any font-family pasted from Word (inline styles, mso junk, etc.) */
.lesson-content,
.lesson-content * {
    font-family: Arial, Helvetica, sans-serif !important;
}
.lesson-content pre,
.lesson-content code {
    font-family: Consolas, 'Courier New', monospace !important;
}

/* Responsive tables */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Safe area for mobile bottom nav (iPhone notch) */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Hide scrollbar on mobile bottom nav */
@supports (-webkit-touch-callout: none) {
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Hero Carousel */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    transform: scale(1.05);
    animation: heroZoom 8s ease-in-out infinite alternate;
}
.hero-slide.active {
    opacity: 1;
}
.hero-slide.active {
    animation: heroZoom 8s ease-in-out infinite alternate;
}
@keyframes heroZoom {
    from { transform: scale(1.0); }
    to { transform: scale(1.08); }
}

.scrollbar-hide::-webkit-scrollbar { display: none !important; }
.scrollbar-hide { -ms-overflow-style: none !important; scrollbar-width: none !important; overflow: -moz-scrollbars-none !important; }

/* ── Custom scrollbars (admin & dashboard layouts) ── */
html {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #eef2f7;
}
body::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 9999px;
}
body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 9999px;
    border: 3px solid #eef2f7;
    background-clip: padding-box;
}
body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border: 3px solid #eef2f7;
    background-clip: padding-box;
}
body::-webkit-scrollbar-thumb:active,
html::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
    border: 3px solid #eef2f7;
    background-clip: padding-box;
}
body::-webkit-scrollbar-corner,
html::-webkit-scrollbar-corner { background: #eef2f7; }

/* Admin layout main area */
body.admin-scroll {
    scrollbar-color: #3b82f6 #eef2f7;
}

/* Dark admin sidebar */
#adminSidebar {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 transparent;
}
#adminSidebar::-webkit-scrollbar {
    width: 8px;
}
#adminSidebar::-webkit-scrollbar-track {
    background: transparent;
}
#adminSidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
#adminSidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Light inner scroll containers (tables, lists) */
.inner-scroll,
.overflow-x-auto {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #eef2f7;
}
.inner-scroll::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.inner-scroll::-webkit-scrollbar-track,
.overflow-x-auto::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 9999px;
}
.inner-scroll::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 9999px;
    border: 2px solid #eef2f7;
    background-clip: padding-box;
}
.inner-scroll::-webkit-scrollbar-thumb:hover,
.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border: 2px solid #eef2f7;
    background-clip: padding-box;
}

.animate-slideUp { animation: slideUp 0.25s ease-out; }

/* ═══ NECUM MODAL SYSTEM ═══ */
.necum-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.necum-modal-overlay.necum-modal-show { opacity: 1; }
.necum-modal-overlay.necum-modal-hide { opacity: 0; }

.necum-modal {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    max-width: 24rem;
    width: 100%;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}
.necum-modal-show .necum-modal { transform: scale(1) translateY(0); }
.necum-modal-hide .necum-modal { transform: scale(0.95) translateY(10px); }

.necum-modal-body {
    padding: 2rem 1.5rem 0.5rem;
    text-align: center;
}

.necum-modal-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}
.necum-modal-icon-warn { background: #fef3c7; color: #d97706; }
.necum-modal-icon-success { background: #d1fae5; color: #059669; }
.necum-modal-icon-error { background: #fee2e2; color: #dc2626; }
.necum-modal-icon-info { background: #dbeafe; color: #2563eb; }

.necum-modal-text {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.necum-modal-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem 1.5rem;
    justify-content: center;
}

.necum-modal-btn {
    flex: 1;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.necum-modal-btn:active { transform: scale(0.97); }
.necum-modal-btn:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

.necum-modal-btn-primary { background: #2563eb; color: #fff; }
.necum-modal-btn-primary:hover { background: #1d4ed8; }

.necum-modal-btn-danger { background: #dc2626; color: #fff; }
.necum-modal-btn-danger:hover { background: #b91c1c; }

.necum-modal-cancel { background: #f3f4f6; color: #6b7280; }
.necum-modal-cancel:hover { background: #e5e7eb; color: #374151; }

