/* css/cf7-mr-selector.css */

.cf7-mondial-relay-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Messages d'erreur */
.mr-error {
    padding: 15px;
    background: #ffe6e6;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #721c24;
}

.mr-error strong {
    display: block;
    margin-bottom: 5px;
}

/* Groupe de recherche */
.mr-search-group {
    margin-bottom: 20px;
}

.mr-search-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mr-search-group label .required {
    color: #dc3545;
    margin-left: 3px;
}

.mr-postal-code {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    width: 200px;
    margin-right: 10px;
    transition: border-color 0.3s;
}

.mr-postal-code:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.mr-search-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s, transform 0.1s;
    font-weight: 600;
}

.mr-search-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.mr-search-btn:active {
    transform: translateY(0);
}

/* Loader / Spinner */
.mr-loader {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 6px;
    margin: 20px 0;
}

.mr-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mr-loader p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Conteneur du widget */
#mr-widget-container {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Zone d'affichage du point relais sélectionné */
#mr-selected-display {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e7f5e7 0%, #d4edda 100%);
    border-left: 4px solid #28a745;
    border-radius: 4px;
    animation: slideInFromTop 0.5s ease-out;
}

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

#mr-selected-display h4 {
    margin-top: 0;
    color: #155724;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mr-selected-parcel {
    padding: 15px;
    background: white;
    border-radius: 4px;
    margin: 15px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mr-selected-parcel p {
    margin: 8px 0;
    line-height: 1.6;
}

.mr-selected-parcel strong {
    color: #0073aa;
    font-size: 1.1em;
    display: block;
}

.mr-selected-parcel .mr-id {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* Bouton pour changer de point relais */
.mr-change-btn {
    padding: 8px 15px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-top: 10px;
}

.mr-change-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Styling du widget Mondial Relay */
#MondialRelayWidget {
    min-height: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .cf7-mondial-relay-container {
        padding: 15px;
    }
    
    .mr-postal-code {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .mr-search-btn {
        width: 100%;
    }
    
    .mr-selected-parcel {
        padding: 12px;
    }
    
    #mr-selected-display h4 {
        font-size: 16px;
    }
}

/* Amélioration de l'accessibilité */
.mr-search-btn:focus,
.mr-change-btn:focus,
.mr-postal-code:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Animation de chargement alternative si le spinner ne fonctionne pas */
.mr-loader::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
}

/* Style pour les messages de validation CF7 */
.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* Ajustements pour le widget Mondial Relay */
.MR-Widget {
    font-family: inherit !important;
}

.MR-Widget .btn-primary {
    background-color: #0073aa !important;
    border-color: #0073aa !important;
}

.MR-Widget .btn-primary:hover {
    background-color: #005a87 !important;
    border-color: #005a87 !important;
}
