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

/* ============================================================
   SXproWeb — Unified Premium Design System
   ============================================================ */

:root {
    /* ── Color Palette ── */
    --bg-body: #f0f2f7;
    --surface: #ffffff;
    --surface-hover: #f7f8fb;
    --surface-border: #e8ecf3;
    --surface-muted: #f4f6fa;

    --text-primary: #1a1d2e;
    --text-secondary: #5a6178;
    --text-muted: #5c6379;
    --text-inverse: #ffffff;

    --brand-primary: #5b5fc7;
    --brand-primary-hover: #4a4eb5;
    --brand-primary-light: rgba(91, 95, 199, 0.08);
    --brand-primary-glow: rgba(91, 95, 199, 0.15);

    --brand-accent: #3b82f6;
    --brand-accent-light: rgba(59, 130, 246, 0.08);

    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;
    --color-danger: #ef4444;
    --color-danger-light: #fef2f2;
    --color-info: #3b82f6;
    --color-info-light: #eff6ff;

    /* ── Spacing & Radius ── */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* ── Shadows ── */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.05);

    /* ── Transition ── */
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* ── Legacy aliases (for backward compatibility) ── */
    --bg-dark: var(--bg-body);
    --primary-color: var(--brand-primary);
    --accent-color: var(--brand-accent);
    --text-main: var(--text-primary);
    --success-color: var(--color-success);
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { padding-top: 100px; }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cad6; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a0a7b8; }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(15px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.fade-in { animation: fadeInUp 0.45s ease-out forwards; }
.fade-in-delay-1 { animation: fadeInUp 0.45s ease-out 0.1s forwards; opacity: 0; }
.fade-in-delay-2 { animation: fadeInUp 0.45s ease-out 0.2s forwards; opacity: 0; }
.fade-in-delay-3 { animation: fadeInUp 0.45s ease-out 0.3s forwards; opacity: 0; }

/* ── Cards ── */
.glass {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}
.glass:hover {
    box-shadow: var(--shadow-md);
}

/* ── Typography ── */
.text-glow {
    text-shadow: none !important;
    color: var(--text-primary);
    font-weight: 800;
}
.text-vibrant { color: var(--brand-accent); }
.text-brand   { color: var(--brand-primary); }
.text-muted   { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

/* ── Buttons ── */
.btn-premium {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(91, 95, 199, 0.2);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
}
.btn-premium:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 16px rgba(91, 95, 199, 0.3);
    transform: translateY(-1px);
}
.btn-premium:active { transform: translateY(0); }

.btn-outline {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    border: 1.5px solid var(--surface-border);
    color: var(--text-secondary);
    background: var(--surface);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
}
.btn-outline:hover {
    background: var(--surface-hover);
    border-color: #cdd3e0;
    color: var(--text-primary);
}

.btn-danger-outline {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    color: var(--color-danger);
    background: var(--surface);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-danger-outline:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--surface-border);
}
th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-muted);
}
tr { transition: var(--transition-fast); }
tr:hover { background: var(--surface-hover); }

/* ── Form Controls ── */
.form-control, .form-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface);
    border: 1.5px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition-smooth);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-light);
}
.form-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

/* Placeholder styling for improved accessibility */
::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.85 !important;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}
.status-badge.active   { background: var(--color-success-light); color: #059669; }
.status-badge.expired  { background: var(--color-danger-light);  color: #dc2626; }
.status-badge.pending  { background: var(--color-warning-light); color: #b45309; }
.status-badge.info     { background: var(--color-info-light);    color: #1d4ed8; }

/* ── Alert Banners ── */
.alert-banner {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-banner.success { background: var(--color-success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-banner.error   { background: var(--color-danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-banner.warning { background: var(--color-warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-banner.info    { background: var(--color-info-light);    color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Stat Cards ── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brand-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: var(--transition-smooth);
}
.stat-card:hover::after { opacity: 1; }

.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: 18px;
}
.stat-card .stat-icon.purple  { background: rgba(91,95,199,0.1); color: #5b5fc7; }
.stat-card .stat-icon.blue    { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-card .stat-icon.green   { background: rgba(16,185,129,0.1); color: #10b981; }
.stat-card .stat-icon.orange  { background: rgba(245,158,11,0.1); color: #f59e0b; }
.stat-card .stat-icon.red     { background: rgba(239,68,68,0.1);  color: #ef4444; }
.stat-card .stat-icon.cyan    { background: rgba(6,182,212,0.1);  color: #06b6d4; }

.stat-card .stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
    font-family: 'Inter', 'Cairo', sans-serif;
    letter-spacing: -0.5px;
}

/* ── Container ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── External Site Navbar ── */
.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}
.nav-links li a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}
.nav-links li a:hover { color: var(--brand-primary); }

/* ── Footer ── */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding: 40px 0;
}
.footer-col h3, .footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 700;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}
.footer-links li a:hover { color: var(--brand-primary); }

/* ── Nav Custom ── */
.nav-custom {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 1000;
    padding: 15px 30px;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-custom:hover { transform: translateX(-50%); }
.nav-custom.scrolled {
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--surface-border);
}
.nav-custom.scrolled:hover { transform: none; }

/* ============================================================
   Dark Mode
   ============================================================ */
body.dark-mode {
    --bg-body: #0c1222;
    --surface: #151d30;
    --surface-hover: #1c2641;
    --surface-border: #232f4a;
    --surface-muted: #1a2438;
    --text-primary: #e8ecf5;
    --text-secondary: #a0a7be;
    --text-muted: #98a1ba;
    --brand-primary-light: rgba(91, 95, 199, 0.15);
    --brand-primary-glow: rgba(91, 95, 199, 0.25);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.dark-mode .glass {
    background: var(--surface);
    border-color: var(--surface-border);
}
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: var(--surface);
    border-color: var(--surface-border);
    color: var(--text-primary);
}
body.dark-mode th { background: var(--surface-muted); }
body.dark-mode tr:hover { background: var(--surface-hover); }
body.dark-mode .btn-outline {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--surface-border);
}
body.dark-mode .btn-outline:hover { background: var(--surface-hover); }

body.dark-mode .stat-card { background: var(--surface); border-color: var(--surface-border); }
body.dark-mode .stat-card .stat-value { color: var(--text-primary); }
body.dark-mode .alert-banner.success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: #6ee7b7; }
body.dark-mode .alert-banner.error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.2);  color: #fca5a5; }