/* ===================================
   نظام إدارة المهام - ملف CSS المخصص
   =================================== */

/* ===== المتغيرات العامة ===== */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;

    /* ألوان مخصصة للمشروع */
    --purple-color: #6f42c1;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);

    /* المسافات */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ===== التحسينات العامة ===== */
body {
    font-family: var(--system-font, 'Cairo'), 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* ===== الكروت ===== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, .125);
    background-color: var(--light-color);
}

/* ===== الأزرار ===== */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-success {
    background: var(--gradient-success);
    border: none;
}

/* ===== حقول الإدخال ===== */
.form-control,
.form-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

.form-control-lg,
.form-select-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

/* ===== التنبيهات ===== */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    box-shadow: var(--shadow);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* ===== الشارات (Badges) ===== */
.badge {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.bg-purple {
    background-color: var(--purple-color) !important;
}

/* ===== التنقل ===== */
.navbar {
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* ===== الجداول ===== */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 1.25rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    font-size: 0.95rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: scale(1.01);
}

/* ===== القوائم المنسدلة ===== */
.dropdown-menu {
    border-radius: var(--border-radius-sm);
    border: none;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
}

.dropdown-item {
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    margin: 0 0.5rem;
}

.dropdown-item:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(5px);
}

/* ===== الرسوم المتحركة ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== تحسينات خاصة بالمشروع ===== */

/* صفحة لوحة التحكم */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.dashboard-card .card-body {
    padding: 2rem;
}

.dashboard-stat {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* حالات المهام */
.status-pending {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

.status-in-progress {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

.status-completed {
    background: linear-gradient(135deg, #55a3ff 0%, #003d82 100%);
    color: white;
}

.status-paused {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: white;
}

/* أنواع المهام */
.task-epic {
    border-left: 4px solid var(--purple-color);
}

.task-story {
    border-left: 4px solid var(--info-color);
}

.task-task {
    border-left: 4px solid var(--primary-color);
}

.task-bug {
    border-left: 4px solid var(--danger-color);
}

.task-feature {
    border-left: 4px solid var(--success-color);
}

.task-improvement {
    border-left: 4px solid var(--warning-color);
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .table-responsive {
        border-radius: var(--border-radius);
    }
}

/* تحسينات إمكانية الوصول */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* تحسينات الطباعة */
@media print {

    .btn,
    .navbar,
    .alert {
        display: none !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* ===== تحسينات خاصة بالنظام ===== */

/* شريط التحميل */
.loading-bar {
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* تحسينات البحث */
.search-highlight {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

/* تحسينات الإشعارات */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

/* تحسينات الأيقونات */
.icon-lg {
    font-size: 1.5rem;
}

.icon-xl {
    font-size: 2rem;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.container,
.container-lg,
.container-md,
.container-sm {
    max-width: 100% !important;
}