/**
 * VVHB Covoiturage - Styles v2.0
 * Design moderne, minimaliste et professionnel
 */

/* ========================================
   VARIABLES CSS
   ======================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */

.vvhb-covoiturage-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    background-color: transparent;
}

/* ========================================
   SECTION SUPÉRIEURE (FORMULAIRE + RECHERCHE)
   ======================================== */

.vvhb-top-section {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .vvhb-top-section {
        grid-template-columns: 1fr;
    }
}

/* Blocs génériques */
.vvhb-form-block,
.vvhb-search-block,
.vvhb-trajets-block {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.vvhb-form-block:hover,
.vvhb-search-block:hover,
.vvhb-trajets-block:hover {
    box-shadow: var(--shadow-md);
}

.vvhb-form-block {
    padding: 32px;
}

.vvhb-search-block {
    padding: 28px;
}

.vvhb-trajets-block {
    padding: 32px;
}

/* ========================================
   TITRES
   ======================================== */

.vvhb-block-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.vvhb-block-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ========================================
   FORMULAIRE
   ======================================== */

.vvhb-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vvhb-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .vvhb-form-row {
        grid-template-columns: 1fr;
    }
}

.vvhb-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vvhb-form-group.full-width {
    grid-column: 1 / -1;
}

.vvhb-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.vvhb-form-group .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.vvhb-form-group input,
.vvhb-form-group select,
.vvhb-form-group textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    font-family: inherit;
    outline: none;
}

.vvhb-form-group input:hover,
.vvhb-form-group select:hover,
.vvhb-form-group textarea:hover {
    border-color: var(--text-light);
}

.vvhb-form-group input:focus,
.vvhb-form-group select:focus,
.vvhb-form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vvhb-form-group input::placeholder,
.vvhb-form-group textarea::placeholder {
    color: var(--text-light);
}

.vvhb-form-group textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

.vvhb-form-actions {
    margin-top: 8px;
}

/* ========================================
   BOUTONS
   ======================================== */

.vvhb-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    letter-spacing: -0.01em;
}

.vvhb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vvhb-btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.vvhb-btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.vvhb-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.vvhb-btn-search {
    background: var(--secondary-color);
    color: white;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.vvhb-btn-search:hover:not(:disabled) {
    background: var(--secondary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.vvhb-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    width: 100%;
    border: 1.5px solid var(--border-color);
}

.vvhb-btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
    color: var(--text-primary);
}

.vvhb-btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.vvhb-btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    box-shadow: var(--shadow-md);
}

.vvhb-btn-contact {
    background: var(--primary-color);
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    border: 1.5px solid var(--primary-color);
    font-weight: 500;
}

.vvhb-btn-contact:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.vvhb-btn-comment {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 13px;
    border: 1.5px solid var(--border-color);
    font-weight: 500;
}

.vvhb-btn-comment:hover:not(:disabled) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-light);
}

.vvhb-btn-delete {
    background: transparent;
    color: var(--danger-color);
    padding: 10px 16px;
    font-size: 13px;
    border: 1.5px solid var(--danger-color);
    font-weight: 500;
}

.vvhb-btn-delete:hover:not(:disabled) {
    background: var(--danger-color);
    color: white;
}

.vvhb-btn-statut {
    background: transparent;
    color: var(--primary-color);
    padding: 10px 16px;
    font-size: 13px;
    border: 1.5px solid var(--primary-color);
    font-weight: 500;
}

.vvhb-btn-statut:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.vvhb-btn-small {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--primary-color);
    color: white;
}

.vvhb-btn-small:hover:not(:disabled) {
    background: var(--primary-hover);
}

/* ========================================
   RECHERCHE
   ======================================== */

.vvhb-search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vvhb-search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vvhb-search-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.vvhb-search-group input,
.vvhb-search-group select {
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    outline: none;
}

.vvhb-search-group input:hover,
.vvhb-search-group select:hover {
    border-color: var(--text-light);
}

.vvhb-search-group input:focus,
.vvhb-search-group select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.vvhb-search-actions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vvhb-search-info {
    margin-top: 20px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(16, 185, 129, 0.05));
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.vvhb-info-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   MESSAGES
   ======================================== */

.vvhb-message {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vvhb-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.vvhb-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1.5px solid rgba(239, 68, 68, 0.3);
}

/* ========================================
   BLOC TRAJETS
   ======================================== */

.vvhb-trajets-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================================
   CARTE TRAJET
   ======================================== */

.vvhb-trajet-card {
    background: var(--bg-primary);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.vvhb-trajet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.vvhb-trajet-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.vvhb-trajet-card:hover::before {
    opacity: 1;
}

/* --- Badges de statut --- */
.vvhb-badge-statut {
    margin-left: 0;
    margin-right: 8px;
}

.vvhb-statut-disponible {
    background-color: #10b981; /* Vert */
    color: white;
}

.vvhb-statut-complet {
    background-color: #f59e0b; /* Jaune/Orange */
    color: white;
}

.vvhb-statut-termine {
    background-color: #6b7280; /* Gris */
    color: white;
}

.vvhb-trajet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid var(--border-light);
    gap: 16px;
}

.vvhb-trajet-route {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.vvhb-location {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.vvhb-arrow {
    font-size: 18px;
    color: var(--text-light);
    font-weight: 400;
}

.vvhb-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.vvhb-badge-semaine {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-sm);
}

.vvhb-trajet-body {
    margin-bottom: 20px;
}

.vvhb-trajet-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.vvhb-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.vvhb-icon {
    font-size: 16px;
    opacity: 0.8;
}

.vvhb-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.vvhb-value {
    color: var(--text-primary);
    font-weight: 500;
}

.vvhb-value.vvhb-places {
    font-weight: 700;
    color: var(--secondary-color);
}

.vvhb-contact-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    border: 1px solid var(--border-light);
}

.vvhb-contact-value {
    color: var(--text-primary);
    font-weight: 500;
}

.vvhb-trajet-comment {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
}

.vvhb-trajet-comment p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.vvhb-trajet-footer {
    padding-top: 20px;
    border-top: 1.5px solid var(--border-light);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   COMMENTAIRES
   ======================================== */

.vvhb-comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1.5px solid var(--border-light);
    animation: slideDown 0.3s ease-out;
}

.vvhb-comments-list {
    margin-bottom: 20px;
}

.vvhb-comment {
    background: var(--bg-secondary);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid var(--primary-color);
    transition: var(--transition);
}

.vvhb-comment:hover {
    background: var(--bg-tertiary);
}

.vvhb-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.vvhb-comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.vvhb-comment-date {
    font-size: 11px;
    color: var(--text-light);
}

.vvhb-comment-body p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.vvhb-comment-form {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
}

.vvhb-comment-form h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.vvhb-comment-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .vvhb-comment-inputs {
        grid-template-columns: 1fr;
    }
}

.vvhb-comment-inputs input {
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-primary);
    transition: var(--transition);
    outline: none;
}

.vvhb-comment-inputs input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vvhb-comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: var(--bg-primary);
    transition: var(--transition);
    outline: none;
    line-height: 1.5;
}

.vvhb-comment-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================
   PAGINATION
   ======================================== */

.vvhb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1.5px solid var(--border-light);
    flex-wrap: wrap;
}

.vvhb-pagination button {
    padding: 8px 14px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    min-width: 40px;
}

.vvhb-pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.vvhb-pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.vvhb-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.vvhb-pagination .vvhb-page-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0 12px;
}

/* ========================================
   LOADING
   ======================================== */

.vvhb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.vvhb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: vvhb-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes vvhb-spin {
    to { transform: rotate(360deg); }
}

.vvhb-loading p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   ÉTAT VIDE
   ======================================== */

.vvhb-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.vvhb-empty-state .vvhb-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.vvhb-empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-weight: 600;
}

.vvhb-empty-state p {
    font-size: 14px;
    margin: 0;
    color: var(--text-secondary);
}

/* ========================================
   MODAL DE CONFIRMATION
   ======================================== */

.vvhb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vvhb-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vvhb-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1.5px solid var(--border-light);
}

.vvhb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.vvhb-modal-body {
    padding: 24px;
}

.vvhb-modal-body p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.vvhb-modal-footer {
    padding: 20px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   UTILITAIRES
   ======================================== */

.vvhb-hidden {
    display: none !important;
}

.vvhb-text-center {
    text-align: center;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .vvhb-covoiturage-container {
        padding: 16px;
    }
    
    .vvhb-form-block,
    .vvhb-search-block,
    .vvhb-trajets-block {
        padding: 24px 20px;
    }
    
    .vvhb-block-title {
        font-size: 18px;
    }
    
    .vvhb-trajet-card {
        padding: 20px;
    }
    
    .vvhb-trajet-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vvhb-trajet-info {
        grid-template-columns: 1fr;
    }
    
    .vvhb-trajet-footer {
        flex-direction: column;
    }
    
    .vvhb-trajet-footer .vvhb-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .vvhb-top-section {
        gap: 16px;
    }
    
    .vvhb-form-block,
    .vvhb-search-block,
    .vvhb-trajets-block {
        padding: 20px 16px;
    }
}
