/**
 * Styles pour le suivi de commande client avec carte en temps réel
 */

/* Conteneur principal */
.scc-tracking-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* En-tête */
.scc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.scc-header h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

/* Badge de statut */
.scc-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Statuts WooCommerce avec couleurs appropriées */
.scc-status-badge.status-pending {
    background: #f1c40f;
    color: #fff;
}

.scc-status-badge.status-processing {
    background: #e74c3c;
    color: #fff;
    animation: pulse 2s infinite;
}

.scc-status-badge.status-on-hold {
    background: #3498db;
    color: #fff;
}

.scc-status-badge.status-ready-delivery {
    background: #9b59b6;
    color: #fff;
}

.scc-status-badge.status-awaiting-driver {
    background: #f39c12;
    color: #fff;
    animation: pulse 2s infinite;
}

.scc-status-badge.status-out-for-delivery {
    background: #e67e22;
    color: #fff;
    animation: pulse 2s infinite;
}

.scc-status-badge.status-completed {
    background: #27ae60;
    color: #fff;
}

.scc-status-badge.status-cancelled,
.scc-status-badge.status-failed,
.scc-status-badge.status-refunded {
    background: #95a5a6;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Panneau d'informations */
.scc-info-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.scc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.scc-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.scc-info-item .scc-icon {
    font-size: 24px;
    min-width: 24px;
}

.scc-info-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.scc-info-item .scc-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scc-info-item .scc-value {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
}

/* Badge de statut WooCommerce style */
.scc-info-item mark.order-status {
    background: none;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: inline-block;
    text-transform: none;
    line-height: 1.5;
}

/* Statuts avec couleurs WooCommerce */
mark.order-status.status-pending {
    background: #f8dda7;
    color: #94660c;
}

mark.order-status.status-processing {
    background: #c8d7e1;
    color: #2e4453;
}

mark.order-status.status-on-hold {
    background: #f8dda7;
    color: #94660c;
}

mark.order-status.status-ready-delivery {
    background: #d7cad2;
    color: #6f4e5c;
}

mark.order-status.status-awaiting-driver {
    background: #ffd5a0;
    color: #b36a00;
}

mark.order-status.status-out-for-delivery {
    background: #ffba00;
    color: #664400;
    animation: pulse-delivery 2s infinite;
}

mark.order-status.status-completed {
    background: #c8d7e1;
    color: #2e4453;
}

mark.order-status.status-cancelled,
mark.order-status.status-failed {
    background: #eba3a3;
    color: #761919;
}

mark.order-status.status-refunded {
    background: #c8d7e1;
    color: #2e4453;
}

@keyframes pulse-delivery {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.75;
    }
}

/* Panneau d'informations - ancien style gardé pour compatibilité */
    margin-bottom: 20px;
}

.scc-info-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.scc-info-item:last-child {
    border-bottom: none;
}

.scc-info-item .scc-icon {
    font-size: 24px;
    margin-right: 10px;
    min-width: 30px;
}

.scc-info-item .scc-label {
    font-weight: 600;
    color: #555;
    margin-right: 8px;
}

.scc-info-item .scc-value {
    color: #2c3e50;
    flex: 1;
}

/* Carte */
#scc-map {
    border: 2px solid #ecf0f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Marqueurs personnalisés */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: bounce 1s ease-in-out infinite;
}

.livreur-marker .marker-pin.animated {
    animation: bounce 2s ease-in-out infinite;
    /* Rotation supprimée pour éviter que le scooter se retourne */
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation de rotation supprimée - le scooter ne tourne plus sur lui-même */

/* Légende */
.scc-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.scc-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

.scc-legend-item .scc-marker {
    font-size: 20px;
}

.scc-legend-item .scc-line {
    width: 30px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
    position: relative;
}

.scc-legend-item .scc-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, transparent 40%, #3498db 40%, #3498db 60%, transparent 60%);
    background-size: 20px 100%;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        background-position: 20px 0;
    }
}

/* Pied de page */
.scc-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
}

.scc-refresh-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #7f8c8d;
    margin: 5px 0;
}

.scc-last-update {
    font-size: 12px;
    color: #95a5a6;
    margin: 5px 0;
}

/* Erreurs et messages */
.scc-error,
.scc-login-required {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.scc-error p,
.scc-login-required p {
    color: #e74c3c;
    font-size: 16px;
    margin-bottom: 20px;
}

.scc-login-required .button {
    display: inline-block;
    padding: 12px 24px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.scc-login-required .button:hover {
    background: #2980b9;
}

/* Responsive */
@media (max-width: 768px) {
    .scc-tracking-container {
        padding: 15px;
        margin: 10px;
    }
    
    .scc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .scc-header h2 {
        font-size: 20px;
    }
    
    .scc-info-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #scc-map {
        height: 400px !important;
    }
    
    .scc-legend {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .scc-header h2 {
        font-size: 18px;
    }
    
    #scc-map {
        height: 350px !important;
    }
    
    .scc-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Popup Leaflet personnalisé */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
}

.leaflet-popup-content b {
    color: #2c3e50;
    font-size: 15px;
}

/* Animation de chargement */
.scc-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.scc-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Sélecteur de commandes */
.scc-order-selector {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.scc-order-selector h2 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 28px;
}

.scc-order-selector > p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
}

.scc-orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.scc-order-card {
    background: #f8f9fa;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.scc-order-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.scc-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.scc-order-header h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

/* Badge de statut dans les cartes de commande - Style WooCommerce */
.scc-order-card mark.order-status {
    background: none;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    text-transform: none;
    line-height: 1.5;
}

.scc-order-card mark.order-status.status-pending {
    background: #f8dda7;
    color: #94660c;
}

.scc-order-card mark.order-status.status-processing {
    background: #c8d7e1;
    color: #2e4453;
}

.scc-order-card mark.order-status.status-on-hold {
    background: #f8dda7;
    color: #94660c;
}

.scc-order-card mark.order-status.status-ready-delivery {
    background: #d7cad2;
    color: #6f4e5c;
}

.scc-order-card mark.order-status.status-awaiting-driver {
    background: #ffd5a0;
    color: #b36a00;
}

.scc-order-card mark.order-status.status-out-for-delivery {
    background: #ffba00;
    color: #664400;
}

.scc-order-card mark.order-status.status-out-for-delivery {
    background: #ffba00;
    color: #664400;
}

.scc-order-details {
    margin-bottom: 15px;
}

.scc-order-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.scc-order-info .label {
    color: #7f8c8d;
    font-weight: 500;
}

.scc-order-info .value {
    color: #2c3e50;
    font-weight: 600;
}

.scc-track-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.scc-track-button:hover {
    background: #2980b9;
    color: #fff;
}

.scc-track-button .icon {
    font-size: 20px;
}

/* Message "Aucune commande" */
.scc-no-orders {
    max-width: 500px;
    margin: 60px auto;
    padding: 60px 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.scc-no-orders-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.scc-no-orders h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.scc-no-orders p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

.scc-no-orders .button {
    display: inline-block;
    padding: 12px 30px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.scc-no-orders .button:hover {
    background: #2980b9;
    color: #fff;
}
