/* ========================================
   أنماط النظام الذكي v5.0
   ========================================*/

/* التنبيهات الذكية */
.smart-alert {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

/* نافذة التنبيهات الذكية */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* بطاقات التنبيه */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.alert-danger {
    background: #ffebee;
    border-right: 4px solid #f44336;
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-right: 4px solid #ff9800;
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    border-right: 4px solid #2196f3;
    color: #1565c0;
}

.alert-success {
    background: #e8f5e9;
    border-right: 4px solid #4caf50;
    color: #2e7d32;
}

/* أيقونات التنبيهات */
.alert i {
    font-size: 24px;
    margin-top: 2px;
}

.alert-danger i {
    color: #f44336;
}

.alert-warning i {
    color: #ff9800;
}

.alert-info i {
    color: #2196f3;
}

.alert-success i {
    color: #4caf50;
}

/* نتائج الإكمال التلقائي */
.autocomplete-results {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideIn 0.2s ease-out;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f5f5f5;
    padding-right: 20px;
}

/* تأثير التركيز على الحقول */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.1);
    outline: none;
}

/* Badge الأسعار */
.price-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
}

/* حالة نشطة للخدمات */
.service-active {
    color: #4caf50;
    font-weight: 600;
}

.service-inactive {
    color: #9e9e9e;
    font-weight: 600;
}

/* تأثير على الأزرار */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

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

/* تأثير على البطاقات */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* تأثير التحميل */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* تأثير النجاح */
.success-pulse {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* تأثير التحذير */
.warning-shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* تحسين التمرير */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* تحسين النص */
.text-highlight {
    background: linear-gradient(to right, #fff3e0 0%, transparent 100%);
    padding: 2px 4px;
    border-radius: 3px;
}

/* أيقونات الحالة */
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
}

.status-icon.success {
    background: #e8f5e9;
    color: #4caf50;
}

.status-icon.warning {
    background: #fff3e0;
    color: #ff9800;
}

.status-icon.error {
    background: #ffebee;
    color: #f44336;
}

.status-icon.info {
    background: #e3f2fd;
    color: #2196f3;
}

/* تحسين الجداول */
.table tbody tr {
    transition: all 0.2s;
}

.table tbody tr:hover {
    background: #f5f5f5;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* تحسين القوائم المنسدلة */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 30px;
}

/* Dark mode support (اختياري) */
@media (prefers-color-scheme: dark) {
    .autocomplete-results {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .autocomplete-item {
        border-bottom-color: #444;
    }
    
    .autocomplete-item:hover {
        background: #3d3d3d;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-overlay .modal-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .alert {
        flex-direction: column;
        gap: 8px;
    }
    
    .autocomplete-results {
        max-height: 200px;
    }
}
