/* Styles partagés entre index.html et event.php */

.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    padding: 1.5rem;
    margin: 0;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapse-icon {
    transition: transform 0.2s ease;
    font-size: 0.9rem;
    color: #6c757d;
}

.collapsible-content {
    padding: 1.5rem;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
    padding: 0 1.5rem;
}

.address-suggestions {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

.address-suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.address-suggestion-item:hover {
    background-color: #f8f9fa;
}

.address-suggestion-item.selected {
    background-color: #a65902;
    color: white;
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-icon {
    margin-right: 10px;
    color: #6c757d;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.address-suggestion-icon .fas,
.address-suggestion-icon .fa-solid,
.address-suggestion-icon .fa-regular {
    color: #6c757d !important;
}

.address-suggestion-item.selected .address-suggestion-icon {
    color: white;
}

.address-suggestion-item:hover .address-suggestion-icon .fas,
.address-suggestion-item:hover .address-suggestion-icon .fa-solid,
.address-suggestion-item:hover .address-suggestion-icon .fa-regular,
.address-suggestion-item.selected .address-suggestion-icon .fas,
.address-suggestion-item.selected .address-suggestion-icon .fa-solid,
.address-suggestion-item.selected .address-suggestion-icon .fa-regular {
    color: white !important;
}

.address-suggestion-text {
    flex: 1;
    line-height: 1.4;
}

.address-suggestion-details {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.address-suggestion-item.selected .address-suggestion-details {
    color: rgba(255, 255, 255, 0.85);
}

.ride-card,
.conversation-card,
.message-item {
    border: 2px solid #a65902 !important;
    border-radius: 8px !important;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(212, 160, 23, 0.1);
}

.ride-card:hover,
.conversation-card:hover,
.message-item:hover {
    border-color: #8b4513 !important;
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.25);
    transform: translateY(-2px);
}

.ride-card.bordered {
    border: 2px solid #a65902 !important;
}

.ride-card.bordered:hover {
    border-color: #8b4513 !important;
}

.bordered {
    border: 2px solid #a65902 !important;
    border-radius: 8px !important;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(212, 160, 23, 0.1);
}

/* ============================================================
   Bouton d'ouverture de la carte (icône dans l'input adresse)
   ============================================================ */
.address-search-container {
    position: relative;
}

.address-search-container .form-control {
    padding-right: 42px;
}

.map-trigger-btn {
    position: absolute;
    /* Centrage vertical sur l'input : .address-suggestions est en
       position: absolute, donc la hauteur du conteneur = hauteur de
       l'input. Le centre tombe pile sur l'input. */
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    height: calc(1em + 16px);
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #a65902;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
    z-index: 2;
}

.map-trigger-btn:hover,
.map-trigger-btn:focus {
    background: rgba(166, 89, 2, 0.1);
    color: #8b4513;
    outline: none;
}

/* ============================================================
   Modale carte (carte plein écran déclenchée par .map-trigger-btn)
   ============================================================ */
.map-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.map-modal-body {
    padding: 0;
    flex: 1;
    min-height: 60vh;
    display: flex;
    overflow: hidden;
    max-height: none;
}

.map-modal-body > div[id$="map"],
.map-modal-body > div[id$="-map"],
.map-modal-body > #map,
.map-modal-body > #map-activation,
.map-modal-body > iframe {
    flex: 1;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border-radius: 0 0 12px 12px;
}

.map-modal-body > iframe {
    border: 0;
}

.map-modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #dee2e6;
    text-align: right;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.modal button .fas,
.modal button .fa-solid,
.modal button .fa-regular {
    color: white !important;
}

@media (max-width: 600px) {
    .map-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .map-modal-body > div[id$="map"],
    .map-modal-body > div[id$="-map"],
    .map-modal-body > #map,
    .map-modal-body > #map-activation,
    .map-modal-body > iframe {
        height: calc(100vh - 120px);
        border-radius: 0;
    }
}

.bordered:hover {
    border-color: #8b4513 !important;
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.25);
    transform: translateY(-1px);
}

.char-count-warning {
    color: #dc3545;
    font-weight: bold;
}

.char-count-normal {
    color: #6c757d;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.5rem;
}

.lang-switch button {
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #5a5a5a;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.24rem 0.5rem;
    cursor: pointer;
}

.lang-switch .lang-flag-img {
    display: block;
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}

.lang-switch button.active {
    background: #a65902;
    border-color: #a65902;
    color: #fff;
}

.lang-switch-floating {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    background: #fff;
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
