/**
 * WebSchool.id - Unified Light & Dark Mode System
 */

/* Smooth transitions for theme switching */
html, body, header, nav, aside, main, footer, div, a, button, input, textarea, select, table, tr, td, th {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: 200ms;
    transition-timing-function: ease;
}

/* =============================================================================
   1. MEMBER PORTAL DARK MODE (member/index.php, member/profil.php, etc.)
   ============================================================================= */
html.dark body {
    background-color: #090d16 !important;
    color: #f1f5f9 !important;
}

/* Header in Dark Mode */
html.dark header {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: #1e293b !important;
}
html.dark header h1, html.dark header h2, html.dark header .text-slate-900 {
    color: #ffffff !important;
}
html.dark header .text-slate-500, html.dark header .text-slate-600 {
    color: #94a3b8 !important;
}

/* Navigation tabs in member */
html.dark nav.bg-slate-100 {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark nav a {
    color: #94a3b8 !important;
}
html.dark nav a:hover {
    color: #ffffff !important;
}
html.dark nav a.bg-white {
    background-color: #1e293b !important;
    color: #34d399 !important;
}

/* Cards & containers in member portal */
html.dark .bg-white {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}
html.dark .text-slate-900, html.dark .text-slate-800 {
    color: #f8fafc !important;
}
html.dark .text-slate-700, html.dark .text-slate-600 {
    color: #cbd5e1 !important;
}
html.dark .text-slate-500, html.dark .text-slate-400 {
    color: #94a3b8 !important;
}

/* Inner sub-boxes */
html.dark .bg-slate-50, html.dark .bg-slate-100 {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .border-slate-100, html.dark .border-slate-200 {
    border-color: #1e293b !important;
}

/* Forms & inputs */
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="number"],
html.dark input[type="tel"],
html.dark textarea,
html.dark select {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #64748b !important;
}

/* License box in member products */
html.dark .card-license-box {
    background-color: #090d16 !important;
    border-color: #1e293b !important;
}

/* Theme Toggle Button Styling */
.ws-theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.875rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
html:not(.dark) .ws-theme-toggle {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}
html:not(.dark) .ws-theme-toggle:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}
html.dark .ws-theme-toggle {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #fbbf24;
}
html.dark .ws-theme-toggle:hover {
    background-color: #334155;
    border-color: #475569;
    color: #fef08a;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

/* =============================================================================
   2. LMS LEARNING PLAYER (member/belajar.php)
   ============================================================================= */
/* LIGHT MODE - Crisp, high contrast, clean modern educational style */
html:not(.dark) .lms-player-body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}
html:not(.dark) .lms-player-header {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
}
html:not(.dark) .lms-player-header h1 {
    color: #0f172a !important;
}
html:not(.dark) .lms-player-header .lms-btn-icon {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}
html:not(.dark) .lms-player-header .lms-btn-icon:hover {
    background-color: #e2e8f0 !important;
    color: #000000 !important;
}
html:not(.dark) .lms-progress-pill {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
html:not(.dark) .lms-progress-pill strong {
    color: #059669 !important;
}
html:not(.dark) .lms-progress-pill span {
    color: #64748b !important;
}

/* Sidebar in Light Mode */
html:not(.dark) #courseSidebar {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}
html:not(.dark) #courseSidebar .sidebar-header {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
html:not(.dark) #courseSidebar h2 {
    color: #0f172a !important;
}
html:not(.dark) #courseSidebar .chapter-card {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
html:not(.dark) #courseSidebar .chapter-card:hover {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html:not(.dark) #courseSidebar .chapter-card h3 {
    color: #1e293b !important;
}
html:not(.dark) #courseSidebar .chapter-card-active {
    background-color: #ecfdf5 !important;
    border-color: #10b981 !important;
    box-shadow: 0 1px 3px 0 rgba(16, 185, 129, 0.15) !important;
}
html:not(.dark) #courseSidebar .chapter-card-active h3 {
    color: #064e3b !important;
    font-weight: 800 !important;
}
html:not(.dark) #courseSidebar .chapter-card-locked {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
html:not(.dark) #courseSidebar .chapter-card-locked h3 {
    color: #64748b !important;
}

/* Content cards in Light Mode */
html:not(.dark) .lms-content-card {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04) !important;
}
html:not(.dark) .lms-content-card h2,
html:not(.dark) .lms-content-card h3 {
    color: #0f172a !important;
}
html:not(.dark) .lms-content-card p {
    color: #475569 !important;
}

/* Prose text content inside lessons in Light Mode */
html:not(.dark) .prose-custom {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}
html:not(.dark) .prose-custom p {
    color: #334155 !important;
    font-size: 0.875rem !important;
    line-height: 1.75 !important;
}
html:not(.dark) .prose-custom h1,
html:not(.dark) .prose-custom h2,
html:not(.dark) .prose-custom h3,
html:not(.dark) .prose-custom h4 {
    color: #0f172a !important;
    font-weight: 800 !important;
}
html:not(.dark) .prose-custom ul,
html:not(.dark) .prose-custom ol,
html:not(.dark) .prose-custom li {
    color: #334155 !important;
}
html:not(.dark) .prose-custom strong,
html:not(.dark) .prose-custom b {
    color: #0f172a !important;
    font-weight: 700 !important;
}
html:not(.dark) .prose-custom code {
    background-color: #e2e8f0 !important;
    color: #0369a1 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Bottom bar in Light Mode */
html:not(.dark) .lms-bottom-bar {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
}
html:not(.dark) .lms-bottom-bar h3 {
    color: #0f172a !important;
}
html:not(.dark) .lms-bottom-bar p {
    color: #64748b !important;
}

/* DARK MODE - Elegant midnight style for LMS */
html.dark .lms-player-body {
    background-color: #090d16 !important;
    color: #f1f5f9 !important;
}
html.dark .lms-player-header {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: #1e293b !important;
}
html.dark #courseSidebar {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark .lms-content-card,
html.dark .lms-bottom-bar {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark .prose-custom {
    background-color: rgba(2, 6, 23, 0.6) !important;
    border-color: #1e293b !important;
    color: #cbd5e1 !important;
}
html.dark .prose-custom p,
html.dark .prose-custom li {
    color: #cbd5e1 !important;
}
html.dark .prose-custom h1,
html.dark .prose-custom h2,
html.dark .prose-custom h3,
html.dark .prose-custom h4,
html.dark .prose-custom strong {
    color: #ffffff !important;
}
html.dark .prose-custom code {
    background-color: rgba(15, 23, 42, 0.9) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(51, 65, 85, 0.8) !important;
}

/* Tips & Callout Boxes inside Prose (Light Mode - Crisp & Legible) */
html:not(.dark) .prose-custom div[style*="border-left"],
html:not(.dark) .prose-custom .lms-callout,
html:not(.dark) .prose-custom .lms-callout-tip {
    background-color: #ecfdf5 !important;
    border-left: 4px solid #059669 !important;
    border-radius: 0.75rem !important;
    color: #064e3b !important;
    box-shadow: 0 1px 2px 0 rgba(16, 185, 129, 0.08) !important;
}
html:not(.dark) .prose-custom div[style*="border-left"] *,
html:not(.dark) .prose-custom .lms-callout *,
html:not(.dark) .prose-custom .lms-callout-tip * {
    color: #064e3b !important;
}
html:not(.dark) .prose-custom div[style*="border-left"] strong,
html:not(.dark) .prose-custom .lms-callout strong,
html:not(.dark) .prose-custom .lms-callout-tip strong {
    color: #047857 !important;
    font-weight: 800 !important;
}
html:not(.dark) .prose-custom .text-emerald-300,
html:not(.dark) .prose-custom .text-emerald-400,
html:not(.dark) .prose-custom .text-emerald-500 {
    color: #065f46 !important;
}
html:not(.dark) .prose-custom .text-slate-300,
html:not(.dark) .prose-custom .text-slate-400 {
    color: #334155 !important;
}
html:not(.dark) .prose-custom .text-white {
    color: #0f172a !important;
}

/* Tips & Callout Boxes inside Prose (Dark Mode) */
html.dark .prose-custom div[style*="border-left"],
html.dark .prose-custom .lms-callout,
html.dark .prose-custom .lms-callout-tip {
    background-color: rgba(6, 78, 59, 0.3) !important;
    border-left: 4px solid #10b981 !important;
    border-radius: 0.75rem !important;
    color: #a7f3d0 !important;
}
html.dark .prose-custom div[style*="border-left"] *,
html.dark .prose-custom .lms-callout *,
html.dark .prose-custom .lms-callout-tip * {
    color: #a7f3d0 !important;
}
html.dark .prose-custom div[style*="border-left"] strong,
html.dark .prose-custom .lms-callout strong,
html.dark .prose-custom .lms-callout-tip strong {
    color: #34d399 !important;
    font-weight: 800 !important;
}

/* =============================================================================
   3. ADMIN PANEL DARK MODE (admin/kelas.php, admin/header.php, etc.)
   ============================================================================= */
html.dark .bg-slate-100 {
    background-color: #090d16 !important;
}
html.dark aside#adminSidebar {
    background-color: #020617 !important;
    border-color: #0f172a !important;
}
html.dark main {
    background-color: #090d16 !important;
    color: #f1f5f9 !important;
}
html.dark .dataTables_wrapper {
    color: #cbd5e1 !important;
}
html.dark table.dataTable tbody tr {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}
html.dark table.dataTable tbody tr:hover {
    background-color: #1e293b !important;
}
html.dark table.dataTable thead th {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

/* Modals in Dark Mode */
html.dark .fixed .bg-white {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}
html.dark .fixed .bg-slate-50 {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Public Header in Dark Mode */
html.dark header.sticky {
    background-color: rgba(15, 23, 42, 0.92) !important;
    border-color: #1e293b !important;
}
html.dark #mobileNavMenu {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark .nav-link-item {
    color: #94a3b8 !important;
}
html.dark .nav-link-item:hover {
    color: #34d399 !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}
html.dark .nav-link-item.active {
    background-color: #1e293b !important;
    color: #34d399 !important;
    border-color: #065f46 !important;
}

/* Theme icon animation */
.ws-theme-toggle .theme-icon {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ws-theme-toggle:hover .theme-icon {
    transform: rotate(25deg) scale(1.15);
}
html.dark .ws-theme-toggle:hover .theme-icon {
    transform: rotate(45deg) scale(1.2);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

/* ==========================================================================
   PRIVACY BLUR MODE (Sensor Kotak Email & WhatsApp Member/Siswa)
   ========================================================================== */
body.privacy-blur-active .privacy-blur-target {
    filter: blur(6px) !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: filter 0.25s ease-in-out, opacity 0.25s ease-in-out !important;
}

body.privacy-blur-active a.privacy-blur-target {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
}

.btn-privacy-toggle {
    transition: all 0.2s ease-in-out;
}
.btn-privacy-toggle.active {
    background-color: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
    box-shadow: 0 1px 3px 0 rgba(245, 158, 11, 0.2) !important;
}
html.dark .btn-privacy-toggle.active {
    background-color: rgba(245, 158, 11, 0.2) !important;
    border-color: #f59e0b !important;
    color: #fde68a !important;
}
