/* ============================================
   Global UI/UX Improvements
   ============================================ */

/* ============================================
   Skeleton Loaders
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 80%;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.skeleton-table {
    width: 100%;
}

.skeleton-table thead tr th {
    height: 2rem;
    margin-bottom: 1rem;
}

.skeleton-table tbody tr td {
    height: 3rem;
    margin-bottom: 0.5rem;
}

.skeleton-button {
    height: 2.5rem;
    width: 120px;
    border-radius: 0.5rem;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 0.5rem;
}

/* Dark mode skeleton */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #1f1f1f 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* Loading state */
.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 #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Global UI/UX Improvements
   ============================================ */

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Buttons Improvements */
.btn {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Cards Improvements */
.card {
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Form Inputs Improvements */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-control:hover {
    border-color: #9ca3af;
}

/* Labels */
label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

/* Tables Improvements */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f9fafb;
    transform: scale(1.01);
}

/* Navbar Improvements */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e5e7eb;
}

.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #3b82f6 !important;
}

/* Dropdown Improvements */
.dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    transition: all 0.2s ease;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    transform: translateX(5px);
}

/* Alerts Improvements */
.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-right: 4px solid #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-right: 4px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-right: 4px solid #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-right: 4px solid #3b82f6;
}

/* Loading States */
.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 #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Badge Improvements */
.badge {
    border-radius: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.1);
}

/* Modal Improvements */
.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0.75rem 0.75rem 0 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-footer {
    border-top: 2px solid #e5e7eb;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Scrollbar Improvements */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        margin: 0.5rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
}

/* Focus States */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Smooth Page Transitions */
body {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hover Effects */
.hover-color {
    transition: all 0.2s ease;
}

.hover-color:hover {
    color: #3b82f6 !important;
    transform: translateX(-5px);
}

/* Text Improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.5;
    color: #111827;
}

p {
    line-height: 1.7;
    color: #4b5563;
}

/* Link Improvements */
a {
    transition: all 0.2s ease;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Image Improvements */
img {
    transition: all 0.3s ease;
}

img:hover {
    transform: scale(1.05);
}

/* Container Improvements */
.container {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sweet Alert 2 Improvements */
.swal2-popup {
    border-radius: 1rem !important;
    font-family: 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
}

/* RTL direction for Arabic */
html[lang="ar"] .swal2-popup,
html[lang^="ar-"] .swal2-popup {
    direction: rtl !important;
}

.swal2-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

.swal2-content {
    font-size: 1rem !important;
    color: #4b5563 !important;
}

.swal2-confirm {
    border-radius: 0.5rem !important;
    padding: 0.625rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.swal2-cancel {
    border-radius: 0.5rem !important;
    padding: 0.625rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.swal2-cancel:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.swal2-actions {
    gap: 0.75rem !important;
}

.swal2-icon {
    width: 5rem !important;
    height: 5rem !important;
    margin: 1.5rem auto 1rem !important;
}

.swal2-icon.swal2-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
}

.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

.swal2-icon.swal2-info {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

.swal2-timer-progress-bar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* Toast Notifications */
.swal2-toast {
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.swal2-toast.swal2-show {
    animation: slideInRight 0.3s ease !important;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

