/**
 * ============================================
 * COVOITURAGE MATHEYSINE - STYLE PRINCIPAL
 * Design moderne, sobre et responsive
 * ============================================
 */

/* ============================================
   VARIABLES CSS - PALETTE HARMONIEUSE
   ============================================ */
:root {
    /* Couleurs principales */
    --mint: #daf5ee;
    --blue: #d2e4f8;
    --teal: #458f9a;
    --coral: #ee684e;
    --gold: #eab15a;

    /* Variations */
    --teal-dark: #367179;
    --teal-light: #5ba8b5;
    --coral-dark: #d94e34;
    --gold-dark: #d89f45;

    /* Neutres */
    --white: #ffffff;
    --off-white: #fafbfc;
    --gray-50: #f5f7f9;
    --gray-100: #e8ecef;
    --gray-200: #d1d8dd;
    --gray-300: #b4bec7;
    --gray-400: #8897a5;
    --gray-500: #6c7b88;
    --gray-600: #495560;
    --gray-700: #2d3843;
    --gray-800: #1a2229;

    /* Sémantique */
    --success: #52c795;
    --success-bg: #d4f4e6;
    --warning-bg: #fdf3e4;
    --danger-bg: #fde8e4;
    --info-bg: #e3f3f5;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(45, 56, 67, 0.08);
    --shadow: 0 4px 12px rgba(45, 56, 67, 0.1);
    --shadow-lg: 0 8px 24px rgba(45, 56, 67, 0.12);
    --shadow-xl: 0 16px 40px rgba(45, 56, 67, 0.15);

    /* Dégradés */
    --gradient-teal: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    --gradient-warm: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
    --gradient-soft: linear-gradient(135deg, var(--mint) 0%, var(--blue) 100%);

    /* Espacements */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Bordures */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--off-white);
    color: var(--gray-700);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHIE
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-800);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--gray-600);
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--teal-dark);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo i {
    color: var(--coral);
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background-color: var(--teal);
}

.nav-link i {
    margin-right: var(--space-xs);
}

/* Menu hamburger mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--teal);
    cursor: pointer;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    /*background: var(--gradient-soft);*/
    background: var(--gradient-soft);
  


    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    opacity: 0.1;
    z-index: 0;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--teal-dark);
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: var(--space-2xl);
}

/* ============================================
   FORMULAIRE DE RECHERCHE
   ============================================ */
.search-box {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: var(--space-2xl) auto;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}
.espace-form {
   height: 100%;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.form-group label i {
    color: var(--teal);
}

.form-input,
.form-select {
    padding: 12px 16px;
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
    color: var(--gray-700);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(69, 143, 154, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* ============================================
   BOUTONS
   ============================================ */
.btn {
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.btn-primary {
    background: var(--gold-dark);
    color: var(--white);
}

.btn-primary:hover {
    cursor: pointer;
    background: var(--teal-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--white);
}

.btn-coral {
    background: var(--coral);
    color: var(--white);
}

.btn-coral:hover {
    background: var(--coral-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: var(--coral-dark);
    color: var(--white);
    
}

.btn-outline:hover {
    background: var(--teal);
    color: var(--white);
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
}

.btn-gold:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-block {
    width: 100%;
   
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ============================================
   CARTES (CARDS)
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.section {
    padding: var(--space-3xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-2xl);
    color: var(--gray-800);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--gray-100);
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
    border-color: var(--teal);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--gray-50);
}

.card-title {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    margin-bottom: var(--space-md);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 2px solid var(--gray-50);
}

/* Carte de trajet */
.trajet-card {
    position: relative;
}

.trajet-route {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.trajet-route .city {
    font-weight: 600;
    color: var(--teal);
    font-size: 1.1rem;
}

.trajet-route .arrow {
    color: var(--gray-400);
    font-size: 1.5rem;
}

.trajet-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.trajet-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--gray-600);
    font-size: 0.9rem;
}

.trajet-info-item i {
    color: var(--teal);
}

.trajet-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--coral);
}

.trajet-price small {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-teal {
    background: var(--teal);
    color: white;
}

.badge-coral {
    background: var(--danger-bg);
    color: var(--coral);
}

.badge-gold {
    background: var(--warning-bg);
    color: var(--gold-dark);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

/* ============================================
   ALERTES
   ============================================ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid;
    width: fit-content;
}

.alert i {
    font-size: 1.25rem;
}

.alert-success {
    background: var(--gold);
    color: #1e6e4a;
    border-color: var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    color: #856404;
    border-color: var(--gold);
}

.alert-danger {
    background: var(--danger-bg);
    color: #c13a28;
    border-color: var(--coral);
}

.alert-info {
    background: var(--info-bg);
    color: var(--teal-dark);
    border-color: var(--teal);
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-container {
    max-width: 500px;
    margin: var(--space-2xl) auto;
    background: var(--white);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.form-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.form-header h2 {
    color: var(--gray-800);
    margin-bottom: var(--space-sm);
}

.form-header p {
    color: var(--gray-500);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}


.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.form-link {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--gray-600);
}

.form-link a {
    color: var(--teal);
    font-weight: 600;
}

/* ============================================
   PROFIL UTILISATEUR
   ============================================ */
.profile-header {
    background: var(--gradient-soft);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    background: var(--gradient-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    color: var(--white);
    font-size: 3rem;
    font-weight: 700;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-lg);
}

.profile-name {
    font-size: 2rem;
    color: var(--gray-800);
    margin-bottom: var(--space-sm);
}

.profile-email {
    color: var(--gray-600);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.stat-box {
    text-align: center;
    padding: var(--space-lg);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--teal);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ============================================
   MESSAGERIE
   ============================================ */
.messages-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-lg);
    height: calc(100vh - 200px);
}

.conversations-list {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
}

.conversation-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.conversation-item:hover {
    background: var(--gray-50);
}

.conversation-item.active {
    background: var(--teal);
    border-color: var(--teal-dark);
}

.conversation-item.active .name,
.conversation-item.active .preview,
.conversation-item.active .time {
    color: white;
}

.conversation-item .name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
}

.conversation-item .preview {
    font-size: 0.9rem;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-area {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.message-header {
    padding: var(--space-lg);
    border-bottom: 2px solid var(--gray-50);
}

.message-body {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
}

.message-bubble {
    max-width: 70%;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.message-bubble.sent {
    background: var(--teal);
    color: var(--white);
    margin-left: auto;
    border-bottom-right-radius: var(--space-xs);
}

.message-bubble.received {
    background: var(--gray-50);
    color: var(--gray-700);
    border-bottom-left-radius: var(--space-xs);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: var(--space-xs);
}

.message-input-area {
    padding: var(--space-lg);
    border-top: 2px solid var(--gray-50);
    display: flex;
    gap: var(--space-md);
}

.message-input-area textarea {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    resize: none;
    font-family: inherit;
}

.message-input-area textarea:focus {
    outline: none;
    border-color: var(--teal);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: var(--space-3xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: var(--space-lg);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--space-sm);
}

.footer-section a {
    color: var(--gray-300);
    transition: color var(--transition);
}

.footer-section a:hover {
    color: var(--teal-light);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    margin-top: var(--space-xl);
    border-top: 1px solid var(--gray-700);
    color: var(--gray-400);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    margin-bottom: var(--space-lg);
}

.modal-header h3 {
    color: var(--gray-800);
}

.modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .header-container {
        padding: var(--space-md) var(--space-lg);
    
    }
 

    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-2xl);
        box-shadow: var(--shadow-xl);
        transition: left var(--transition);
        z-index: 999;
    }

    .nav.active {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .messages-container {
        grid-template-columns: 1fr;
    }

    .conversations-list {
        display: none;
    }

    .message-bubble {
        max-width: 85%;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .container {
        padding: var(--space-lg);
    }
}
@media (max-width: 1400px) {
    nav {
        font-size: 10px;
    }

   
}
@media (max-width: 480px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .form-container {
        padding: var(--space-lg);
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .card {
        padding: var(--space-md);
    }


    
      
    #trajetForm {
        display:flex;
        flex-direction:column;
        gap:var(--space-lg);
        justify-content: center;
        align-items: center;
        width: 100%;
        border: none;
        box-shadow: none;
        background-color: transparent;
      
        }
    #usertrajet {
        border: none;
        box-shadow: none;
        background-color: transparent;

    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   UTILITAIRES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none; }
.flex { display: flex; }
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
