/**
 * ENHANCED UI/UX STYLES - BNIC Immigration
 * Animation, Transitions, Effects sans modification du code
 * Fichier: public/css/enhanced-ui.css
 */

/* ============================================
   1. ANIMATIONS GLOBALES
   ============================================ */

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0.3); }
    50% { box-shadow: 0 0 15px rgba(13, 110, 253, 0.6); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Animation glow pour boutons (2 minutes) */
@keyframes glowButton {
    0%, 100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0.3), 0 0 10px rgba(13, 110, 253, 0.2); }
    50% { box-shadow: 0 0 20px rgba(13, 110, 253, 0.6), 0 0 30px rgba(13, 110, 253, 0.4); }
}

/* Animation glow pour images (3 minutes) */
@keyframes glowImage {
    0%, 100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0.2), 0 0 10px rgba(13, 110, 253, 0.1); }
    50% { box-shadow: 0 0 25px rgba(13, 110, 253, 0.5), 0 0 40px rgba(13, 110, 253, 0.3); }
}

/* ============================================
   2. AMÉLIORATIONS GLOBALES
   ============================================ */

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* ============================================
   3. CONTAINER & CARD ANIMATIONS
   ============================================ */

.container {
    animation: fadeInUp 0.6s ease-out;
}

.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
}

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

.card-body {
    transition: background-color 0.3s ease;
}

/* Glow effect pour boutons (2 minutes = 120s) */
.btn-glow {
    animation: glowButton 120s ease-in-out 1;
}

/* Glow effect pour images (3 minutes = 180s) */
.img-glow {
    animation: glowImage 180s ease-in-out 1;
}

/* ============================================
   4. BOUTONS - AMÉLIORATIONS
   ============================================ */

.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    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:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    color: white;
}

/* ============================================
   5. FORMULAIRES - AMÉLIORATIONS
   ============================================ */

.form-control, .form-select {
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group-text {
    border: 2px solid #e0e6ed !important;
    background-color: #f8f9fa !important;
    border-radius: 8px 0 0 8px;
    transition: all 0.3s ease;
}

.input-group-text i {
    transition: color 0.3s ease;
}

.form-control:focus ~ .input-group-text {
    border-color: #667eea !important;
    background-color: white !important;
}

/* ============================================
   6. NAVBAR ANIMATIONS
   ============================================ */

.navbar {
    animation: slideInDown 0.5s ease-out;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   7. MODALES - AMÉLIORATIONS
   ============================================ */

.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.4s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================
   8. ALERTES & NOTIFICATIONS
   ============================================ */

.alert {
    border: none;
    border-radius: 10px;
    animation: slideInUp 0.4s ease-out;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

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

/* ============================================
   9. LISTES & TABLES
   ============================================ */

.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e0e6ed;
}

.table tbody tr:hover {
    background-color: #f5f7fa;
    transform: scale(1.01);
}

.table td {
    padding: 12px;
    vertical-align: middle;
}

/* ============================================
   10. BADGES & LABELS
   ============================================ */

.badge {
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-warning {
    background-color: #ffc107;
}

.badge-info {
    background-color: #17a2b8;
}

/* ============================================
   11. PAGINATION
   ============================================ */

.pagination .page-link {
    border-radius: 6px;
    margin: 0 4px;
    transition: all 0.3s ease;
    border: none;
    color: #667eea;
}

.pagination .page-link:hover {
    background-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

/* ============================================
   12. SCROLLBAR PERSONNALISÉE
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2, #667eea);
}

/* ============================================
   13. TRANSITIONS FLUIDES
   ============================================ */

* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   14. RESPONSIVITÉ
   ============================================ */

@media (max-width: 768px) {
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .card {
        margin-bottom: 15px;
    }

    .form-control, .form-select {
        font-size: 16px; /* Prévient zoom iOS */
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .container {
        padding: 10px;
    }

    .card {
        border-radius: 10px;
    }
}

/* ============================================
   15. DARK MODE (Optionnel)
   ============================================ */

@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a2e;
        color: #e0e0e0;
    }

    .card, .modal-content {
        background-color: #16213e;
        color: #e0e0e0;
    }

    .form-control, .form-select {
        background-color: #0f3460;
        color: #e0e0e0;
        border-color: #2c3e50;
    }

    .form-control:focus, .form-select:focus {
        background-color: #1a4d7a;
        border-color: #667eea;
    }

    .table thead {
        background: #0f3460;
    }

    .table tbody tr:hover {
        background-color: #1a4d7a;
    }
}

/* ============================================
   16. LOADING STATES
   ============================================ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   17. ZOOM & FOCUS ÉTATS
   ============================================ */

.zoom-in:hover {
    transform: scale(1.1);
}

.zoom-out:active {
    transform: scale(0.95);
}

.focus-ring:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ============================================
   18. GRADIENTS & COULEURS
   ============================================ */

.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   19. OMBRES & PROFONDEUR
   ============================================ */

.shadow-sm {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.shadow-md {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.shadow-xl {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   20. LIENS & TEXTE
   ============================================ */

a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

p {
    color: #555;
    line-height: 1.6;
}
