/**
 * Page Components & Performance Optimizations
 * Ibn Khaldoun Schools Excellence System
 * Version 2.1 - Enhanced Performance & Dark Mode
 */

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
:root {
    --color-scheme: light;
}

[data-theme="dark"] {
    --color-scheme: dark;
    /* Variable overrides are in design-system.css [data-theme="dark"] block */
}

[data-theme="dark"] .card,
[data-theme="dark"] .excellence-card,
[data-theme="dark"] .admin-panel,
[data-theme="dark"] .table-container {
    background: var(--bg-secondary);
    border-color: var(--neutral-200);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: var(--bg-tertiary);
    border-color: var(--neutral-300);
    color: var(--neutral-800);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: #ffffff !important;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* ============================================
   LANGUAGE TOGGLE BUTTON
   ============================================ */
.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.lang-toggle svg {
    width: 20px;
    height: 20px;
    fill: #ffffff !important;
}

.lang-toggle .lang-icon {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 0;
    font-family: 'Cairo', 'Segoe UI', Arial, sans-serif;
}

/* LTR (English) Layout Adjustments */
[dir="ltr"] .nav-container {
    flex-direction: row;
}

[dir="ltr"] .user-info {
    text-align: left;
}

[dir="ltr"] .nav-title-group {
    text-align: left;
}

[dir="ltr"] .user-menu {
    flex-direction: row;
}

[dir="ltr"] .back-link:hover,
[dir="ltr"] .back-btn:hover {
    transform: translateX(-4px);
}

/* RTL specific adjustments */
[dir="rtl"] .back-link svg,
[dir="rtl"] .back-btn svg {
    transform: scaleX(-1);
}

@media (max-width: 768px) {
    .lang-toggle {
        width: 44px;
        height: 44px;
    }

    .lang-toggle .lang-icon {
        font-size: 0.75rem;
    }
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--neutral-200) 25%,
        var(--neutral-100) 50%,
        var(--neutral-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

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

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text-sm {
    height: 0.75em;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-xl);
}

.skeleton-table-row {
    height: 48px;
    margin-bottom: 8px;
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: var(--radius-lg);
}

/* Skeleton Card Component */
.skeleton-card-full {
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
}

.skeleton-card-full .skeleton-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    border-radius: var(--radius-2xl);
}

.skeleton-card-full .skeleton-title {
    height: 24px;
    width: 70%;
    margin: 0 auto var(--space-3);
}

.skeleton-card-full .skeleton-desc {
    height: 16px;
    width: 90%;
    margin: 0 auto var(--space-2);
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Skip Link for Screen Readers */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-600);
    color: white;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    z-index: 9999;
    text-decoration: none;
    font-weight: var(--font-semibold);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* Enhanced Focus Styles */
:focus-visible {
    outline: 3px solid var(--primary-500);
    outline-offset: 3px;
}

.btn:focus-visible,
.nav-btn:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid var(--primary-300);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .btn:focus-visible,
[data-theme="dark"] .nav-btn:focus-visible,
[data-theme="dark"] .nav-link:focus-visible {
    outline-color: var(--primary-400);
    box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.3);
}

/* Clickable div keyboard focus styling */
div[role="button"]:focus-visible {
    outline: 3px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: 8px;
}

[data-theme="dark"] div[role="button"]:focus-visible {
    outline-color: var(--primary-400);
    box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.3);
}

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

    .skeleton {
        animation: none;
        background: var(--neutral-200);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-500: #0047ab;
        --secondary-500: #006400;
        --error: #cc0000;
    }

    .btn, .card, .badge {
        border: 2px solid currentColor;
    }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   PAGE LAYOUT COMPONENTS
   ============================================ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.main-content {
    flex: 1;
    padding: var(--space-12) var(--space-6);
    max-width: var(--container-xl);
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--space-6) var(--space-4);
    }
}

/* ============================================
   NAVIGATION HEADER
   ============================================ */
.nav-header,
.nav-header-dark {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #172554 100%) !important;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nav-header,
[data-theme="dark"] .nav-header-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #020617 100%) !important;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-logo {
    width: 60px;
    height: 60px;
    background: #ffffff !important;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.6) !important;
}

.nav-logo svg {
    width: 36px;
    height: 36px;
    fill: #1e40af !important;
}

.nav-title-group {
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.nav-title {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    margin-bottom: 6px;
    letter-spacing: 1px;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.nav-subtitle {
    font-size: 1rem !important;
    color: #bfdbfe !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* User Menu */
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 50px;
    color: #ffffff !important;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.35) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
    fill: #ffffff !important;
}

.user-info {
    display: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

@media (min-width: 640px) {
    .user-info {
        display: block;
        text-align: right;
    }
}

.user-name {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.user-role {
    font-size: 0.85rem !important;
    color: #60a5fa !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.admin-badge {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    color: #1e293b;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: none;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.nav-btn.danger {
    background: rgba(239, 68, 68, 0.4) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
}

.nav-btn.danger:hover {
    background: rgba(239, 68, 68, 0.6) !important;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    fill: #ffffff !important;
}

@media (max-width: 768px) {
    .nav-actions .nav-btn span {
        display: none;
    }

    .nav-btn {
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
    }

    .nav-container {
        padding: 12px 16px;
    }

    .nav-logo {
        width: 50px;
        height: 50px;
    }

    .nav-logo svg {
        width: 28px;
        height: 28px;
    }

    .nav-title {
        font-size: 1.25rem;
    }

    .nav-subtitle {
        font-size: 0.8rem;
    }

    .user-menu {
        padding: 8px 12px;
    }

    .user-avatar {
        width: 38px;
        height: 38px;
    }

    .theme-toggle {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   UNIFIED HEADER WITH LOGOS
   ============================================ */
.unified-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .unified-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.unified-header-container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

/* Logos Section */
.header-logos {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast);
}

.logo-wrapper:hover {
    transform: scale(1.05);
}

.logo-wrapper img,
.logo-wrapper svg {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.logo-maarif {
    padding: var(--space-2) var(--space-3);
}

.logo-school {
    padding: var(--space-1);
}

.logo-divider {
    width: 2px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

/* Header Title Section */
.header-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-1);
}

.header-main-title {
    color: white;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-page-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin: 0;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: rgba(255, 255, 255, 0.15);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: white;
    backdrop-filter: blur(4px);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    color: white;
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.header-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.header-btn.btn-home {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.header-btn.btn-home:hover {
    background: rgba(16, 185, 129, 0.35);
}

.header-btn.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.header-btn.btn-logout:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* User Info in Header */
.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.header-user-info {
    display: none;
    text-align: right;
    color: white;
}

@media (min-width: 768px) {
    .header-user-info {
        display: block;
    }
}

.header-user-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.header-user-role {
    font-size: var(--text-xs);
    opacity: 0.8;
}

/* Theme Toggle in Unified Header */
.unified-header .theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.unified-header .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive Unified Header */
@media (max-width: 1024px) {
    .header-title-section {
        display: none;
    }

    .unified-header-container {
        padding: var(--space-3) var(--space-4);
    }
}

@media (max-width: 768px) {
    .header-logos {
        gap: var(--space-2);
    }

    .logo-wrapper img,
    .logo-wrapper svg {
        height: 35px;
    }

    .logo-divider {
        height: 30px;
    }

    .header-btn span {
        display: none;
    }

    .header-btn {
        padding: var(--space-2);
    }

    .header-actions {
        gap: var(--space-1);
    }
}

@media (max-width: 480px) {
    .logo-maarif {
        display: none;
    }

    .logo-divider {
        display: none;
    }
}

/* ============================================
   PAGE HEADER (Legacy - Keep for compatibility)
   ============================================ */
.page-header {
    background: var(--bg-gradient-primary);
    padding: var(--space-5) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.header-container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.header-title {
    color: white;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin: 0;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-sm);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.back-link,
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    color: white;
    font-weight: var(--font-medium);
    transition: all var(--transition-base);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--text-sm);
}

.back-link:hover,
.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateX(4px);
}

.back-link svg,
.back-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Theme Toggle in Page Header */
.page-header .theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.page-header .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .header-title {
        font-size: var(--text-xl);
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .back-link span,
    .back-btn span {
        display: none;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 100%);
    padding: var(--space-16) var(--space-6);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--container-xl);
    margin: 0 auto;
    text-align: center;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-4);
    color: white;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: var(--text-5xl);
    }
}

.hero-description {
    font-size: var(--text-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    color: white;
}

@media (max-width: 768px) {
    .hero-gradient {
        padding: var(--space-10) var(--space-4);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-description {
        font-size: var(--text-base);
    }
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-panel {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    margin-bottom: var(--space-10);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--neutral-100);
}

.admin-panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--neutral-100);
}

.admin-panel-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-panel-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.admin-panel-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--neutral-900);
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
}

.admin-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--neutral-700);
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.admin-action-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-700);
}

.admin-action-btn:hover svg {
    fill: var(--primary-600);
}

.admin-action-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--neutral-500);
    transition: fill var(--transition-fast);
}

/* ============================================
   EXCELLENCE CARDS
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.excellence-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--neutral-100);
    transition: all var(--transition-slow);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.excellence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-gradient-primary);
    transition: height var(--transition-base);
}

.excellence-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.excellence-card:hover::before {
    height: 6px;
}

.excellence-card:hover .card-icon {
    transform: scale(1.1);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    background: var(--bg-gradient-primary);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.card-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--neutral-900);
    margin-bottom: var(--space-3);
}

.card-description {
    color: var(--neutral-500);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
}

.card-features {
    text-align: right;
    padding: var(--space-4);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    list-style: none;
}

.card-features li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--neutral-600);
    border-bottom: 1px solid var(--neutral-200);
}

.card-features li:last-child {
    border-bottom: none;
}

.card-features li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-500);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-8);
    background: var(--bg-gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
}

.excellence-card:hover .card-button {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* Card Variants */
.supervisor-card::before {
    background: linear-gradient(90deg, var(--purple-500) 0%, var(--purple-600) 100%);
}

.supervisor-card .card-icon {
    background: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-600) 100%);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.supervisor-card .card-features li::before {
    background: var(--purple-500);
}

.supervisor-card .card-button {
    background: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-600) 100%);
}

.supervisor-card:hover .card-button {
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

@media (max-width: 768px) {
    .excellence-card {
        padding: var(--space-6);
    }

    .card-icon {
        width: 64px;
        height: 64px;
    }

    .card-icon svg {
        width: 32px;
        height: 32px;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: var(--space-8) var(--space-6);
    text-align: center;
}

.footer-content {
    max-width: var(--container-xl);
    margin: 0 auto;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.footer-text {
    color: var(--neutral-400);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.footer-copyright {
    color: var(--neutral-500);
    font-size: var(--text-xs);
    padding-top: var(--space-4);
    border-top: 1px solid var(--neutral-800);
}

/* ============================================
   LOGIN PAGE SPECIFIC
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Floating Shapes */
.shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    animation: float 20s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.shape:nth-child(2) {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 50%;
    right: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease both;
}

.excellence-card:nth-child(1) { animation: fadeInUp 0.5s ease 0.1s both; }
.excellence-card:nth-child(2) { animation: fadeInUp 0.5s ease 0.2s both; }
.excellence-card:nth-child(3) { animation: fadeInUp 0.5s ease 0.3s both; }

/* ============================================
   LOADING OVERLAY
   ============================================ */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s, visibility 0.3s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--neutral-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loader-text {
    margin-top: var(--space-4);
    color: var(--neutral-600);
    font-size: var(--text-sm);
}

/* ============================================
   TOAST NOTIFICATION ENHANCEMENTS
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    pointer-events: auto;
    animation: toast-in 0.3s ease;
    border-right: 4px solid var(--primary-500);
}

@keyframes toast-in {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-success { border-right-color: var(--success); }
.toast-error { border-right-color: var(--error); }
.toast-warning { border-right-color: var(--warning); }
.toast-info { border-right-color: var(--info); }

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Use GPU acceleration for animations */
.excellence-card,
.card-icon,
.btn,
.nav-btn,
.modal {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize rendering */
.nav-header,
.sidebar,
.footer {
    contain: layout style;
}

/* Lazy load images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* ============================================
   UNIFIED HEADER COMPONENT
   ============================================ */

.unified-header {
    background: var(--bg-gradient-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.unified-header .header-container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.unified-header .header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: white;
}

.unified-header .header-logo {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.unified-header .header-logo svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.unified-header .header-title h1 {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: white;
    margin: 0;
}

.unified-header .header-title span {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.85);
}

.unified-header .header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.unified-header .nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.unified-header .nav-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.unified-header .nav-item:hover,
.unified-header .nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.unified-header .nav-item.login-btn {
    background: white;
    color: var(--primary-700);
    font-weight: var(--font-bold);
}

.unified-header .nav-item.login-btn:hover {
    background: var(--neutral-100);
    transform: translateY(-1px);
}

.unified-header .mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.unified-header .mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-base);
}

@media (max-width: 768px) {
    .unified-header .header-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--primary-800);
        flex-direction: column;
        padding: var(--space-4);
        gap: var(--space-2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all var(--transition-base);
    }

    .unified-header .header-nav.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .unified-header .mobile-menu-btn {
        display: flex;
    }

    .unified-header .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .unified-header .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .unified-header .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .unified-header .nav-item {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   UNIFIED FOOTER COMPONENT
   ============================================ */

.unified-footer {
    background: var(--neutral-900);
    color: white;
    padding: var(--space-10) var(--space-4);
}

.unified-footer .footer-container {
    max-width: var(--container-xl);
    margin: 0 auto;
}

.unified-footer .footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 768px) {
    .unified-footer .footer-content {
        grid-template-columns: 2fr 3fr;
    }
}

.unified-footer .footer-brand {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.unified-footer .footer-logo {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unified-footer .footer-logo svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.unified-footer .footer-brand h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.unified-footer .footer-brand p {
    color: var(--neutral-400);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.unified-footer .footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

@media (max-width: 600px) {
    .unified-footer .footer-links {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.unified-footer .footer-col h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
    color: white;
}

.unified-footer .footer-col nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.unified-footer .footer-col a {
    color: var(--neutral-400);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.unified-footer .footer-col a:hover {
    color: white;
}

.unified-footer .footer-bottom {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--neutral-800);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.unified-footer .footer-copyright {
    color: var(--neutral-500);
    font-size: var(--text-sm);
    margin: 0;
}

.unified-footer .footer-social {
    display: flex;
    gap: var(--space-3);
}

.unified-footer .footer-social a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
    transition: all var(--transition-fast);
}

.unified-footer .footer-social a:hover {
    background: var(--primary-600);
    color: white;
}

.unified-footer .footer-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================
   MODAL COMPONENT
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-small { width: 100%; max-width: 400px; }
.modal-medium { width: 100%; max-width: 560px; }
.modal-large { width: 100%; max-width: 800px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--neutral-200);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--neutral-200);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    fill: var(--neutral-600);
}

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */

.confirm-content {
    text-align: center;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.confirm-info {
    background: var(--primary-100);
    color: var(--primary-700);
}

.confirm-warning {
    background: var(--accent-100);
    color: var(--accent-700);
}

.confirm-danger {
    background: var(--error-light);
    color: var(--error);
}

.confirm-message {
    font-size: var(--text-base);
    color: var(--neutral-700);
    margin-bottom: var(--space-5);
}

.confirm-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 100px;
}

/* ============================================
   LOADING OVERLAY COMPONENT
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--neutral-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-4);
}

.loading-text {
    color: var(--neutral-600);
    font-size: var(--text-base);
    margin: 0;
}

/* ============================================
   SCROLL REVEAL ANIMATION
   ============================================ */

.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for multiple items */
.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.6s; }
