/* ==== إعدادات عامة ==== */
* {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    direction: rtl;
}

/* ==== صفحة تسجيل الدخول ==== */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-form-container {
    width: 100%;
    max-width: 450px;
}

.login-form-container .card {
    border-radius: 15px;
    overflow: hidden;
}

.login-form-container .card-body {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* ==== الشريط الجانبي ==== */
.sidebar {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar .nav-link {
    color: #bdc3c7;
    padding: 12px 20px;
    margin: 2px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(-5px);
}

.sidebar .nav-link i {
    width: 20px;
    margin-left: 10px;
}

/* ==== الهيدر ==== */
.main-header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e9ecef;
}

.navbar-brand {
    font-weight: bold;
    color: #2c3e50 !important;
}

/* ==== المحتوى الرئيسي ==== */
.main-content {
    padding: 20px;
    background-color: #f8f9fa;
    min-height: calc(100vh - 80px);
}

/* ==== البطاقات ==== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border: none;
    font-weight: bold;
}

/* ==== الأزرار ==== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #2980b9, #1abc9c);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(45deg, #2ecc71, #1abc9c);
}

.btn-warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    border: none;
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: none;
}

/* ==== الجداول ==== */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table thead th {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    color: white;
    border: none;
    font-weight: 600;
    text-align: center;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table td, .table th {
    vertical-align: middle;
    padding: 12px;
    text-align: center;
}

/* ==== النماذج ==== */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* ==== الإحصائيات ==== */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: scale(1.05);
}

.stats-card .stats-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-card .stats-title {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ==== التنبيهات ==== */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.alert-success {
    background: linear-gradient(45deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.1));
    color: #27ae60;
    border-right: 4px solid #27ae60;
}

.alert-danger {
    background: linear-gradient(45deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
    color: #e74c3c;
    border-right: 4px solid #e74c3c;
}

.alert-warning {
    background: linear-gradient(45deg, rgba(243, 156, 18, 0.1), rgba(230, 126, 34, 0.1));
    color: #f39c12;
    border-right: 4px solid #f39c12;
}

.alert-info {
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
    color: #3498db;
    border-right: 4px solid #3498db;
}

/* ==== تخصيصات للجوال ==== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: right 0.3s ease;
    }
    
    .sidebar.show {
        right: 0;
    }
    
    .main-content {
        margin-right: 0;
        padding: 15px;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .table-responsive {
        border-radius: 10px;
    }
}

/* ==== كلاسات مساعدة ==== */
.text-primary-custom {
    color: #3498db !important;
}

.bg-primary-custom {
    background: linear-gradient(45deg, #3498db, #2980b9) !important;
}

.border-primary-custom {
    border-color: #3498db !important;
}

.shadow-custom {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

.rounded-custom {
    border-radius: 10px !important;
}

/* ==== أنيميشن التحميل ==== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==== تصميم نموذج الإدخال الموحد ==== */
.unified-form .form-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.unified-form .section-title {
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.unified-form .form-row {
    margin-bottom: 15px;
}

/* ==== تصميم الإيصالات ==== */
.receipt-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.receipt-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #3498db;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.receipt-total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    border-top: 2px solid #3498db;
    padding-top: 10px;
    margin-top: 10px;
}

/* ==== تحسينات الطباعة ==== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-container {
        background: white !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* ==== تحسينات النموذج الموحد ==== */
.unified-form {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.unified-form .form-section {
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.unified-form .form-section:last-child {
    border-bottom: none;
}

.unified-form .section-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f4f8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.unified-form .section-title i {
    font-size: 1.2em;
}

/* تحسين الحقول في النموذج الموحد */
.unified-form .form-control, 
.unified-form .form-select {
    border: 2px solid #e8f4f8;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.unified-form .form-control:focus, 
.unified-form .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.unified-form .form-control.is-valid, 
.unified-form .form-select.is-valid {
    border-color: #28a745;
    background-image: none;
}

.unified-form .form-control.is-invalid, 
.unified-form .form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.unified-form .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.unified-form .form-check-label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

/* أزرار النموذج الموحد */
.unified-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.unified-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.unified-form .btn-outline-secondary {
    border: 2px solid #6c757d;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.unified-form .btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* رسائل التحقق المحسنة */
.unified-form .invalid-feedback {
    font-size: 13px;
    color: #dc3545;
    font-weight: 500;
    margin-top: 5px;
}

.unified-form .form-text {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-top: 3px;
}

/* تحسين Input Groups */
.unified-form .input-group-text {
    background: #f8f9fa;
    border: 2px solid #e8f4f8;
    border-right: none;
    color: #495057;
    font-weight: 500;
    border-radius: 0 10px 10px 0;
}

.unified-form .input-group .form-control {
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.unified-form .input-group .form-control:focus {
    border-right: none;
}

/* تحسين الـ Select مع optgroup */
.unified-form optgroup {
    font-weight: bold;
    color: #495057;
    background: #f8f9fa;
    padding: 5px 10px;
}

.unified-form option {
    padding: 8px;
    color: #495057;
}

/* انيميشن للحقول المخفية/الظاهرة */
.unified-form .form-section[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
}

.unified-form .form-section:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
}

/* تحسينات الدفعات */
.payments-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.payment-row {
    background: white;
    border: 2px solid #e8f4f8 !important;
    transition: all 0.3s ease;
}

.payment-row:hover {
    border-color: #667eea !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.payment-row .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.payment-row .form-control,
.payment-row .form-select {
    font-size: 13px;
    padding: 8px 12px;
}

.payment-row .input-group-text {
    font-size: 12px;
    padding: 8px 10px;
}

.payment-row h6 {
    color: #667eea;
    font-weight: 600;
}

.btn-outline-primary.btn-sm {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-outline-danger.btn-sm {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

/* تحسينات خاصة للجوال */
@media (max-width: 768px) {
    .unified-form .form-section {
        padding: 15px;
    }
    
    .unified-form .section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .unified-form .btn-lg {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .unified-form .form-control,
    .unified-form .form-select {
        padding: 10px 12px;
        font-size: 16px; /* لمنع الزووم في iOS */
    }
    
    .payments-section {
        padding: 15px;
    }
    
    .payment-row {
        padding: 15px !important;
    }
    
    .payment-row .form-label {
        font-size: 14px;
    }
    
    .payment-row .form-control,
    .payment-row .form-select {
        font-size: 16px;
        padding: 10px 12px;
    }
} 