/* ================================================================================================================================ */
/* ========================================== ECORIDE - STYLES COMMUNS (CHARTE GRAPHIQUE 2025) =================================== */
/* ================================================================================================================================ */

/* Import des polices Google Fonts selon la charte */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

/* ================================================================================================================================ */
/* --------------------------------------------------- Variables CSS (Charte 2025) ------------------------------------------------ */
/* ================================================================================================================================ */

:root {
    /* Couleurs Primaires */
    --color-primary: #27ae60;          /* Vert EcoRide */
    --color-secondary: #3498db;        /* Bleu Technologie */
    --color-white: #ffffff;            /* Blanc Pur */
    
    /* Couleurs Secondaires */
    --color-background: #f8f9fa;       /* Gris Interface */
    --color-text-secondary: #6c757d;   /* Gris Texte */
    --color-text-primary: #343a40;     /* Gris Foncé */
    
    /* Couleurs d'État */
    --color-success: #28a745;          /* Succès */
    --color-warning: #ffc107;          /* Attention */
    --color-danger: #dc3545;           /* Danger */
    --color-info: #17a2b8;             /* Info */
    
    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Bordures */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ================================================================================================================================ */
/* --------------------------------------------------- Styles Généraux ------------------------------------------------------------ */
/* ================================================================================================================================ */

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    scroll-behavior: smooth;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, .brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.3; }
h3 { font-size: 1.5rem; line-height: 1.4; }

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* ================================================================================================================================= */
/* ------------------------------------------------ Barre de navigation (Header) --------------------------------------------------- */
/* ================================================================================================================================= */

header {
    background: linear-gradient(to right, #4CAF50 30%, #2196F3 30%);
    color: var(--color-white);
    height: 80px;
    padding: 0 var(--spacing-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    gap: 0.5rem;
    z-index: 1;
    height: 100%;
}

.logo-link img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    line-height: 80px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}

nav li {
    list-style: none;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
    transition: all 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFC107;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* ================================================================================================================================ */
/* --------------------------------------------- Menu Hamburger (Responsive)------------------------------------------------------- */
/* ================================================================================================================================ */

.hamburger-menu {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1010;
    flex-direction: column;
    justify-content: space-around;
}

.hamburger-menu .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 50px;
    transition: all 0.3s ease-in-out;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ================================================================================================================================ */
/* ----------------------------------------------------- Pied de page ------------------------------------------------------------- */
/* ================================================================================================================================ */

main {
    flex: 1;
}

footer {
    background: linear-gradient(to right, #4CAF50 30%, #2196F3 30%);
    color: #fff;
    padding: 0.3rem 1rem;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1;
    font-size: 0.75rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.footer-content p {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.2;
}

.footer-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-content a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.7rem;
    position: relative;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.footer-content a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFC107;
    transition: width 0.3s ease;
}

.footer-content a:hover::after {
    width: 100%;
}

.secure-payment-info {
    text-align: center;
}

.secure-payment-info img {
    height: 30px;
    margin-top: 5px;
    width: auto;
    max-width: 100%;
}

/* ================================================================================================================================ */
/* ------------------------------------------------- Boutons Génériques ----------------------------------------------------------- */
/* ================================================================================================================================ */

/* Bouton principal (vert) */
.participate-button {
    background-color: #4CAF50;
    color: #fff;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.participate-button:hover {
    background-color: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* Bouton secondaire (jaune) */
.search-form button,
.details-button,
.filters-form .apply-filters-button {
    background-color: #FFC107;
    color: #333;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.search-form button:hover,
.details-button:hover,
.filters-form .apply-filters-button:hover {
    background-color: #e6a800;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Boutons d'authentification et de contact */
.auth-button, .contact-button {
    background-color: #4CAF50;
    color: #fff;
    padding: 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
}

.auth-button:hover, .contact-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Bouton pour ajouter un véhicule */
.add-button {
    background-color: #4CAF50;
    color: #fff;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.add-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.add-button-small {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-button-small:hover {
    background-color: #45a049;
}

/* Bouton de déconnexion */
.logout-button {
    background-color: #f44336;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.logout-button:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

/* Bouton Admin */
.admin-button {
    background-color: #ff9800;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-button:hover {
    background-color: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.admin-button i {
    font-size: 1rem;
}

/* ================================================================================================================================ */
/* ------------------------------------------------ Classes utilitaires ----------------------------------------------------------- */
/* ================================================================================================================================ */

.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

.show-flex {
    display: flex !important;
}

.show-inline {
    display: inline !important;
}

.show-inline-block {
    display: inline-block !important;
}

.info-message {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.no-items-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 1rem 0;
}

.user-nav-hidden {
    display: none;
}

.guest-nav-hidden {
    display: none;
}

/* ================================================================================================================================ */
/* ------------------------------------------------ Sections communes ------------------------------------------------------------- */
/* ================================================================================================================================ */

.auth-section, .contact-section, .offer-ride-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 80px - 100px);
    background-color: #f8f9fa;
    padding: 4rem 2rem;
}

.auth-container, .contact-container, .offer-ride-container {
    background-color: #fff;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.offer-ride-container {
    max-width: 800px;
}

.auth-container h1, .contact-container h1, .offer-ride-container h1 {
    margin-bottom: 1rem;
    color: #1e3a8a;
}

/* Formulaires communs */
.auth-form, .contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.auth-form .form-group,
.contact-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group label,
.contact-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.auth-form .form-group input,
.contact-form .form-group input,
.contact-form .form-group textarea {
    width: calc(100% - 24px);
    padding: 0.75rem 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form .form-group input:focus,
.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.contact-form .form-group textarea {
    resize: vertical;
}

.auth-links {
    margin-top: 1.5rem;
}

.auth-links a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Force du mot de passe */
.password-strength {
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak {
    width: 33%;
    background-color: #f44336;
}

.password-strength-bar.medium {
    width: 66%;
    background-color: #ff9800;
}

.password-strength-bar.strong {
    width: 100%;
    background-color: #4CAF50;
}

.password-strength-text {
    font-size: 0.9rem;
    margin-top: 0.3rem;
    color: #666;
}

/* ================================================================
   RESPONSIVE DESIGN - MENU MOBILE
   ================================================================ */

/* Tablettes et mobiles */
@media screen and (max-width: 1024px) {
    /* Afficher le bouton hamburger */
    .hamburger-menu {
        display: flex !important;
    }

    /* Cacher la navigation normale sur mobile */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: #1e3a8a;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 80px;
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3);
    }

    /* Navigation mobile active */
    .main-nav.active {
        right: 0;
    }

    /* Menu items en colonne */
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav ul li a {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        text-align: left;
    }

    .main-nav ul li a:hover {
        background-color: rgba(255,255,255,0.1);
    }

    /* Badge de notification pour les avis */
    .notification-badge {
        background: #dc3545;
        color: white;
        border-radius: 50%;
        padding: 2px 6px;
        font-size: 0.75rem;
        font-weight: 600;
        margin-left: 5px;
        display: inline-block;
        min-width: 18px;
        height: 18px;
        line-height: 14px;
        text-align: center;
        vertical-align: middle;
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }

    /* Boutons dans le menu mobile */
    .auth-button,
    .logout-button,
    .admin-button {
        margin: 1rem 1.5rem;
        width: calc(100% - 3rem);
        text-align: center;
    }

    /* Overlay sombre quand menu ouvert */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }
}

/* ================================================================================================================================ */
/* --------------------------------------------------- Icône EcoCredit ------------------------------------------------------------ */
/* ================================================================================================================================ */

.ecocredit-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('/public/images/coin.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-left: 4px;
    filter: hue-rotate(90deg) saturate(1.5) brightness(1.1);
}

.ecocredit-icon-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('/public/images/coin.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-left: 4px;
    filter: hue-rotate(90deg) saturate(1.5) brightness(1.1);
}

.ecocredit-icon-lg {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('/public/images/coin.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-left: 4px;
    filter: hue-rotate(90deg) saturate(1.5) brightness(1.1);
}

/* ================================================================================================================================ */
/* --------------------------------------------------- Responsive Design ---------------------------------------------------------- */
/* ================================================================================================================================ */

/* Smartphones */
@media screen and (max-width: 768px) {
    /* Header plus compact */
    .header-container {
        padding: 1rem;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    /* Menu mobile encore plus étroit */
    .main-nav {
        width: 250px;
    }
}

/* ================================================================================================================================ */
/* -------------------------------------------------- Bouton Hero Page Accueil ---------------------------------------------------- */
/* ================================================================================================================================ */

.search-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(39, 174, 96, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.search-button::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.5s ease;
}

.search-button:hover::before {
    left: 100%;
}

.search-button:hover {
    background: rgba(39, 174, 96, 1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(39, 174, 96, 0.4);
}

.search-button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.3);
}




