/* ======================================
   Hirassa - نظام حراسة الامتحانات
   التصميم الرئيسي - Premium Dark Theme
   ====================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #ec4899;
    --secondary-light: #f472b6;
    --accent: #4ade80;
    --accent-light: #86efac;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --success: #10b981;

    /* Dark Theme */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.08);
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #a78bfa;

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    --gradient-accent: linear-gradient(135deg, #4ade80 0%, #22d3ee 100%);
    --gradient-dark: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--glass-border);

    /* Typography */
    --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --font-en: 'Inter', 'Segoe UI', sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: scroll;
}

body {
    font-family: var(--font-ar);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

[dir="ltr"] body {
    font-family: var(--font-en);
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--text-accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== Animated Background ===== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: var(--bg-primary);
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float-bg 20s ease-in-out infinite;
}

.animated-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    animation: float-bg 25s ease-in-out infinite reverse;
}

@keyframes float-bg {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -50px) scale(1.1); }
    66% { transform: translate(-50px, 100px) scale(0.9); }
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* ===== Header / Navbar ===== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-menu a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-menu a.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; width: 40px; height: 40px; }

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-base);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(99, 102, 241, 0.05);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

[dir="ltr"] select.form-control {
    background-position: right 12px center;
    padding-left: 16px;
    padding-right: 36px;
}

select.form-control option {
    background-color: var(--bg-secondary, #1e1e38);
    color: var(--text-primary, #ffffff);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .form-control:last-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

[dir="ltr"] .input-group .form-control:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
[dir="ltr"] .input-group .form-control:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.input-group-text {
    padding: 0 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--glass-border);
}

[dir="ltr"] th { text-align: left; }

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    color: var(--text-primary);
}

tr:hover td {
    background: var(--bg-hover);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--info); }
.badge-secondary { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }

/* Badge for replacement highlight */
.badge-replacement {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* ===== Alerts ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--accent); }
.alert-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--warning); }
.alert-info { background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.2); color: var(--info); }

.alert-close {
    margin-right: auto;
    cursor: pointer;
    opacity: 0.7;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
}

[dir="ltr"] .alert-close { margin-right: 0; margin-left: auto; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 24px;
    position: relative;
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.25), var(--shadow-card);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    opacity: 0.06;
    border-radius: 50%;
    transition: transform var(--transition-slow);
}

.stat-card:hover::before {
    transform: scale(1.3);
}

[dir="ltr"] .stat-card::before {
    right: auto;
    left: -20px;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
    transition: transform var(--transition-base);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
    background: #ffffff;
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
    transform-origin: right;
}

.stat-card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Individual card hover styles based on child index */
.stat-card:nth-child(2):hover {
    border-color: rgba(245, 158, 11, 0.35) !important;
    box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.25), var(--shadow-card);
}
.stat-card:nth-child(2):hover::after {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card:nth-child(3):hover {
    border-color: rgba(74, 222, 128, 0.35) !important;
    box-shadow: 0 10px 30px -10px rgba(74, 222, 128, 0.25), var(--shadow-card);
}
.stat-card:nth-child(3):hover::after {
    background: var(--gradient-accent);
}

.stat-card:nth-child(4):hover {
    border-color: rgba(236, 72, 153, 0.35) !important;
    box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.25), var(--shadow-card);
}
.stat-card:nth-child(4):hover::after {
    background: var(--gradient-secondary);
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: var(--primary-light);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ===== News Ticker ===== */
.news-ticker {
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 0;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ticker-label {
    background: var(--gradient-primary);
    color: white;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-track {
    overflow: hidden;
    flex: 1;
}

.ticker-items {
    display: flex;
    animation: ticker-scroll-ltr 30s linear infinite; /* Arabic (RTL) scrolls from left to right */
    white-space: nowrap;
}

.ticker-items:hover {
    animation-play-state: paused;
}

.ticker-item {
    padding: 0 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ticker-item::before {
    content: '◆';
    color: var(--primary);
    margin-left: 8px;
}

[dir="ltr"] .ticker-item::before {
    margin-left: 0;
    margin-right: 8px;
}

@keyframes ticker-scroll {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

[dir="ltr"] .ticker-items {
    animation: ticker-scroll 30s linear infinite; /* French/English (LTR) scrolls from right to left */
}

@keyframes ticker-scroll-ltr {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 40px 0 0;
    margin-top: 60px;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-item .val {
    font-weight: 700;
    color: var(--text-primary);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.social-icons a {
    transition: var(--transition-base);
}

.social-icons a:hover {
    transform: translateY(-3px);
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.copyright-strip {
    border-top: 1px solid var(--glass-border);
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

.dev-name {
    color: var(--primary-light);
    font-weight: 600;
}

/* ===== Language Switcher ===== */
.language-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 3px;
    border: 1px solid var(--glass-border);
}

.lang-option {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.lang-option:hover {
    color: var(--text-primary);
}

.lang-option.active {
    background: var(--gradient-primary);
    color: white;
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 70px;
    height: 70px;
    font-size: 28px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
}

.auth-logo h1 {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== User Avatar ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
}

.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.avatar-lg.avatar-placeholder { font-size: 1.5rem; }
.avatar-xl.avatar-placeholder { font-size: 2rem; }

/* ===== Notification Bell ===== */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

[dir="rtl"] .dropdown-menu { left: auto; right: 0; }

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 0;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-base);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    transition: var(--transition-fast);
}

.pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary-light);
}

.pagination .active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
}

/* ===== Loading Spinner ===== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 99999;
    color: var(--text-secondary);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[dir="ltr"] .toast-container { left: auto; right: 20px; }

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.4s ease;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

[dir="ltr"] .toast {
    animation-name: slideInRtl;
}

@keyframes slideInRtl {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ===== Footer Improvements ===== */
.footer-col.about-col p {
    text-align: justify;
}
.social-icons a:hover {
    background: var(--gradient-primary) !important;
    border-color: transparent !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.contact-list li i {
    color: var(--primary-light);
}

/* ===== Print Styles ===== */
@media print {
    .main-header, .site-footer, .no-print, .btn, .sidebar {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .glass-card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    table { font-size: 10pt; }
    th { background: #f0f0f0; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--glass-border);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.3rem;
        cursor: pointer;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        gap: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px;
    }

    .container {
        padding: 0 16px;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.2rem;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .copyright-strip {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary { color: var(--primary-light); }
.text-success { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.3rem; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.d-block { display: block; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.shadow { box-shadow: var(--shadow-md); }
.border { border: 1px solid var(--glass-border); }

.animate-fade {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

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

/* Mobile menu toggle - hidden by default */
.mobile-menu-toggle {
    display: none;
}

/* ===== Guard Schedule Colors ===== */
.guard-main { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.guard-normal { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
.guard-reserve { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.guard-replacement { 
    background: rgba(236, 72, 153, 0.15); 
    color: var(--secondary-light);
    border: 1px dashed var(--secondary);
}
.guard-absent { background: rgba(239, 68, 68, 0.1); color: var(--danger); text-decoration: line-through; }
.guard-exempt { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); font-style: italic; }
.guard-extra { background: rgba(6, 182, 212, 0.15); color: var(--info); }

/* ===== Modal Overlay Overrides ===== */
.modal-overlay,
.modal-overlay h3,
.modal-overlay h4,
.modal-overlay label,
.modal-overlay p,
.modal-overlay td,
.modal-overlay th {
    color: var(--text-primary) !important;
}

.modal-overlay label.form-label {
    color: var(--text-secondary) !important;
}

.modal-overlay input.form-control,
.modal-overlay select.form-control,
.modal-overlay textarea.form-control {
    color: var(--text-primary) !important;
    background-color: #1a1a2e !important;
    border: 1px solid var(--glass-border) !important;
}

.modal-overlay input.form-control:focus,
.modal-overlay select.form-control:focus,
.modal-overlay textarea.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Force dark background for dropdown options inside select */
.modal-overlay select.form-control option {
    background-color: #1a1a2e !important;
    color: #f1f5f9 !important;
}

.modal-overlay select.form-control {
    background-color: #1a1a2e !important;
    color: #f1f5f9 !important;
}

.modal-overlay .btn-ghost {
    color: var(--text-secondary) !important;
}

.modal-overlay .btn-ghost:hover {
    color: var(--text-primary) !important;
}

/* Autofill fixes in Chrome/Webkit */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #16213e inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

/* ===== Print Styles Overrides ===== */
@media print {
    /* Force white background and black text globally */
    * {
        background: transparent !important;
        background-color: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    html, body {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        font-family: 'Cairo', 'Inter', 'Times New Roman', sans-serif !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Hide UI controls */
    .no-print, 
    .main-header, 
    .site-footer, 
    .news-ticker, 
    .footer, 
    footer, 
    .report-tabs, 
    .alert, 
    .page-header, 
    .btn, 
    .mobile-menu-toggle, 
    #search-input, 
    #filter-status, 
    #filter-category, 
    #filter-institution,
    .modal-overlay,
    .header-actions,
    .no-print * {
        display: none !important;
    }

    /* Format main content area to full width and no background */
    .main-content, .container, .glass-card, .table-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
        box-shadow: none !important;
    }

    /* Professional table borders and colors */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        page-break-inside: auto !important;
    }
    
    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    th, td {
        border: 1px solid #000000 !important;
        padding: 8px 6px !important;
        text-align: center !important;
        color: #000000 !important;
        font-size: 10pt !important;
        background: transparent !important;
        background-color: transparent !important;
    }

    th {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: bold !important;
    }

    /* Hide buttons and interactive controls inside tables */
    table td .btn, table td button, table td form {
        display: none !important;
    }

    /* Override badged texts for printing */
    .badge {
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
        padding: 0 !important;
        font-weight: bold !important;
        font-size: 10pt !important;
    }

    /* Handle page breaks properly */
    .page-break {
        page-break-after: always !important;
        break-after: page !important;
    }

    /* Individual schedules grid styling for print */
    .individual-cards-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
    .individual-card {
        border: 2px dashed #000000 !important;
        padding: 15px !important;
        border-radius: 8px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
    }
    
    .individual-card h4 {
        margin: 0 0 10px 0 !important;
        font-size: 12pt !important;
        border-bottom: 1px solid #cccccc !important;
        padding-bottom: 5px !important;
    }

    /* Technical Card Layout adjustments for print */
    .tech-card-container {
        padding: 0 !important;
        max-width: 100% !important;
    }
}
