/*
 * ===================================================
 * هيئة قضايا الدولة - نظام التصميم الموحد
 * State Lawsuits Authority - Design System
 * ===================================================
 * الهيبة القضائية + الحداثة المستقبلية
 * Judicial Prestige + Modern Aesthetics
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Palette - الألوان الأساسية */
    --primary: #003366;           /* أزرق داكن - الوقار القضائي */
    --primary-light: #004d99;
    --primary-dark: #002244;
    
    /* Secondary Palette - الألوان الثانوية */
    --secondary: #C5A02C;         /* ذهبي داكن - لمسة الفخامة */
    --secondary-light: #D4B84A;
    --secondary-dark: #A68920;
    
    /* Semantic Colors - ألوان المعاني */
    --success: #10B981;           /* نجاح - أخضر هادئ */
    --success-light: #D1FAE5;
    --warning: #F59E0B;           /* تحذير - برتقالي */
    --warning-light: #FEF3C7;
    --danger: #EF4444;            /* خطر - أحمر */
    --danger-light: #FEE2E2;
    --info: #3B82F6;              /* معلومات - أزرق */
    --info-light: #DBEAFE;
    
    /* Neutral Palette - الألوان المحايدة */
    --bg-primary: #F8FAFC;        /* خلفية رئيسية */
    --bg-secondary: #F1F5F9;      /* خلفية ثانوية */
    --bg-card: #FFFFFF;           /* خلفية البطاقات */
    --text-primary: #1E293B;      /* نص أساسي */
    --text-secondary: #64748B;    /* نص ثانوي */
    --text-muted: #94A3B8;        /* نص باهت */
    --border-light: #E2E8F0;      /* حدود فاتحة */
    --border-default: #CBD5E1;    /* حدود عادية */
    
    /* Typography - الخطوط */
    --font-arabic: 'Tajawal', 'Cairo', sans-serif;
    --font-english: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing - المسافات */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius - الزوايا */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows - الظلال */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-primary: 0 4px 14px rgba(0, 51, 102, 0.25);
    --shadow-gold: 0 4px 14px rgba(197, 160, 44, 0.25);
    
    /* Transitions - الانتقالات */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE STYLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

.text-primary { color: var(--primary); }
.text-secondary-color { color: var(--secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

/* ===== COMPONENTS ===== */

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--border-default);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: white;
    box-shadow: var(--shadow-gold);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary) 100%);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-elevated {
    box-shadow: var(--shadow-xl);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-body {
    padding: var(--space-md) 0;
}

/* Glass Card - بطاقة زجاجية */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-lg);
}

/* === Form Elements === */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}

.form-input:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-input.is-valid {
    border-color: var(--success);
}

.form-input.is-invalid {
    border-color: var(--danger);
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-error {
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--danger);
}

/* Input with Icon */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-right: 48px;
}

.input-group .input-icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* === Navbar === */
.navbar {
    background: var(--primary);
    color: white;
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-brand img {
    height: 48px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-brand h1 {
    color: white;
    font-size: 1.25rem;
    margin: 0;
}

.navbar-brand .subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

/* === Alerts === */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-danger {
    background: var(--danger-light);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: var(--info-light);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* === Badge === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(0, 51, 102, 0.1);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: #065F46;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400E;
}

.badge-danger {
    background: var(--danger-light);
    color: #991B1B;
}

/* === Progress Steps === */
.steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-normal);
}

.step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--primary);
}

/* === Status Box === */
.status-box {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.status-box.submitted {
    background: var(--info-light);
    border: 1px solid #BFDBFE;
}

.status-box.review {
    background: var(--warning-light);
    border: 1px solid #FDE68A;
}

.status-box.accepted {
    background: var(--success-light);
    border: 1px solid #A7F3D0;
}

.status-box.rejected {
    background: var(--danger-light);
    border: 1px solid #FECACA;
}

.status-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: var(--space-sm);
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--space-lg);
}

.tab-btn {
    background: none;
    border: none;
    padding: var(--space-md) var(--space-lg);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* === Loading Spinner === */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Animations === */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Utilities === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.p-5 { padding: var(--space-xl); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* === Responsive === */
@media (max-width: 768px) {
    :root {
        --space-lg: 20px;
        --space-xl: 24px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    .btn-lg {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    .card {
        padding: var(--space-md);
    }
    
    .navbar-brand h1 {
        font-size: 1rem;
    }
}

/* === Print Styles === */
@media print {
    .navbar, .btn, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* === Accessibility === */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.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;
}
