/* ============================================================
   Plateforme de Gestion des Doléances
   Université Mustapha Stambouli de Mascara
   Styles personnalisés
   ============================================================ */

/* Import Google Fonts (Inter + Tajawal for Arabic) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* RTL support - apply Tajawal to text elements but NOT icons */
[dir="rtl"] :not(i):not(.fas):not(.far):not(.fab):not([class*=" fa-"]) {
    font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[dir="rtl"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
[dir="rtl"] .mr-3 { margin-right: 0; margin-left: 0.75rem; }
[dir="rtl"] .ml-1 { margin-left: 0; margin-right: 0.25rem; }
[dir="rtl"] .ml-2 { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .ml-3 { margin-left: 0; margin-right: 0.75rem; }
[dir="rtl"] .pl-10 { padding-left: 0; padding-right: 2.5rem; }
[dir="rtl"] .pl-3 { padding-left: 0; padding-right: 0.75rem; }
[dir="rtl"] .left-3 { left: auto; right: 0.75rem; }
[dir="rtl"] .right-3 { right: auto; left: 0.75rem; }
[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }
[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }
[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }
[dir="rtl"] .space-x-reverse { --tw-space-x-reverse: 1; }
[dir="rtl"] .flex-row { flex-direction: row-reverse; }
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .sm\:text-left { text-align: right; }
[dir="rtl"] .sm\:text-right { text-align: left; }

/* Scrollbar personnalisée */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c5a55a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b8943f; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out; }

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.slide-in { animation: slideIn 0.3s ease-out; }

/* Cards hover */
.card-hover {
    transition: all 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Badge animation */
.badge-pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Sidebar transitions */
#sidebar {
    transition: transform 0.3s ease;
}
#sidebar.open {
    transform: translateX(0);
}

@media (max-width: 1023px) {
    #sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        z-index: 40;
        transform: translateX(-100%);
        width: 280px;
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #sidebarOverlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 39;
    }
    #sidebarOverlay.active {
        display: block;
    }
}

/* Table responsive */
@media (max-width: 640px) {
    table { font-size: 13px; }
}

/* Galerie lightbox */
.gallery-item {
    cursor: pointer;
    transition: all 0.2s;
}
.gallery-item:hover {
    transform: scale(1.03);
}

/* Form focus */
input:focus, select:focus, textarea:focus {
    border-color: #c5a55a;
    box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.1);
}

/* File input styling */
input[type="file"]::file-selector-button {
    margin-right: 8px;
    padding: 4px 12px;
    background: #f0f4f8;
    border: none;
    border-radius: 6px;
    color: #1a365d;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
input[type="file"]::file-selector-button:hover {
    background: #d9e2ed;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(26,54,93,0.1);
    border-top-color: #1a365d;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status indicators */
.statut-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.statut-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.info { background: #3b82f6; }

/* Print styles */
@media print {
    header, footer, aside, .no-print { display: none !important; }
    body { background: white; }
}
