/* Reset et variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #4314ff;
    --accent-color: #f093fb;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --white: #ffffff;
    --text-color: #001538;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    --transition: all 0.3s ease;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    margin: 0;
    background: #f4f6f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   HEADER - Desktop & Mobile
   ================================ */
.header {
    background: linear-gradient(135deg, #6dace2 0%, #3d4ff4 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    order: 2; /* Pour le mettre à gauche en RTL */
}

.logo:hover {
    transform: translateY(-3px);
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffd700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

.logo:hover img {
    border-color: #ffffff;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transform: rotate(5deg);
}

.logo .arabic-text {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    background-clip: text;
}

.logo:hover .arabic-text {
    color:#ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

/* Navigation à droite */
.nav {
    order: 1; /* Pour le mettre à droite en RTL */
}

.nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 3px;
    align-items: center;
}

.nav li {
    position: relative;
}

.nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.nav a:hover::before {
    opacity: 1;
}

.nav a i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    display: block;
    transition: all 0.3s ease;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.nav a:hover i {
    transform: scale(1.1);
    color: #ffd700;
}

.nav a.active {
    background: rgba(255,255,255,0.25);
    color: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.nav a.active i {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    order: 1;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.mobile-menu-toggle i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* ================================
   RESPONSIVE - Desktop > Tablet
   ================================ */
@media (max-width: 1300px) {
    .nav a {
        padding: 8px 10px;
        font-size: 0.75rem;
        min-width: 65px;
    }
    
    .nav a i {
        font-size: 1.1rem;
    }
    
    .logo .arabic-text {
        font-size: 1.4rem;
    }
}

@media (max-width: 1024px) {
    .header .container {
        padding: 1rem;
    }
    
    .nav ul {
        gap: 2px;
    }
    
    .nav a {
        padding: 7px 9px;
        font-size: 0.7rem;
        min-width: 60px;
    }
    
    .nav a i {
        font-size: 1rem;
    }
    
    .logo .arabic-text {
        font-size: 1.3rem;
    }
    
    .logo img {
        width: 45px;
        height: 45px;
    }
}

/* ================================
   RESPONSIVE - Mobile (768px)
   EXACTEMENT COMME ACCUEIL.PHP
   ================================ */
@media (max-width: 768px) {
    .header .container {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: linear-gradient(135deg, #74a9d8 0%, #5d73c7 100%);
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
        z-index: 1000;
        backdrop-filter: blur(10px);
    }
    
    .nav.active {
        display: block;
        animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav ul {
        flex-direction: column;
        padding: 1.5rem;
        gap: 8px;
        align-items: stretch;
    }
    
    .nav a {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        border-radius: 10px;
        background: rgba(255,255,255,0.1);
        backdrop-filter: blur(5px);
    }
    
    .nav a i {
        font-size: 1.3rem;
        margin-bottom: 0;
        margin-left: 15px;
        min-width: 25px;
    }
    
    .nav a:hover {
        background: rgba(255,255,255,0.2);
        transform: translateX(-5px);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .logo .arabic-text {
        font-size: 1.2rem;
    }
    
    .logo img {
        width: 40px;
        height: 40px;
    }
    
    .logo {
        gap: 10px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .header .container {
        padding: 0.8rem;
    }
    
    .logo .arabic-text {
        font-size: 1.1rem;
    }
    
    .logo img {
        width: 35px;
        height: 35px;
        border-width: 2px;
    }
    
    .logo {
        gap: 8px;
    }
    
    .nav a {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .nav a i {
        font-size: 1.2rem;
        margin-left: 12px;
    }
}

/* ================================
   FOOTER - Desktop & Mobile
   ================================ */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.footer-section a:hover {
    opacity: 1;
    transform: translateX(-3px);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-family: 'Cairo', sans-serif;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 1;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
}

.footer .social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.footer .social-links a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.footer .social-links a:hover {
    color: #00a3ff;
}

/* ================================
   SECTIONS - Hero, Contact, etc.
   ================================ */
.section {
    padding: 5rem 0;
    position: relative;
}

.section:nth-child(even) {
    background: var(--light-color);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* ================================
   CARDS & GRIDS
   ================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 20px;
}

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.card-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Contact Section */
.contact-section {
    padding: 60px 20px;
    background-color: #f8f9fa;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.contact-item i {
    font-size: 2rem;
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-item h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* ================================
   RESPONSIVE - Mobile Contact
   ================================ */
@media (max-width: 768px) {
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-item {
        gap: 1rem;
    }
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: all 0.6s ease-out;
}

/* ================================
   MODAL
   ================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-hover);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.close:hover {
    color: var(--primary-color);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* RTL support */
[dir="rtl"] .close {
    right: auto;
    left: 1.5rem;
}
/* ================================
   MOBILE MENU FIXES
   ================================ */

/* Assurer que le header a une hauteur correcte en mobile */
@media (max-width: 768px) {
    .header {
        position: relative;
        min-height: 70px;
    }
    
    .header .container {
        position: relative;
        min-height: 70px;
    }
    
    /* Menu mobile - correction de l'affichage */
    .nav.active {
        display: block !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: linear-gradient(135deg, #74a9d8 0%, #5d73c7 100%) !important;
        z-index: 1001 !important;
    }
    
    /* Liste du menu mobile */
    .nav.active ul {
        display: flex !important;
        flex-direction: column !important;
        padding: 20px !important;
        gap: 10px !important;
    }
    
    /* Éléments du menu mobile */
    .nav.active li {
        width: 100% !important;
    }
    
    .nav.active a {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        padding: 15px 20px !important;
        font-size: 1rem !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 10px !important;
        margin: 0 !important;
    }
    
    .nav.active a i {
        margin-left: 15px !important;
        margin-bottom: 0 !important;
        font-size: 1.2rem !important;
        min-width: 25px !important;
    }
    
    /* Bouton toggle amélioré */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: white;
        cursor: pointer;
        padding: 12px 15px;
        border-radius: 8px;
        transition: all 0.3s ease;
        z-index: 1002;
        order: 1;
    }
}

/* Correction pour les pages spécifiques qui écrasent les styles */
@media (max-width: 768px) {
    .inscription-section .header .nav.active,
    .activities-section .header .nav.active,
    .section .header .nav.active {
        display: block !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
}

/* Assurer que tous les liens sont visibles */
.nav.active a {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
/* Empêcher le défilement quand le menu mobile est ouvert */
body.menu-open {
    overflow: hidden;
}

/* Assurer la visibilité du menu mobile */
@media (max-width: 768px) {
    .nav:not(.active) {
        display: none !important;
    }
    
    .nav.active {
        display: block !important;
        animation: slideDown 0.3s ease-out !important;
    }
}
/* MENU MOBILE - À AJOUTER À LA FIN DE STYLE.CSS SI ABSENT */
@media (max-width: 768px) {
    .header .container {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem;
    }
    
    .nav {
        display: none;
        position: fixed;
        top: 73px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #74a9d8 0%, #5d73c7 100%);
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
        z-index: 999;
        backdrop-filter: blur(10px);
        max-height: calc(100vh - 73px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav.active {
        display: block !important;
        animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav ul {
        flex-direction: column;
        padding: 1.5rem;
        gap: 8px;
        align-items: stretch;
    }
    
    .nav a {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        border-radius: 10px;
        background: rgba(255,255,255,0.1);
        backdrop-filter: blur(5px);
    }
    
    .nav a i {
        font-size: 1.3rem;
        margin-bottom: 0;
        margin-left: 15px;
        min-width: 25px;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .logo .arabic-text {
        font-size: 1.2rem;
    }
    
    .logo img {
        width: 40px;
        height: 40px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}