/* ==================================================
   SYSTEME DE DESIGN - UNIVERSITÉ ROI FAYÇAL
   ================================================== */

/* 1. Variables & Fonts
   -------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
    --urf-blue: #003366;
    --royal-gold: #D4AF37;
    --pure-white: #FFFFFF;
    --light-gray: #F8F9FA;
    --text-secondary: #6C757D;
    --text-primary: #212529;
    --border-color: #dee2e6;
    --header-height: 80px;
}

/* 2. Styles de Base & Typographie
   -------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--pure-white);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden; /* Empêche le scroll horizontal */
}

/* Sélection de la police basée sur la direction du texte */
[dir="ltr"] body { font-family: 'Poppins', sans-serif; }
[dir="rtl"] body { font-family: 'Tajawal', sans-serif; }

h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--urf-blue);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 3. Composants Réutilisables
   -------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--urf-blue);
    color: var(--pure-white);
}
.btn-primary:hover {
    background-color: #002244; /* Un bleu plus sombre */
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--royal-gold);
    border-color: var(--royal-gold);
}
.btn-secondary:hover {
    background-color: var(--royal-gold);
    color: var(--pure-white);
}

.btn-lg {
    padding: 15px 40px;
    font-size: 18px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--royal-gold);
    margin: 10px auto 0;
    border-radius: 2px;
}


/* ==================================================
   STYLES SPÉCIFIQUES AUX SECTIONS
   ================================================== */

/* 4. Header
   -------------------------------------------------- */
#main-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: #1376d9;
    padding: 15px 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#main-header .logo img {
    height: 50px;
}

#main-header .nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 15px;
}
.lang-switcher a {
    color: var(--pure-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
#main-header.scrolled .lang-switcher a { color: var(--text-primary); }
.lang-switcher a.active {
    color: var(--royal-gold);
    text-decoration: underline;
}
.lang-switcher .separator {
    color: var(--pure-white);
    opacity: 0.5;
}
#main-header.scrolled .lang-switcher .separator { color: var(--text-secondary); }

.mobile-menu-toggle { display: none; }

/* RTL Header */
[dir="rtl"] #main-header .nav-actions .btn {
    /* L'ordre visuel est géré par flex-direction, pas besoin de float */
}


/* 5. Hero Section
   -------------------------------------------------- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--pure-white);
    background: url('https://images.unsplash.com/photo-1550305080-4e029753abcf?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTl8fHN0dWRlbnRzfGVufDB8fDB8fHww') no-repeat center center/cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 4rem;
    color: var(--pure-white);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 40px;
    opacity: 0.9;
}


/* 6. Guides Section
   -------------------------------------------------- */
.section-guides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 80px 20px;
}
.info-card {
    background: var(--pure-white);
    padding: 40px 30px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.info-card .icon {
    font-size: 3rem;
    color: var(--royal-gold);
    margin-bottom: 20px;
}
.info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}
.info-card p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}
.card-link {
    color: var(--urf-blue);
    text-decoration: none;
    font-weight: 500;
}
.card-link i {
    transition: transform 0.3s;
}
.card-link:hover i {
    transform: translateX(5px);
}
[dir="rtl"] .card-link:hover i {
    transform: translateX(-5px);
}


/* 7. Important Note Section
   -------------------------------------------------- */
.section-note {
    background-color: var(--light-gray);
    padding: 50px 0;
}
.note-content {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--pure-white);
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid var(--royal-gold);
}
[dir="rtl"] .note-content {
    border-left: none;
    border-right: 5px solid var(--royal-gold);
}
.note-content > i {
    font-size: 2.5rem;
    color: var(--royal-gold);
}
.note-text h4 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}
.note-text p {
    color: var(--text-secondary);
    margin: 0;
}

/* 8. Faculties & FAQ (Accordion)
   -------------------------------------------------- */
.section-faculties, .section-faq {
    padding: 80px 0;
}
.section-faq {
    background-color: var(--light-gray);
}
.accordion {
    max-width: 800px;
    margin: 0 auto;
}
.accordion-item {
    border-bottom: 1px solid var(--border-color);
}
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}
[dir="rtl"] .accordion-header { text-align: right; }
.accordion-header:hover {
    background-color: #f8f9fa;
}
.accordion-header i {
    transition: transform 0.3s ease;
}
.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}
.accordion-content {
    display: none;
    padding: 0 20px 20px 40px;
    color: var(--text-secondary);
    line-height: 1.8;
}
[dir="rtl"] .accordion-content {
    padding: 0 40px 20px 20px;
}
.accordion-content ul {
    list-style: none;
    padding-left: 20px;
}
[dir="rtl"] .accordion-content ul {
    padding-left: 0;
    padding-right: 20px;
}
.accordion-content ul li {
    padding: 5px 0;
    position: relative;
}
.accordion-content ul li::before {
    content: '\f105'; /* Font Awesome angle-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--royal-gold);
    position: absolute;
    left: -20px;
    top: 5px;
}
[dir="rtl"] .accordion-content ul li::before {
    content: '\f104'; /* Font Awesome angle-left */
    left: auto;
    right: -20px;
}

/* 9. Footer
   -------------------------------------------------- */
.main-footer {
    background-color: #1376d9;
    color: var(--pure-white);
    padding-top: 60px;
}
.main-footer .container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col h4 {
    color: var(--pure-white);
    margin-bottom: 20px;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 10px;
}
.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--royal-gold);
}
[dir="rtl"] .footer-col h4::after {
    left: auto;
    right: 0;
}
.footer-col p {
    color: rgba(255, 255, 255, 0.7);
}
.footer-logo {
    max-width: 150px;
    margin-bottom: 20px;
    /*filter: brightness(0) invert(1);*/
}
.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--pure-white);
    text-decoration: none;
    margin-right: 10px;
    transition: background-color 0.3s, color 0.3s;
}
[dir="rtl"] .social-links a {
    margin-right: 0;
    margin-left: 10px;
}
.social-links a:hover {
    background-color: var(--royal-gold);
    color: var(--urf-blue);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
}
.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}


/* ==================================================
   RESPONSIVE & MEDIA QUERIES
   ================================================== */

@media (max-width: 992px) {
    .hero-title { font-size: 3rem; }
    .section-guides { grid-template-columns: 1fr; }
    .main-footer .container { grid-template-columns: 1fr; text-align: center; }
    .footer-col h4::after { left: 50%; transform: translateX(-50%); }
    [dir="rtl"] .footer-col h4::after { right: 50%; transform: translateX(50%); }

    /* Mobile Menu */
    #main-header .nav-actions {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--pure-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.4s ease-in-out;
    }
    #main-header .nav-actions.active {
        right: 0;
    }
    [dir="rtl"] #main-header .nav-actions {
        right: auto;
        left: -100%;
    }
    [dir="rtl"] #main-header .nav-actions.active {
        left: 0;
    }
    #main-header .nav-actions .btn { width: 200px; }
    #main-header .nav-actions .lang-switcher a,
    #main-header .nav-actions .lang-switcher .separator {
        color: var(--text-primary);
        font-size: 1.2rem;
    }
    .mobile-menu-toggle {
        display: block;
        font-size: 1.5rem;
        color: var(--pure-white);
        cursor: pointer;
    }
    #main-header.scrolled .mobile-menu-toggle {
        color: var(--text-primary);
    }
}

@media (max-width: 768px) {
    :root { --header-height: 70px; }
    #main-header .logo img { height: 40px; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .section-title { font-size: 2rem; }
    .note-content { flex-direction: column; text-align: center; }
}

/* ... (tous les styles de la Vague 1) ... */

/* ==================================================
   10. Authentication Page (login.php)
   ================================================== */
.auth-page {
    background: url('http://urft.net/wp-content/uploads/2022/08/33.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

.auth-container {
    position: relative;
    z-index: 2;
    max-width: 450px;
    width: 100%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    text-align: center;
    color: var(--pure-white);
}

.auth-logo {
    display: inline-block;
    margin-bottom: 30px;
}
.auth-logo img {
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--royal-gold);
}

.auth-container h2 {
    color: var(--pure-white);
    font-size: 2rem;
    margin-bottom: 10px;
}
.auth-container .form-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: var(--pure-white);
    transition: all 0.3s ease;
}
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--royal-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.password-wrapper {
    position: relative;
}
.toggle-password {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}
[dir="rtl"] .toggle-password {
    right: auto;
    left: 20px;
}
.toggle-password:hover {
    color: var(--royal-gold);
}
/* Ajuster le padding pour que le texte ne passe pas sous l'icône */
[dir="ltr"] .form-control[type="password"] { padding-right: 50px; }
[dir="rtl"] .form-control[type="password"] { padding-left: 50px; }


.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
[dir="rtl"] .form-options {
    justify-content: flex-start;
}
.forgot-password {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
}
.forgot-password:hover {
    color: var(--royal-gold);
    text-decoration: underline;
}

.d-grid .btn {
    width: 100%;
}

.switch-form-text {
    margin-top: 25px;
    font-size: 0.9rem;
}
.switch-form-text a {
    color: var(--royal-gold);
    font-weight: bold;
    text-decoration: none;
}
.switch-form-text a:hover {
    text-decoration: underline;
}

/* Style pour le message d'inscriptions closes */
.alert-message {
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--royal-gold);
    border-radius: 10px;
    color: var(--pure-white);
}
.alert-message i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
    color: var(--royal-gold);
}

/* Style du spinner */
.btn .spinner-border {
    display: none; /* Remplacé par la classe .d-none de Bootstrap mais défini ici pour la clarté */
    vertical-align: middle;
    margin-right: 5px;
}
[dir="rtl"] .btn .spinner-border {
    margin-right: 0;
    margin-left: 5px;
}
.btn.loading .spinner-border {
    display: inline-block;
}
.btn.loading span:not(.spinner-border) {
    display: none;
}

/* ... (tous les styles précédents) ... */

/* 11. Registration Status Section (index.php)
   -------------------------------------------------- */
.section-status {
    padding: 60px 0;
    background-color: var(--light-gray);
}

.status-box {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    border-radius: 1rem;
    color: var(--pure-white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: background-color 0.5s ease;
}

.status-icon {
    font-size: 4rem;
    opacity: 0.8;
}

.status-content h3 {
    color: var(--pure-white);
    font-size: 2rem;
    margin-bottom: 10px;
}

.status-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

/* Couleurs de statut dynamiques */
.status-box.status-open {
    /* Vert pour "ouvert", un vert élégant et pas trop agressif */
    background: linear-gradient(135deg, #28a745, #218838); 
}
.status-box.status-upcoming {
    /* Bleu URF pour "à venir", crée une attente sérieuse */
    background: linear-gradient(135deg, var(--urf-blue), #002244); 
}
.status-box.status-closed {
    /* Gris pour "fermé", informatif mais neutre */
    background: linear-gradient(135deg, #6c757d, #5a6268); 
}

/* Ajustements pour la direction du texte */
[dir="rtl"] .status-box {
    text-align: right;
}

/* Responsive pour la status-box */
@media (max-width: 768px) {
    .section-status {
        padding: 40px 20px;
    }
    .status-box {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .status-content h3 {
        font-size: 1.5rem;
    }
    [dir="rtl"] .status-box {
        text-align: center;
    }
}