/* 
 * تحسينات تجربة المستخدم - شركة السريع للتوصيل
 * UX Enhancements - Seriee Delivery Company
 */

/* ========== تحسينات الانيميشن والتفاعل ========== */

/* تأثيرات الأزرار المحسنة */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.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.98);
}

/* تأثيرات نبض للأزرار المهمة */
.btn-primary {
    animation: subtle-pulse 3s infinite;
}

@keyframes subtle-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5); }
}

/* تحسينات مؤشرات التحميل */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ========== تحسينات الرسائل والتنبيهات ========== */

.alert {
    position: relative;
    border-left: 4px solid;
    animation: slideInRight 0.5s ease-out;
    transition: all 0.3s ease;
}

.alert::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
}

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

.alert-success::before {
    content: '✅';
    font-size: 18px;
}

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

.alert-danger::before {
    content: '❌';
    font-size: 18px;
}

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

.alert-warning::before {
    content: '⚠️';
    font-size: 18px;
}

.alert-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #cce7ff 0%, #b3d9ff 100%);
}

.alert-info::before {
    content: 'ℹ️';
    font-size: 18px;
}

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

/* رسائل منبثقة محسنة */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1050;
    max-width: 350px;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px 20px;
    border-left: 4px solid;
    animation: toastSlideIn 0.4s ease-out;
    transition: all 0.3s ease;
}

.toast:hover {
    transform: translateX(-5px);
}

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

/* ========== تحسينات النماذج والحقول ========== */

.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-control {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid var(--border-color);
}

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

/* مؤشرات حالة الحقول */
.field-wrapper {
    position: relative;
}

.field-status {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0;
    transition: all 0.3s ease;
}

.form-control.is-valid + .field-status {
    opacity: 1;
    color: #28a745;
}

.form-control.is-invalid + .field-status {
    opacity: 1;
    color: #dc3545;
}

/* تحقق فوري من البيانات */
.validation-message {
    font-size: 0.875rem;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

.validation-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.validation-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

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

/* مسار التنقل (Breadcrumbs) */
.breadcrumb {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    border-radius: 25px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
    transform: translateX(-2px);
}

.breadcrumb-item.active {
    color: var(--dark-gray);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* أزرار التنقل */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--white);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: var(--primary-color);
    color: white;
}

/* ========== تحسينات عرض البيانات ========== */

/* جداول محسنة */
.table-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.table {
    margin: 0;
    transition: all 0.3s ease;
}

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

.table tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    transform: scale(1.01);
}

/* فلاتر وترتيب */
.filters-container {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.filter-item select,
.filter-item input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* ========== تحسينات الصور والمستندات ========== */

/* معاينة الصور المحسنة */
.image-preview {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.image-preview:hover img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.image-overlay-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* بطاقات المستندات المحسنة */
.document-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

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

/* ========== تأثيرات عامة ========== */

/* تأثير الظهور التدريجي */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

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

/* ========== تحسينات الفوتر ========== */

/* تأثيرات اسم المطور */
footer [style*="يعقوب دداه"] {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    animation: goldShine 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

@keyframes goldShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* تأثيرات بطاقات المميزات */
footer [style*="backdrop-filter"] {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

footer [style*="backdrop-filter"]:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* انيميشن للأيقونات في الفوتر */
footer span[style*="font-size: 1.2rem"] {
    display: inline-block;
    transition: all 0.3s ease;
}

footer [style*="backdrop-filter"]:hover span[style*="font-size: 1.2rem"] {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* تأثير نبض لاسم المطور */
footer [style*="المطور: يعقوب دداه"] {
    animation: developerPulse 4s ease-in-out infinite;
}

@keyframes developerPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 2px 4px rgba(0,0,0,0.3);
    }
}

/* ========== تحسينات الفوتر ========== */

/* تأثيرات اسم المطور */
.developer-name {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    animation: goldShine 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

@keyframes goldShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* تأثيرات بطاقات المميزات في الفوتر */
.footer-feature-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-feature-card:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* انيميشن للأيقونات في الفوتر */
.footer-icon {
    display: inline-block;
    transition: all 0.3s ease;
}

.footer-feature-card:hover .footer-icon {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* تأثير نبض لاسم المطور */
.developer-highlight {
    animation: developerPulse 4s ease-in-out infinite;
}

@keyframes developerPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 2px 4px rgba(0,0,0,0.3);
    }
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    .breadcrumb-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    /* تحسينات الفوتر للهاتف */
    .footer-feature-card {
        margin-bottom: 10px;
    }

    .developer-highlight {
        font-size: 1rem !important;
    }
}
