/* 
 * تصميم تطبيق شركة السريع للتوصيل
 * Seriee Delivery Company App Styles
 */

/* استيراد خط Cairo */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* المتغيرات الأساسية */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #ff6b6b;
    --light-accent: #ff8a80;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --text-color: #333;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
}

/* الوضع الليلي */
[data-theme="dark"] {
    --white: #1a1a1a;
    --light-gray: #2d2d2d;
    --dark-gray: #cccccc;
    --border-color: #404040;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --text-color: #ffffff;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
}

/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    color: var(--text-color);
    transition: var(--transition);
}

/* تحسينات الوضع الليلي */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .form-control {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus {
    background: var(--card-bg);
    color: var(--text-color);
}

/* زر تبديل الوضع */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

/* الحاوي الرئيسي */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* رأس الصفحة */
.header {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    padding: 30px;
    text-align: center;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: var(--dark-gray);
    font-size: 1.1rem;
    font-weight: 400;
}

/* البطاقات */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.card-title {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* النماذج */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.is-invalid {
    border-color: var(--accent-color);
}

/* أزرار */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--dark-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--accent-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* شبكة الأزرار */
.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 30px 0;
}

/* رفع الملفات */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light-gray);
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* التنبيهات */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #cce7ff;
    border-color: #b3d9ff;
    color: #004085;
}

.btn-close {
    position: absolute;
    top: 10px;
    left: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

.btn-close:hover {
    opacity: 1;
}

/* جدول البيانات */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    font-weight: 600;
}

.table tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* صورة الملف الشخصي */
.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin: 10px auto;
    display: block;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .btn-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
    }
}

/* تحسينات إضافية وتأثيرات UX */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* تأثيرات النبض للأزرار */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* تأثيرات الحقول المحسنة */
.form-control {
    transition: all 0.3s ease;
    position: relative;
}

.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.form-control.is-valid {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

/* مؤشرات حالة الحقول */
.field-status-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

/* تأثيرات الكروت المحسنة */
.card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* تأثيرات الأزرار المحسنة */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

/* تأثيرات الجدول المحسنة */
.table tr {
    transition: all 0.3s ease;
}

.table tr:hover {
    background-color: rgba(102, 126, 234, 0.08);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* تأثيرات رفع الملفات */
.file-upload-label {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-upload-label::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.file-upload-label:hover::before {
    animation: shimmer 1.5s infinite;
    opacity: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* تأثيرات الصور */
.profile-image {
    transition: all 0.3s ease;
    position: relative;
}

.profile-image:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* تأثيرات التنبيهات المحسنة */
.enhanced-alert {
    animation: slideInDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* تأثيرات التحميل المحسنة */
.upload-progress {
    position: relative;
    overflow: hidden;
}

.upload-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* تأثيرات الوضع الليلي المحسنة */
[data-theme="dark"] .card {
    background: linear-gradient(135deg, var(--card-bg), #2a2a2a);
}

[data-theme="dark"] .form-control {
    background: var(--card-bg);
    border-color: #404040;
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
}

[data-theme="dark"] .table tr:hover {
    background-color: rgba(102, 126, 234, 0.15);
}

/* تأثيرات الانتقال السلس */
html {
    scroll-behavior: smooth;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .card:hover {
        transform: translateY(-4px);
    }

    .btn:hover::before {
        width: 200px;
        height: 200px;
    }

    .table tr:hover {
        transform: scale(1.005);
    }
}

/* تأثيرات التركيز للوصولية */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* تأثيرات التحديد */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* تحسين النصوص */
.text-center { text-align: center; }
.text-muted { color: var(--dark-gray); }
.text-primary { color: var(--primary-color); }
.text-danger { color: var(--accent-color); }

/* المسافات */
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.p-3 { padding: 1rem; }

/* إخفاء العناصر */
.d-none { display: none; }
.d-block { display: block; }
