/**
 * Fondation Abdellah Ben El Abbas El Jerrari
 * Fichier: custom.css
 * Description: Styles personnalisés supplémentaires pour le site
 * Version: 2.0
 */

/* ========== IMPORT DES POLICES ========== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ========== VARIABLES GLOBALES SUPPLEMENTAIRES ========== */
:root {
    --primary-rgb: 52, 152, 219;
    --dark-rgb: 44, 62, 80;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========== ANIMATIONS PERSONNALISEES ========== */

/* Animation de fondu */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Animation de glissement depuis la gauche */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation de glissement depuis la droite */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation de zoom */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation de rebondissement */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Animation de pulsation légère */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Animation de rotation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animation de vague */
@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========== CLASSES D'ANIMATION UTILITAIRES ========== */
.animate-fadeIn { animation: fadeIn 0.8s ease forwards; }
.animate-slideInLeft { animation: slideInLeft 0.8s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.8s ease forwards; }
.animate-zoomIn { animation: zoomIn 0.6s ease forwards; }
.animate-bounce { animation: bounce 2s ease infinite; }
.animate-pulse { animation: pulse 2s ease infinite; }

/* Délais d'animation */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Durées d'animation */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }

/* ========== EFFETS DE SURVOL AVANCES ========== */

/* Effet de soulignement animé */
.hover-underline {
    position: relative;
    display: inline-block;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
    transition: width var(--transition-normal);
}

.hover-underline:hover::after {
    width: 100%;
}

/* Effet de mise à l'échelle au survol */
.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Effet d'élévation au survol */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Effet de brillance au survol */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Effet de bordure colorée */
.hover-border {
    border: 2px solid transparent;
    transition: border-color var(--transition-normal);
}

.hover-border:hover {
    border-color: var(--primary-color);
}

/* ========== EFFETS DE CARTE SPECIFIQUES ========== */

/* Carte avec effet de verre (glassmorphism) */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Carte avec effet néon */
.neon-card {
    background: white;
    border-radius: 20px;
    transition: all var(--transition-normal);
    position: relative;
}

.neon-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.neon-card:hover::before {
    opacity: 1;
}

/* ========== BOUTONS AVANCES ========== */

/* Bouton avec icône animée */
.btn-icon-animated i {
    transition: transform var(--transition-normal);
}

.btn-icon-animated:hover i {
    transform: translateX(5px);
}

/* Bouton avec effet de ripple (ondulation) */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    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-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Bouton avec effet de soulignement */
.btn-underline {
    position: relative;
    background: transparent;
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
}

.btn-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.btn-underline:hover::after {
    width: 80%;
}

/* ========== FORMULAIRES AVANCES ========== */

/* Champ de formulaire flottant */
.floating-input {
    position: relative;
    margin-bottom: 30px;
}

.floating-input input,
.floating-input textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: transparent;
    transition: all var(--transition-normal);
}

.floating-input label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 0 5px;
    transition: all var(--transition-normal);
    pointer-events: none;
    color: #999;
}

.floating-input textarea ~ label {
    top: 25px;
    transform: none;
}

.floating-input input:focus,
.floating-input textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.floating-input input:focus ~ label,
.floating-input input:not(:placeholder-shown) ~ label,
.floating-input textarea:focus ~ label,
.floating-input textarea:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: 0.75rem;
    color: var(--primary-color);
}

/* ========== LOADER / SPINNER ========== */
.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-sm {
    width: 30px;
    height: 30px;
    border-width: 2px;
}

.loader-lg {
    width: 70px;
    height: 70px;
    border-width: 4px;
}

/* ========== PROGRESS BAR ========== */
.progress-bar-custom {
    height: 4px;
    background: var(--gray-light);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-custom .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ========== TOOLTIP PERSONNALISE ========== */
.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom .tooltip-text {
    visibility: hidden;
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-normal);
    font-size: 0.75rem;
}

.tooltip-custom:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========== BADGES ========== */
.badge-custom {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
}

.badge-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* ========== STATISTIQUES / CHIFFRES ========== */
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-top: 5px;
}

/* ========== GRILLES ET MISES EN PAGE ========== */

/* Grille avec effet masonry */
.masonry-grid {
    column-count: 3;
    column-gap: 30px;
}

.masonry-grid > * {
    break-inside: avoid;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* Section avec fond parrallax */
.parallax-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.parallax-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* ========== TIMELINE (pour page Histoire) ========== */
.timeline-modern {
    position: relative;
    padding: 20px 0;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-color));
    border-radius: 3px;
}

[dir="rtl"] .timeline-modern::before {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    width: 50%;
    padding-right: 40px;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 40px;
}

[dir="rtl"] .timeline-item {
    padding-right: 0;
    padding-left: 40px;
}

[dir="rtl"] .timeline-item:nth-child(even) {
    margin-left: 0;
    margin-right: 50%;
    padding-left: 0;
    padding-right: 40px;
}

.timeline-dot {
    position: absolute;
    right: -10px;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-item:nth-child(even) .timeline-dot {
    right: auto;
    left: -10px;
}

[dir="rtl"] .timeline-dot {
    right: auto;
    left: -10px;
}

[dir="rtl"] .timeline-item:nth-child(even) .timeline-dot {
    left: auto;
    right: -10px;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .timeline-modern::before {
        left: 20px;
    }
    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        padding-left: 50px;
    }
    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 10px;
        right: auto;
    }
    [dir="rtl"] .timeline-modern::before {
        left: auto;
        right: 20px;
    }
    [dir="rtl"] .timeline-item,
    [dir="rtl"] .timeline-item:nth-child(even) {
        padding-left: 0;
        padding-right: 50px;
    }
    [dir="rtl"] .timeline-dot,
    [dir="rtl"] .timeline-item:nth-child(even) .timeline-dot {
        left: auto;
        right: 10px;
    }
}

/* ========== MODAL PERSONNALISEE ========== */
.modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-custom.active {
    display: flex;
}

.modal-content-custom {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    padding: 30px;
    position: relative;
    animation: zoomIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform var(--transition-normal);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    border-left: 4px solid #28a745;
}

.toast-notification.error {
    border-left: 4px solid #dc3545;
}

.toast-notification.info {
    border-left: 4px solid var(--primary-color);
}

/* ========== DARK MODE (optionnel) ========== */
body.dark-mode {
    background: #1a1a2e;
    color: #eee;
}

body.dark-mode .modern-card,
body.dark-mode .timeline-content,
body.dark-mode .modal-content-custom {
    background: #16213e;
    color: #eee;
}

body.dark-mode .navbar-floating {
    background: rgba(22, 33, 62, 0.98);
}

body.dark-mode .navbar-floating.scrolled {
    background: #16213e;
}

body.dark-mode .nav-link {
    color: #eee !important;
}

/* ========== RESPONSIVE SUPPLEMENTAIRE ========== */
@media (max-width: 576px) {
    .stat-number {
        font-size: 1.8rem;
    }
    
    .btn-glass,
    .btn-primary-gradient,
    .btn-outline-primary-custom {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
}

/* ========== ACCESSIBILITE ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== IMPRESSION ========== */
@media print {
    .navbar-floating,
    .social-sidebar-modern,
    .back-to-top-modern,
    .footer-modern,
    .announcement-bar {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .modern-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}