/**
 * مقاولات أبوظبي - ملف CSS الرئيسي
 * Main Styles
 */

/* ====================================
   المتغيرات الأساسية
   ==================================== */

:root {
    --primary-blue: #0056D2;
    --primary-dark: #0044a8;
    --secondary-orange: #F97316;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ====================================
   الأنماط الأساسية
   ==================================== */

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

/* ====================================
   التخطيط
   ==================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

[class*="col-"] {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    width: 100%;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* ====================================
   البطاقات
   ==================================== */

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-title {
    color: var(--primary-blue);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-title a {
    color: inherit;
    text-decoration: none;
}

.card-title a:hover {
    color: var(--secondary-orange);
}

/* ====================================
   الأزرار
   ==================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-orange), #e55b0f);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e55b0f, var(--secondary-orange));
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 12px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ====================================
   النماذج
   ==================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 86, 210, 0.1);
}

/* ====================================
   الجداول
   ==================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--text-dark);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.table tbody tr:hover {
    background: rgba(0, 86, 210, 0.05);
}

/* ====================================
   التنبيهات
   ==================================== */

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-right: 4px solid;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: var(--success-color);
}

.alert-danger {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: var(--danger-color);
}

.alert-warning {
    background: #fef3c7;
    color: #78350f;
    border-color: var(--warning-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: var(--primary-blue);
}

/* ====================================
   التنقيح
   ==================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--text-light); }
.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ====================================
   الوسائط المستجيبة
   ==================================== */

@media (max-width: 992px) {
    .col-3, .col-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .col-4 { flex: 0 0 50%; max-width: 50%; }
    .col-6 { flex: 0 0 100%; max-width: 100%; }
    .col-8 { flex: 0 0 100%; max-width: 100%; }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ====================================
   انتقالات الصفحة
   ==================================== */

.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================
   تحميل الأصول
   ==================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ====================================
   نهاية الملف
   ==================================== */
