/* Variables CSS */
:root {
    --primary-color: #2e7d32;
    --secondary-color: #ffffff;
    --accent-color: #81c784;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--secondary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header et Navigation */
.header {
    background-color: var(--secondary-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 40px;
    width: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(46, 125, 50, 0.1);
}

.login-btn {
    background-color: var(--primary-color);
    color: var(--secondary-color) !important;
}

.login-btn:hover {
    background-color: var(--accent-color);
    color: var(--secondary-color) !important;
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* Main content */
.main-content {
    margin-top: 80px;
}

/* Section Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--secondary-color);
    padding: 4rem 0;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    text-align: center;
}

.hero-icon {
    font-size: 8rem;
    opacity: 0.8;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    color: var(--secondary-color);
}

.btn-secondary {
    background-color: #2e7d32;;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Sections */
.services, .about, .cta {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
    font-weight: bold;
}

/* Services */
.services {
    background-color: #f8faf8;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--secondary-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--secondary-color);
    font-size: 2rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.service-link:hover {
    color: var(--accent-color);
}

/* About section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.about-features {
    list-style: none;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.about-features i {
    color: var(--primary-color);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--secondary-color);
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: var(--secondary-color);
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section li {
    color: #cccccc;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #cccccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #cccccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--secondary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        flex-direction: row;
        justify-content: space-around;
    }

    .stat-item {
        flex: 1;
        margin: 0 0.5rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-icon {
        font-size: 4rem;
    }

    .services, .about, .cta {
        padding: 2rem 0;
    }

    .service-card {
        padding: 1.5rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        margin: 0;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .btn-large {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.stat-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Formulaires */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-input.error {
    border-color: #f44336;
}

.form-input.success {
    border-color: #4caf50;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--secondary-color);
    color: var(--text-dark);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-error {
    color: #f44336;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error.show {
    display: block;
}

.form-success {
    color: #4caf50;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-success.show {
    display: block;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 0.25rem;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.form-checkbox label {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.form-checkbox a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-checkbox a:hover {
    text-decoration: underline;
}

.form-submit {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.form-submit:hover {
    background-color: var(--accent-color);
}

.form-submit:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
}

.form-links {
    text-align: center;
    margin-top: 1.5rem;
}

.form-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-links a:hover {
    text-decoration: underline;
}

.form-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: var(--text-light);
}

.form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
    z-index: 1;
}

.form-divider span {
    background-color: var(--secondary-color);
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Alertes */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-error {
    background-color: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

.alert-success {
    background-color: #e8f5e8;
    border-left-color: #4caf50;
    color: #2e7d32;
}

.alert-info {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
    color: #1565c0;
}

.alert i {
    margin-right: 0.5rem;
}

.alert ul {
    margin: 0.5rem 0 0 1.5rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* Page de formulaire */
.form-page {
    background-color: #f8f9fa;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive pour formulaires */
@media (max-width: 768px) {
    .form-container {
        margin: 0 1rem;
        padding: 1.5rem;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}

/* Utilitaires */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.role-etudiant {
    background: #2196f3;
}

.role-moderateur {
    background: #ff9800;
}

.role-admin {
    background: #4caf50;
}

.role-super-admin {
    background: #f44336;
}

/* Access denied messages */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-error {
    background: #ffebee;
    color: #d32f2f;
    border-left-color: #f44336;
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left-color: #4caf50;
}

.alert-warning {
    background: #fff3e0;
    color: #f57c00;
    border-left-color: #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left-color: #2196f3;
}

/* ===== HEADER OPTIMISÉ ===== */

/* Menu burger pour mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 152, 0, 0.1);
}

/* Navigation optimisée */
.nav-container {
    padding: 0.75rem 1.5rem !important;
}

.nav-menu {
    gap: 0.5rem !important;
}

.nav-link {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s !important;
}

.nav-link:hover {
    background: rgba(255, 152, 0, 0.1) !important;
}

.nav-link i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    white-space: nowrap;
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

/* User menu */
.user-menu .nav-link {
    padding: 0.5rem !important;
    gap: 0.75rem;
    min-width: 200px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ffb74d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.7rem;
}

/* User dropdown */
.user-dropdown {
    min-width: 280px !important;
    right: 0;
    left: auto;
}

.user-info-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ffb74d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
}

.user-details .user-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.user-role-badge {
    font-size: 0.8rem;
}

.logout-link {
    color: #f44336 !important;
}

.logout-link:hover {
    background: rgba(244, 67, 54, 0.1) !important;
}

/* Dropdown divider */
.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-text:not(.dropdown-menu .nav-text):not(.user-menu .nav-text) {
        display: none;
    }

    .nav-link {
        padding: 0.75rem !important;
        min-width: auto;
    }

    .user-menu .nav-link {
        min-width: auto;
    }

    .user-info:not(.dropdown-menu .user-info) {
        display: none;
    }

    /* Assurer que les dropdowns restent visibles */
    .dropdown-menu .nav-text,
    .dropdown-menu .user-info {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 10px 10px;
        padding: 1rem 0;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 1rem 1.5rem !important;
        justify-content: flex-start;
        width: 100%;
        border-radius: 0 !important;
    }

    .nav-text {
        display: block;
    }

    .user-info {
        display: flex;
    }

    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8f9fa !important;
        margin: 0.5rem 0 !important;
    }

    .dropdown:hover .dropdown-menu {
        display: block;
    }
}