/**
 * MockAttempt Academy — Master Design System Stylesheet
 * Version: 3.0.0
 * Architecture: Modular Layered Architecture with Full Legacy Compatibility
 */

/* 1. Modular CSS Subsystems (font files are preconnected by each shell). */
@import url('design-tokens.css?v=3.0.0');
@import url('base.css?v=3.0.0');
@import url('components.css?v=3.0.0');
@import url('forms.css?v=3.0.0');
@import url('layout.css?v=3.0.0');
@import url('auth.css?v=3.0.0');
@import url('marketing.css?v=3.0.0');
@import url('catalog.css?v=3.0.0');
@import url('assessment.css?v=3.0.0');
@import url('student.css?v=3.0.0');
@import url('responsive.css?v=3.0.0');
@import url('experience.css?v=3.0.0');

/* --------------------------------------------------
 * 2. Legacy Class Compatibility Layer & Utilities
 * (Guarantees zero regression on existing Blade templates)
 * -------------------------------------------------- */
.bg-ma-primary { background-color: var(--ma-primary) !important; color: #ffffff !important; }
.bg-ma-dark { background-color: var(--ma-primary-dark) !important; color: #ffffff !important; }
.bg-ma-surface { background-color: var(--ma-surface) !important; }
.bg-ma-light { background-color: var(--ma-primary-light) !important; }
.text-ma-primary { color: var(--ma-primary) !important; }
.text-ma-secondary { color: var(--ma-secondary) !important; }
.border-ma { border-color: var(--ma-border) !important; }
.bg-opacity-15 { --bs-bg-opacity: 0.15 !important; }
.bg-opacity-20 { --bs-bg-opacity: 0.2 !important; }
.bg-opacity-25 { --bs-bg-opacity: 0.25 !important; }
.bg-opacity-30 { --bs-bg-opacity: 0.3 !important; }

/* Pulsing Status Dot (Used in Live Exams & Online Status) */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}
.pulse-dot.pulse-success {
    background-color: var(--ma-success);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulseSuccess 2s infinite;
}
.pulse-dot.pulse-danger {
    background-color: var(--ma-danger);
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
    animation: pulseDanger 2s infinite;
}
.pulse-dot.pulse-warning {
    background-color: var(--ma-warning);
    box-shadow: 0 0 0 rgba(245, 158, 11, 0.4);
    animation: pulseWarning 2s infinite;
}

@keyframes pulseSuccess {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseDanger {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulseWarning {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* --------------------------------------------------
 * 3. Modern Redesigned Navbar, Logo & Mega Menus
 * -------------------------------------------------- */
.ma-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    transition: transform 150ms ease;
}

.ma-brand-logo:hover {
    transform: translateY(-1px);
}

.ma-logo-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ma-brand-logo:hover .ma-logo-emblem {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42);
}

.ma-logo-wordmark {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    line-height: 1;
}

.ma-logo-gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ma-brand-logo--white .ma-logo-gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-ma-tag {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border: 1px solid transparent;
}

.badge-ma-tag--primary { background: rgba(37, 99, 235, 0.1); color: #2563eb; border-color: rgba(37, 99, 235, 0.2); }
.badge-ma-tag--success { background: rgba(16, 185, 129, 0.1); color: #059669; border-color: rgba(16, 185, 129, 0.2); }
.badge-ma-tag--danger  { background: rgba(239, 68, 68, 0.1);  color: #dc2626; border-color: rgba(239, 68, 68, 0.2); }
.badge-ma-tag--info    { background: rgba(6, 182, 212, 0.1);  color: #0891b2; border-color: rgba(6, 182, 212, 0.2); }
.badge-ma-tag--warning { background: rgba(245, 158, 11, 0.1); color: #d97706; border-color: rgba(245, 158, 11, 0.2); }

.ma-announcement-bar {
    background: #0b1120;
    color: #cbd5e1;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1021;
}

.ma-announcement-bar a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 150ms ease;
}

.ma-announcement-bar a:hover {
    color: #ffffff;
}

.ma-pulse-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ma-navbar {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 2.5px solid;
    border-image: linear-gradient(90deg, #2563eb 0%, #4f46e5 25%, #7c3aed 50%, #06b6d4 75%, #10b981 100%) 1;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.05);
    width: 100%;
    max-width: 100%;
}

.ma-brand-mock {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.ma-brand-attempt {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.ma-brand-tagline {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
    background: linear-gradient(90deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    width: 100%;
    margin-top: 3px;
}

.ma-brand-logo--white .ma-brand-tagline {
    background: none;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.7);
    color: rgba(255, 255, 255, 0.7);
}

.badge-ma-tag--primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(79, 70, 229, 0.12) 100%);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.25);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
}

.ma-navbar .nav-link {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.885rem;
    color: #334155 !important;
    padding: 0.42rem 0.65rem !important;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap !important;
    border: 1px solid transparent;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ma-navbar .nav-link:hover,
.ma-navbar .nav-link:focus {
    color: #2563eb !important;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.08));
    border-color: rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.ma-navbar .nav-link.active {
    color: #1d4ed8 !important;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(79, 70, 229, 0.14) 100%) !important;
    border: 1.2px solid rgba(37, 99, 235, 0.32) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px -1px rgba(37, 99, 235, 0.2);
}

.ma-navbar .nav-link.active::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2563eb;
    margin-left: 2px;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.6);
}

@media (max-width: 1199.98px) {
    .ma-navbar #navbarDesktop {
        display: none !important;
    }
    .ma-navbar .navbar-toggler {
        display: inline-flex !important;
    }
}

@media (min-width: 1200px) {
    .ma-navbar #navbarDesktop {
        display: flex !important;
    }
    .ma-navbar .navbar-toggler {
        display: none !important;
    }
}

/* Mega-Menu Styling */
.ma-mega-menu {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(37, 99, 235, 0.05);
    padding: 0.85rem;
    margin-top: 0.65rem;
    white-space: normal;
    animation: maMenuFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes maMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ma-mega-menu--compact {
    width: 320px !important;
    max-width: min(320px, calc(100vw - 2rem));
}

.ma-menu-item-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    text-decoration: none !important;
    white-space: normal;
    transition: all 180ms ease;
}

.ma-menu-item-link:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateX(4px);
}

.ma-menu-icon-chip {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    transition: transform 180ms ease;
}

.ma-menu-item-link:hover .ma-menu-icon-chip {
    transform: scale(1.08);
}

.ma-chip--blue   { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.15); }
.ma-chip--purple { background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.15); }
.ma-chip--emerald{ background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #059669; border: 1px solid rgba(16, 185, 129, 0.15); }
.ma-chip--amber  { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.15); }
.ma-chip--cyan   { background: linear-gradient(135deg, #ecfeff, #cffafe); color: #0891b2; border: 1px solid rgba(6, 182, 212, 0.15); }
.ma-chip--rose   { background: linear-gradient(135deg, #fff1f2, #ffe4e6); color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.15); }

.ma-menu-item-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 0.2rem;
    white-space: nowrap;
}

.ma-menu-item-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
    white-space: normal;
}

.ma-btn-glow {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    border: none;
    padding: 0.48rem 1.15rem !important;
    font-size: 0.85rem;
    box-shadow: 0 4px 16px -2px rgba(79, 70, 229, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    white-space: nowrap !important;
    flex-shrink: 0;
    transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ma-btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -2px rgba(79, 70, 229, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    color: #ffffff !important;
}

.ma-btn-outline-subtle {
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    color: #1e293b;
    font-weight: 600;
    background: #ffffff;
    padding: 0.45rem 1rem !important;
    font-size: 0.85rem;
    white-space: nowrap !important;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 180ms ease;
}

.ma-btn-outline-subtle:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
    color: #2563eb;
    transform: translateY(-1px);
}

.ma-user-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 150ms ease;
}

.ma-user-pill:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    background: #f8fafc;
}

.ma-user-pill-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ma-offcanvas {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 320px !important;
    max-width: 88vw !important;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
}

.ma-offcanvas .accordion-button {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
    background: transparent;
    padding: 0.75rem 0.85rem;
    border-radius: 0.65rem;
    box-shadow: none;
}

.ma-offcanvas .accordion-button:not(.collapsed) {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.ma-mobile-item {
    display: flex !important;
    width: 100% !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    color: #334155;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 150ms ease;
}

.ma-mobile-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

.ma-mobile-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(79, 70, 229, 0.14) 100%) !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
    border-left: 3.5px solid #2563eb;
}

.ma-mobile-sublink {
    display: block !important;
    width: 100% !important;
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    color: #475569;
    font-size: 0.825rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
}

.ma-mobile-sublink:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

/* Strict Viewport Switching Between Desktop Navbar and Mobile Offcanvas Drawer */
@media (min-width: 1200px) {
    #maOffcanvasNav.offcanvas,
    .ma-offcanvas {
        display: none !important;
        visibility: hidden !important;
        transform: none !important;
    }
    .offcanvas-backdrop {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

@media (max-width: 1199.98px) {
    #navbarDesktop {
        display: none !important;
    }
}

/* Pagination SVG Constraints */
nav svg.w-5.h-5,
.pagination svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Master Hero Enterprise Dark Class */
.hero-enterprise-dark {
    position: relative;
    background-color: #070b14 !important;
    background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.18) 0%, transparent 40%),
                radial-gradient(circle at 80% 30%, rgba(16, 185, 129, 0.15) 0%, transparent 45%),
                radial-gradient(circle at 50% 90%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
                linear-gradient(135deg, #070b14 0%, #0c1424 50%, #070d18 100%) !important;
    color: #ffffff !important;
    overflow: hidden;
}

/* ==========================================================================
 * MASTER CONTRAST & ACCESSIBILITY SUBSYSTEM (WCAG AAA COMPLIANCE)
 * ========================================================================== */

/* 1. Contextual Inversion for Dark Sections & Glass Cards */
.hero-enterprise-dark,
.hero-psychology-dark,
.card-glass-dark,
.cockpit-glass-card,
.bg-dark,
.bg-ma-dark,
[data-bs-theme="dark"] {
    --ma-text: #ffffff;
    --ma-text-secondary: #e2e8f0;
    --ma-text-muted: #cbd5e1;
    color: #ffffff !important;
}

/* Dark Context Text Overrides */
.hero-enterprise-dark .text-muted,
.hero-psychology-dark .text-muted,
.card-glass-dark .text-muted,
.cockpit-glass-card .text-muted,
.bg-dark .text-muted,
.bg-ma-dark .text-muted,
[data-bs-theme="dark"] .text-muted {
    color: #cbd5e1 !important; /* Slate-300: High-contrast 9.8:1 */
}

.hero-enterprise-dark .text-secondary,
.hero-psychology-dark .text-secondary,
.card-glass-dark .text-secondary,
.cockpit-glass-card .text-secondary,
.bg-dark .text-secondary,
.bg-ma-dark .text-secondary,
[data-bs-theme="dark"] .text-secondary {
    color: #e2e8f0 !important; /* Slate-200 */
}

.hero-enterprise-dark .text-dark,
.hero-psychology-dark .text-dark,
.card-glass-dark .text-dark,
.bg-dark .text-dark,
.bg-ma-dark .text-dark,
[data-bs-theme="dark"] .text-dark {
    color: #ffffff !important;
}

.hero-enterprise-dark .breadcrumb-item a,
.hero-psychology-dark .breadcrumb-item a {
    color: #38bdf8 !important;
}

.hero-enterprise-dark .breadcrumb-item.active,
.hero-psychology-dark .breadcrumb-item.active {
    color: #cbd5e1 !important;
}

/* 2. Micro Text Sizes High-Contrast Boost */
.text-4xs {
    font-size: 0.6875rem !important;
    line-height: 1.3 !important;
}

.text-3xs {
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
}

.text-2xs {
    font-size: 0.8125rem !important;
    line-height: 1.4 !important;
}

/* 3. Global Slate Palette Utilities for High Contrast */
.bg-slate-950 { background-color: #020617 !important; color: #ffffff !important; }
.bg-slate-900 { background-color: #0f172a !important; color: #ffffff !important; }
.bg-slate-850 { background-color: #162032 !important; color: #ffffff !important; }
.bg-slate-800 { background-color: #1e293b !important; color: #ffffff !important; }
.bg-slate-700 { background-color: #334155 !important; color: #ffffff !important; }
.bg-slate-100 { background-color: #f1f5f9 !important; }
.bg-slate-50  { background-color: #f8fafc !important; }

.border-slate-800 { border-color: #1e293b !important; }
.border-slate-700 { border-color: #334155 !important; }
.border-slate-600 { border-color: #475569 !important; }
.border-slate-200 { border-color: #e2e8f0 !important; }

.text-slate-100 { color: #f1f5f9 !important; }
.text-slate-200 { color: #e2e8f0 !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-800 { color: #1e293b !important; }
.text-slate-900 { color: #0f172a !important; }

/* 4. Table Header Contrast Across All Tables */
.table thead th,
.table-light th,
th {
    color: #1e293b !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

.text-secondary {
    color: #334155 !important; /* Slate-700 */
}

.text-dark {
    color: #0f172a !important; /* Slate-900 */
}

/* 4. Table Header High Contrast */
.table thead th,
table thead th {
    color: #1e293b !important;
    font-weight: 700 !important;
}
