/* ============================================================
   نظام الباركنج - شركة الخليج للسيارات
   Gulf Auto Parking System v2.0
   Professional Dark Theme with Gradient Accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
    /* Brand Colors */
    --brand-primary: #6C63FF;
    --brand-secondary: #00D9A6;
    --brand-gradient: linear-gradient(135deg, #6C63FF 0%, #00D9A6 100%);
    --brand-gradient-hover: linear-gradient(135deg, #5B52EE 0%, #00C495 100%);
    --brand-glow: rgba(108, 99, 255, 0.3);

    /* Semantic Colors */
    --primary: #6C63FF;
    --success: #00D9A6;
    --success-bg: rgba(0, 217, 166, 0.08);
    --success-border: rgba(0, 217, 166, 0.25);
    --warning: #FFB547;
    --warning-bg: rgba(255, 181, 71, 0.08);
    --warning-border: rgba(255, 181, 71, 0.25);
    --danger: #FF5C5C;
    --danger-bg: rgba(255, 92, 92, 0.08);
    --danger-border: rgba(255, 92, 92, 0.25);
    --info: #5CB8FF;
    --info-bg: rgba(92, 184, 255, 0.08);
    --info-border: rgba(92, 184, 255, 0.25);

    /* Dark Surface Palette */
    --bg-body: #0B0E14;
    --bg-surface: #111520;
    --bg-surface-2: #161B28;
    --bg-surface-3: #1C2233;
    --bg-card: #111520;
    --bg-input: #161B28;
    --bg-hover: rgba(108, 99, 255, 0.06);
    --dark: #0B0E14;
    --dark-2: #111520;
    --dark-3: #161B28;
    --dark-card: #111520;

    /* Text */
    --text-primary: #F0F2F5;
    --text-secondary: #8B95A8;
    --text-muted: #5A6478;
    --text-inverse: #0B0E14;
    --light: #F0F2F5;
    --gray: #8B95A8;
    --muted: #5A6478;

    /* Borders */
    --border: #1E2536;
    --border-light: #252D3F;
    --border-color: #1E2536;
    --border-focus: var(--brand-primary);

    /* Sizing */
    --sidebar-width: 272px;
    --topbar-height: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 24px var(--brand-glow);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-secondary); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Layout ────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .material-icons {
    font-size: 22px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    background: var(--bg-surface-3);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.btn .material-icons { font-size: 18px; }

.btn-primary {
    background: var(--brand-gradient);
    border: none;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--brand-glow);
}

.btn-primary:hover {
    background: var(--brand-gradient-hover);
    box-shadow: 0 6px 20px var(--brand-glow);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}
.btn-success:hover { background: rgba(0, 217, 166, 0.15); }

.btn-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}
.btn-warning:hover { background: rgba(255, 181, 71, 0.15); }

.btn-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 92, 92, 0.15); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon .material-icons { font-size: 20px; }
.btn-block { width: 100%; }

/* ── Forms ─────────────────────────────────────────────── */
label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

input[type="file"] { padding: 10px; cursor: pointer; }
input[type="color"] { height: 48px; padding: 4px 8px; cursor: pointer; }

.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Tables ────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: right; }
th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
td { color: var(--text-secondary); font-size: 14px; }
tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border);
    line-height: 1.4;
}
.badge .material-icons { font-size: 14px; }
.badge.success { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.badge.warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.badge.danger  { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.badge.info    { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }

/* ── Alerts ────────────────────────────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.alert .material-icons { font-size: 20px; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.alert-danger  { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.alert-info    { background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info); }

/* ── Modal ─────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.show { display: flex; }

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-primary); }

/* ── Utilities ─────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.rtl { direction: rtl; }

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .material-icons { font-size: 64px; opacity: 0.3; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-in { animation: fadeInUp 0.5s ease forwards; opacity: 0; }

/* ── Brand Bar ─────────────────────────────────────────── */
.brand-bar { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .modal-content { padding: 20px; margin: 10px; }
}
