/* =========================================================================
   WISPR FLOW DESIGN SYSTEM - STYLESHEET
   Aesthetic: "Quiet Luxury" + "Editorial Tech"
   Palette: Obsidian, Luminous Emerald (#00DF89), Lumen Lime (#D4F938), Pulse Coral (#FF6B4A)
   Typography: Plus Jakarta Sans (UI) + Instrument Serif (Editorial Accents)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --wispr-bg: #f1f5f9;
    --wispr-bg-subtle: #e2e8f0;
    --wispr-card-bg: #ffffff;
    --wispr-card-border: #e2e8f0;
    --wispr-card-border-hover: #3b82f6;
    --wispr-card-inner-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 1);
    --wispr-emerald: #059669;
    --wispr-emerald-glow: rgba(16, 185, 129, 0.25);
    --wispr-lumen: #65a30d;
    --wispr-pulse: #ea580c;
    --wispr-text-primary: #0f172a;
    --wispr-text-muted: #334155;
}

/* Glass Card Default (Clean Crisp White in Light Mode) */
.glass-card {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05), 0 1px 3px 0 rgba(15, 23, 42, 0.03) !important;
    color: #0f172a;
}

/* Vibrant Colorful Bento Stat Cards for Older Users (High Contrast & Clear Boundaries) */
.card-stat-blue {
    background: linear-gradient(145deg, #f0f7ff 0%, #ffffff 100%) !important;
    border: 1.5px solid #bfdbfe !important;
    box-shadow: 0 4px 16px -2px rgba(37, 99, 235, 0.08) !important;
}
.card-stat-blue:hover {
    border-color: #60a5fa !important;
    transform: translateY(-2px);
}

.card-stat-emerald {
    background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 100%) !important;
    border: 1.5px solid #bbf7d0 !important;
    box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.08) !important;
}
.card-stat-emerald:hover {
    border-color: #4ade80 !important;
    transform: translateY(-2px);
}

.card-stat-amber {
    background: linear-gradient(145deg, #fffbeb 0%, #ffffff 100%) !important;
    border: 1.5px solid #fde68a !important;
    box-shadow: 0 4px 16px -2px rgba(245, 158, 11, 0.08) !important;
}
.card-stat-amber:hover {
    border-color: #fbbf24 !important;
    transform: translateY(-2px);
}

.card-stat-rose {
    background: linear-gradient(145deg, #fff1f2 0%, #ffffff 100%) !important;
    border: 1.5px solid #fecdd3 !important;
    box-shadow: 0 4px 16px -2px rgba(244, 63, 94, 0.08) !important;
}
.card-stat-rose:hover {
    border-color: #fb7185 !important;
    transform: translateY(-2px);
}

.card-stat-purple {
    background: linear-gradient(145deg, #faf5ff 0%, #ffffff 100%) !important;
    border: 1.5px solid #e9d5ff !important;
    box-shadow: 0 4px 16px -2px rgba(168, 85, 247, 0.08) !important;
}
.card-stat-purple:hover {
    border-color: #c084fc !important;
    transform: translateY(-2px);
}

/* Dark Mode Token Overrides (Applied to Admin, Guru, and any dark pages) */
html.dark, .dark {
    --wispr-bg: #07090d;
    --wispr-bg-subtle: #0d121c;
    --wispr-card-bg: rgba(14, 20, 30, 0.88);
    --wispr-card-border: rgba(255, 255, 255, 0.08);
    --wispr-card-border-hover: rgba(0, 223, 137, 0.35);
    --wispr-card-inner-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
    --wispr-emerald: #00df89;
    --wispr-emerald-glow: rgba(0, 223, 137, 0.25);
    --wispr-lumen: #d4f938;
    --wispr-pulse: #ff6b4a;
    --wispr-text-primary: #f8fafc;
    --wispr-text-muted: #94a3b8;
}

/* Typography Utility */
.font-sans-ui {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-editorial {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 400;
}

/* Global Background and Canvas */
body {
    background-color: var(--wispr-bg) !important;
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
    min-height: 100vh;
}

html.dark body,
.dark body {
    background-color: #07090d !important;
    color: #f8fafc !important;
}

/* 1. Subtle Cyber-Grid & Micro-Dots Matrix Texture (Light Mode) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(rgba(16, 185, 129, 0.2) 1.2px, transparent 1.2px),
        linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
    background-size: 32px 32px, 32px 32px, 32px 32px;
    mask-image: radial-gradient(ellipse 95% 80% at 50% 15%, black 30%, transparent 90%);
    -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 15%, black 30%, transparent 90%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.9;
}

html.dark body::before,
.dark body::before {
    background-image: 
        radial-gradient(rgba(0, 223, 137, 0.22) 1.2px, transparent 1.2px),
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px, 32px 32px, 32px 32px;
    opacity: 0.85;
}

/* 2. Atmospheric Horizon Emerald Beam (Light Mode Vibrant) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 480px;
    background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(16, 185, 129, 0.18) 0%, rgba(56, 189, 248, 0.15) 36%, rgba(99, 102, 241, 0.08) 68%, transparent 90%);
    pointer-events: none;
    z-index: 0;
}

html.dark body::after,
.dark body::after {
    background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(0, 223, 137, 0.18) 0%, rgba(56, 189, 248, 0.12) 36%, rgba(99, 102, 241, 0.06) 68%, transparent 90%);
}

/* 3. Ambient Radial Glows (Lush & Colorful Light Aurora) */
.wispr-ambient-glow {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 9999px;
    filter: blur(80px);
    opacity: 0.55;
    will-change: transform, opacity;
    transition: opacity 0.5s ease;
}

.wispr-glow-top {
    top: -90px;
    left: -60px;
    width: max(380px, 50vw);
    height: max(380px, 50vw);
    background: radial-gradient(circle, rgba(16, 185, 129, 0.32) 0%, rgba(56, 189, 248, 0.25) 38%, rgba(99, 102, 241, 0.12) 65%, transparent 80%);
    animation: wisprAuroraDrift 16s ease-in-out infinite alternate;
}

.wispr-glow-bottom {
    bottom: -110px;
    right: -60px;
    width: max(400px, 52vw);
    height: max(400px, 52vw);
    background: radial-gradient(circle, rgba(249, 115, 22, 0.24) 0%, rgba(245, 158, 11, 0.2) 36%, rgba(139, 92, 246, 0.14) 65%, transparent 80%);
    animation: wisprAuroraPulse 20s ease-in-out infinite alternate;
}

@keyframes wisprAuroraDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.45;
    }
    50% {
        transform: translate3d(35px, 25px, 0) scale(1.1);
        opacity: 0.65;
    }
    100% {
        transform: translate3d(-25px, 45px, 0) scale(0.95);
        opacity: 0.45;
    }
}

@keyframes wisprAuroraPulse {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translate3d(-35px, -25px, 0) scale(1.12);
        opacity: 0.6;
    }
    100% {
        transform: translate3d(25px, -35px, 0) scale(1);
        opacity: 0.4;
    }
}

/* Bento Card Design */
.wispr-card {
    background: var(--wispr-card-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--wispr-card-border);
    box-shadow: var(--wispr-card-inner-highlight), 0 16px 36px -12px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wispr-card:hover {
    border-color: rgba(203, 213, 225, 1);
    box-shadow: var(--wispr-card-inner-highlight), 0 20px 40px -12px rgba(15, 23, 42, 0.12), 0 6px 16px -2px rgba(15, 23, 42, 0.06);
}

.wispr-card-interactive:hover {
    border-color: var(--wispr-card-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--wispr-card-inner-highlight), 0 24px 48px -12px rgba(16, 185, 129, 0.18);
}

/* Dark Mode Card Specifics */
html.dark .wispr-card,
.dark .wispr-card {
    background: rgba(14, 20, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 20px 40px -20px rgba(0, 0, 0, 0.7);
    color: #f8fafc;
}

html.dark .wispr-card:hover,
.dark .wispr-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
}

html.dark .wispr-card-interactive:hover,
.dark .wispr-card-interactive:hover {
    border-color: rgba(0, 223, 137, 0.4);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 24px 48px -20px rgba(0, 223, 137, 0.18);
}

/* Floating Pill Elements */
.wispr-pill {
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 1), 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

html.dark .wispr-pill,
.dark .wispr-pill {
    background: rgba(14, 20, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

.wispr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.wispr-badge-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.3);
}

html.dark .wispr-badge-emerald,
.dark .wispr-badge-emerald {
    background: rgba(0, 223, 137, 0.12);
    color: #00df89;
    border-color: rgba(0, 223, 137, 0.25);
}

.wispr-badge-lumen {
    background: rgba(101, 163, 13, 0.12);
    color: #4d7c0f;
    border-color: rgba(101, 163, 13, 0.3);
}

html.dark .wispr-badge-lumen,
.dark .wispr-badge-lumen {
    background: rgba(212, 249, 56, 0.12);
    color: #d4f938;
    border-color: rgba(212, 249, 56, 0.25);
}

.wispr-badge-pulse {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.3);
}

html.dark .wispr-badge-pulse,
.dark .wispr-badge-pulse {
    background: rgba(255, 107, 74, 0.12);
    color: #ff6b4a;
    border-color: rgba(255, 107, 74, 0.25);
}

/* Luminous Pill Buttons */
.wispr-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 24px -4px rgba(16, 185, 129, 0.42), inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.wispr-btn-primary:hover {
    background: linear-gradient(135deg, #34d399 0%, #047857 100%);
    box-shadow: 0 14px 30px -4px rgba(16, 185, 129, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.wispr-btn-primary:active {
    transform: scale(0.98);
}

.wispr-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.wispr-btn-ghost:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.9);
}

html.dark .wispr-btn-ghost,
.dark .wispr-btn-ghost {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

html.dark .wispr-btn-ghost:hover,
.dark .wispr-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Glass Card styling synchronization for Dark Mode */
html.dark .glass-card,
.dark .glass-card {
    background: rgba(14, 20, 30, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 20px 40px -20px rgba(0, 0, 0, 0.7) !important;
    color: #f8fafc;
}

/* Form Controls Dark Mode High Contrast */
html.dark input[type="text"],
html.dark input[type="date"],
html.dark input[type="password"],
html.dark input[type="email"],
html.dark input[type="number"],
html.dark select,
html.dark textarea {
    background-color: #0b111a !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #64748b !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
    border-color: rgba(0, 223, 137, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(0, 223, 137, 0.15) !important;
    outline: none !important;
}

/* Tables in Dark Mode */
html.dark thead th {
    color: #cbd5e1 !important;
}

html.dark tbody tr {
    transition: background-color 0.15s ease;
}

html.dark tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Light Mode Form Controls - Senior-Friendly Crisp High Contrast */
input[type="text"],
input[type="date"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="time"],
select,
textarea {
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-weight: 600;
}

input::placeholder,
textarea::placeholder {
    color: #64748b !important;
    font-weight: 500;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

/* Senior-Friendly Table Styling in Light Mode */
table thead th {
    background-color: #f8fafc;
    color: #1e293b !important;
    font-weight: 800 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

table tbody tr {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a !important;
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background-color: #f8faff !important;
}

/* Pulsing Status Dot */
.wispr-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: #00df89;
    box-shadow: 0 0 10px #00df89;
    animation: wispr-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes wispr-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(1.3);
    }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.6);
}
