/* إجتياز - Ejtiaz - Unified Navy Professional Visual Identity */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* Primary Navy Colors */
    --primary: #0F2747;
    --primary-hover: #091C33;
    --primary-dark: #091C33;
    --primary-light: #2563EB;
    --primary-soft: #e0f2fe;
    --primary-pale: #f0f9ff;

    /* Brand Navy Hierarchy */
    --brand-navy: #0F2747;
    --brand-navy-2: #091C33;
    --brand-navy-3: #243447;

    /* Backgrounds */
    --bg: #F7F5F0;
    --background: #F7F5F0;
    --surface: #FFFFFF;
    --surface-soft: #F7F5F0;
    --surface-blue: #e0f2fe;

    /* Text Colors */
    --text-primary: #243447;
    --text: #243447;
    --text-secondary: #667085;
    --text-muted: #667085;

    /* Border Colors */
    --border: #E5E1D8;
    --border-soft: #E5E1D8;
    --border-accent: rgba(37, 99, 235, .28);
    --border-focus: #2563EB;

    /* Status Colors */
    --success: #16805C;
    --success-light: #d1fae5;
    --warning: #C59B3A;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    /* Compatibility Variables */
    --color-base: var(--background);
    --color-surface: var(--surface);
    --color-primary: var(--primary);
    --color-accent: var(--primary-hover);
    --color-text: var(--text-primary);
    --color-text-muted: var(--text-secondary);
    --color-border: var(--border);

    /* Radius */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-xs: 0 3px 10px rgba(15, 39, 71, .05);
    --shadow-sm: 0 8px 22px rgba(15, 39, 71, .08);
    --shadow-md: 0 15px 35px rgba(15, 39, 71, .11);
    --shadow-lg: 0 22px 55px rgba(15, 39, 71, .15);
    --shadow-blue: 0 8px 22px rgba(37, 99, 235, .24);

    /* Transitions */
    --transition-fast: .2s cubic-bezier(.4, 0, .2, 1);
    --transition-smooth: .3s cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { direction: rtl; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    background-color: var(--background);
    background-image:
        radial-gradient(circle at 8% 8%, rgba(37, 99, 235, .15), transparent 25%),
        radial-gradient(circle at 92% 85%, rgba(15, 39, 71, .10), transparent 30%);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    font-family: "Cairo", "Tajawal", sans-serif;
    line-height: 1.7;
}

button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
img { max-width: 100%; }
::selection { color: #fff; background: var(--primary-dark); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #eaf6fc; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary-light), var(--primary-dark)); border-radius: 999px; }

.btn {
    min-height: 42px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: #fff;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    box-shadow: var(--shadow-blue);
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 13px 30px rgba(37, 99, 235, .3);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.btn:active { transform: translateY(0); }
.btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
}
.btn-primary:hover {
    color: #fff !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.btn-outline {
    color: var(--primary) !important;
    background: rgba(255, 255, 255, .95);
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
    color: #fff !important;
    background: var(--primary);
    border-color: var(--primary);
}
.btn-secondary {
    color: #fff;
    background: rgba(15, 39, 71, .78);
    border-color: rgba(229, 225, 216, .35);
}
.btn-secondary:hover {
    background: rgba(15, 39, 71, .88);
    border-color: rgba(229, 225, 216, .5);
}
.btn-sm { min-height: 38px; padding: 8px 14px; border-radius: 10px; font-size: .8rem; }
.btn-full { width: 100%; }
.mt-10 { margin-top: 10px !important; }
.mt-20 { margin-top: 20px !important; }

/* فئة خاصة لأزرار تسجيل الخروج لتحسين التباين */
.btn-logout {
    color: #ffffff !important;
    background: rgba(239, 68, 68, 0.9) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 1) !important;
    border-color: rgba(239, 68, 68, 1) !important;
    color: #ffffff !important;
}

.btn-logout.btn-outline {
    color: #ef4444 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #ef4444 !important;
}

.btn-logout.btn-outline:hover {
    color: #ffffff !important;
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}

.card, .course-card, .info-card, .form-box, .content-card, .section-card, .panel, .modal-content {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: var(--shadow-sm) !important;
}
.card:hover, .course-card:hover, .info-card:hover { border-color: #E5E1D8 !important; box-shadow: var(--shadow-md) !important; }

input:not([type="checkbox"]):not([type="radio"]), textarea, select, .form-input, .input-field {
    color: var(--text-primary);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
input::placeholder, textarea::placeholder, .input-field::placeholder, .form-input::placeholder {
    color: #64748b;
    opacity: 1;
}
input:focus, textarea:focus, select:focus, .form-input:focus, .input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .18);
}

.main-header {
    min-height: 72px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .9) !important;
    border-bottom: 1px solid rgba(229, 225, 216, .85) !important;
    box-shadow: 0 6px 24px rgba(15, 39, 71, .07) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.header-logo { max-width: 180px; }
.main-header > .header-logo { width: auto; height: 44px; object-fit: contain; }
.main-header > .btn { flex: 0 0 auto; }
.main-header > .menu-toggle { display: none; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--brand-navy); background: var(--surface-soft); cursor: pointer; }
.css-logo { color: var(--brand-navy) !important; font-weight: 900; }
.css-logo-icon { background: linear-gradient(145deg, var(--primary-light), var(--primary-dark)) !important; box-shadow: 0 8px 18px rgba(14, 165, 233, .28); }

.dashboard-container { min-height: calc(100vh - 76px); }

/* Sidebar styling removed to allow custom styling per page */
/* Legacy dark sidebar styles preserved for backward compatibility */
.sidebar.dark-theme {
    background: linear-gradient(165deg, #0F2747 0%, #091C33 52%, #243447 100%) !important;
    border: 0 !important;
    box-shadow: 12px 0 35px rgba(15, 39, 71, .12) !important;
}
.sidebar.dark-theme .user-info { border-color: rgba(229, 225, 216, .22) !important; }
.sidebar.dark-theme .user-info h3, .sidebar.dark-theme h3 { color: #fff !important; }
.sidebar.dark-theme .sidebar-nav a { color: #d8f1fc !important; border-color: transparent !important; }
.sidebar.dark-theme .sidebar-nav a:hover, .sidebar.dark-theme .sidebar-nav a.active { color: #fff !important; background: rgba(37, 99, 235, .2) !important; border-color: rgba(229, 225, 216, .22) !important; }
.sidebar.dark-theme .sidebar-nav a svg, .sidebar.dark-theme button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar.dark-theme .btn { color: #fff; background: rgba(255, 255, 255, .11); border-color: rgba(229, 225, 216, .28); }
.sidebar.dark-theme .btn:hover { background: var(--primary-light); border-color: var(--primary-light); }

/* تحسين أزرار تسجيل الخروج في القوائم الجانبية */
.sidebar .btn#btn-admin-logout,
.sidebar .btn#btn-supervisor-logout {
    color: #ffffff !important;
    background: rgba(239, 68, 68, 0.9) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
}

.sidebar .btn#btn-admin-logout:hover,
.sidebar .btn#btn-supervisor-logout:hover {
    background: rgba(239, 68, 68, 1) !important;
    border-color: rgba(239, 68, 68, 1) !important;
    color: #ffffff !important;
}

.hero, .hero-section, .welcome-section, #ejtiaz-hero-section {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.page-title, .section-title, .content-title, .card h1, .card h2, .card h3 { color: var(--brand-navy); }
.progress-bar, .level-bar { background: var(--surface-soft); }
.progress-bar-fill, .level-fill { background: linear-gradient(90deg, var(--primary-light), var(--primary)); }
.badge, .status-badge, .subscribed-badge { border-radius: var(--radius-pill); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(56, 189, 248, .35); outline-offset: 3px; }

@media (max-width: 860px) {
    .main-content { width: 100%; margin-right: 0; }
    .sidebar { max-width: 88vw; }
}
@media (max-width: 640px) {
    .main-header { min-height: 64px; padding: 10px 14px; gap: 10px; }
    .main-header > .header-logo { height: 36px; max-width: 140px; }
    .main-header > .btn { min-height: 38px; max-width: 52vw; padding: 8px 11px; font-size: .76rem; white-space: nowrap; }
    .main-header > .menu-toggle { display: inline-flex; }
    .main-content { padding: 16px 13px 30px; }
    .card, .course-card, .info-card, .form-box, .content-card, .section-card, .panel { border-radius: 17px !important; }
    .btn { min-height: 40px; padding: 9px 13px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

