/*===========================================
  PLATEFORME DE SUIVI DES EXPÉDITIONS
  Style moderne et responsive
  
  IMPORTANT: Ces styles s'appliquent UNIQUEMENT
  à la page de suivi (body.body-suivi)
===========================================*/

/* ===== Protection contre les conflits ===== */
/* S'assurer que ces styles n'affectent QUE la page de suivi */

/* ===== Variables CSS ===== */
:root {
    --logistiq-base: #FD5523;
    --secondary-color: #007bff;
    --success-color: #4cb610;
    --danger-color: #ff0000;
    --dark-bg: #1f1f2e;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

/* ===== Styles généraux - UNIQUEMENT pour la page de suivi ===== */
body.body-suivi {
    background-color: var(--light-bg);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* ===== Protection contre les conflits ===== */
/* S'assurer que les styles de suivi n'affectent que la page de suivi */
/* Les styles ci-dessous sont isolés avec le sélecteur body.body-suivi */

/* ===== Section de recherche ===== */
body.body-suivi .search-section {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2d2d45 100%);
    padding: 60px 0;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--white);
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.search-form-container {
    width: 100%;
}

.tracking-form {
    width: 100%;
}

.input-group-tracking {
    display: flex;
    gap: 12px;
    width: 100%; 
    max-width: 600px;
    margin: 0 auto;
}

.input-tracking {
    flex: 1;
    padding: 18px 24px;
    font-size: 16px;
    border: 2px solid transparent;
    border-radius: 50px;
    background: var(--white);
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.input-tracking:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.input-tracking::placeholder {
    color: var(--text-muted);
}

.btn-tracking {
    padding: 18px 36px;
    background: var(--logistiq-base);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.btn-tracking:hover {
    background: #e63f00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-tracking i {
font-size: 20px;
}

/* ===== Section des résultats ===== */
.tracking-results-section {
    padding: 35px 0;
}

/* ===== Alerte frais de magasinage ===== */
.alert-storage-fees {
display: flex;
align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border: 2px solid rgba(255, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 24px 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}

.alert-icon {
    font-size: 32px;
    color: var(--danger-color);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

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

.alert-content p {
    margin: 0;
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.6;
}

.alert-content strong {
    color: var(--danger-color);
    font-weight: 700;
}

/* ===== Bouton Télécharger Facture ===== */
.download-invoice-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 40px;
}

.btn-download-invoice {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--logistiq-base) 0%, #e63f00 100%);
    color: var(--white);
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-download-invoice:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(253, 85, 35, 0.4);
    color: var(--white);
}

.btn-download-invoice:active {
    transform: translateY(-1px);
}

.btn-download-invoice i:first-child {
    font-size: 22px;
}

.btn-download-invoice i:last-child {
    font-size: 20px;
    animation: downloadPulse 2s ease-in-out infinite;
}

@keyframes downloadPulse {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

/* ===== Grille d'informations ===== */
.tracking-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* ===== Cards ===== */
.info-card,
.location-card,
.success-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.info-card:hover,
.location-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
    display: flex;
        align-items: center;
    gap: 12px;
}

.card-title i {
    color: var(--secondary-color);
    font-size: 28px;
}

/* ===== Liste d'informations ===== */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

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

.info-item i {
    color: var(--logistiq-base);
    font-size: 18px;
}

.info-label {
    color: var(--text-muted);
    font-size: 15px;
}

.info-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
    text-align: right;
}

/* ===== Carte de localisation ===== */
.map-wrapper {
    width: 100%;
    height: 467px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--secondary-color);
}

.map-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.map-placeholder {
    width: 100%;
    height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: var(--text-dark);
text-align: center;
    padding: 40px;
}

.map-placeholder i {
    font-size: 64px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.map-placeholder h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.map-placeholder p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.map-placeholder small {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Card de succès (colis retiré) ===== */
.success-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid var(--success-color);
}

.success-content {
    text-align: center;
}

.success-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--success-color);
    margin-bottom: 16px;
}

.success-subtitle {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.success-message {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.company-name {
    color: var(--logistiq-base);;
    font-weight: 700;
}

.success-animation {
    margin-top: 20px;
}

.success-animation img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

/* ===== Section de progression ===== */
.progress-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.progress-main-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-main-title i {
    color: var(--primary-color);
    font-size: 32px;
}

/* ===== Barre de progression ===== */
.progress-tracking-container {
    width: 100%;
    margin-bottom: 50px;
}

.progress-bar-wrapper {
    position: relative;
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 50px;
    overflow: visible;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, #00c6ff 100%);
    border-radius: 50px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

.progress-percentage-badge {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--logistiq-base);
    color: var(--white);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

/* ===== Conteneur des étapes ===== */
.journey-steps-container {
    margin-top: 80px !important;
}

/* Alignement des étapes de gauche à droite */
.journey-steps-container {
    justify-content: flex-start;
}

/* ===== Carte d'étape ===== */
.journey-step {
    position: relative;
    background: var(--white);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 380px;
    height: 100%;
    width: 100%;
}

.journey-step:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* ===== Badge du numéro d'étape ===== */
.step-badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

/* ===== Icône d'étape ===== */
.step-icon-wrapper {
    margin: 5px 0 10px;
}

.step-animation {
    max-height: 120px;
    width: auto;
    object-fit: contain;
}

/* ===== Titre de l'étape ===== */
.step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--logistiq-base);
    margin-bottom: 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Liste de vérification ===== */
.step-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    flex-grow: 1;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-dark);
}

.checklist-item i {
    color: var(--success-color);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-item span {
    line-height: 1.5;
}

/* ===== Bouton WhatsApp flottant ===== */
body.body-suivi .whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
}

body.body-suivi .whatsapp-float.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    animation: bounce 2s ease-in-out infinite;
}

body.body-suivi .whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 40px rgba(37, 211, 102, 0.4);
}

body.body-suivi .whatsapp-float img {
    width: 40px;
    height: 40px;
}

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

/* ===== Responsive Design ===== */

/* Tablettes */
@media screen and (max-width: 992px) {
    .search-section {
        padding: 50px 0;
    }

    .journey-steps-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .progress-section {
        padding: 30px 20px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .search-section {
        padding: 40px 0;
    }

    .search-title {
        margin-bottom: 30px;
    }

    .input-group-tracking {
        flex-direction: column;
        gap: 16px;
    }

    .btn-tracking {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }

    .tracking-results-section {
        padding: 40px 0;
    }

    .alert-storage-fees {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .alert-content p {
        font-size: 14px;
    }

    .download-invoice-wrapper {
        justify-content: center;
    }

    .btn-download-invoice {
        padding: 14px 24px;
        font-size: 16px;
        gap: 10px;
    }

    .btn-download-invoice i:first-child {
        font-size: 20px;
    }

    .btn-download-invoice i:last-child {
    font-size: 18px;
}

    .tracking-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-card,
    .location-card,
    .success-card {
        padding: 24px;
    }

    .card-title {
        font-size: 20px;
    }

    .info-item {
        grid-template-columns: 18px 1fr auto;
        gap: 8px;
        padding: 8px 0;
    }

    .info-item i {
        font-size: 14px;
    }

    .info-label {
        font-size: 13px;
    }

    .info-value {
        font-size: 13px;
        text-align: right;
    }

    .map-wrapper {
        height: 300px;
    }

    .success-title {
        font-size: 28px;
    }

    .success-subtitle {
        font-size: 20px;
    }

    .progress-section {
        padding: 24px 16px;
    }

    .progress-main-title {
        font-size: 22px;
    }

    .progress-percentage-badge {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }

    .journey-steps-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .journey-step {
        min-height: 320px;
    }

    .step-animation {
        max-height: 100px;
    }

    .step-title {
    font-size: 18px;
        min-height: auto;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float img {
        width: 28px;
        height: 28px;
    }
}

/* Très petits écrans */
@media screen and (max-width: 480px) {
    .search-title {
        font-size: 1.3rem;
    }

    .input-tracking {
        padding: 14px 20px;
        font-size: 14px;
    }

    .btn-tracking {
        padding: 14px 20px;
        font-size: 16px;
    }

    .btn-download-invoice {
        padding: 12px 20px;
        font-size: 15px;
        gap: 8px;
    }

    .btn-download-invoice i:first-child {
        font-size: 18px;
    }

    .btn-download-invoice i:last-child {
        font-size: 16px;
    }

    .info-card,
    .location-card,
    .success-card {
        padding: 20px;
    }

    .card-title {
        font-size: 18px;
    }

    .info-item {
        grid-template-columns: 16px 1fr auto;
        gap: 6px;
        padding: 7px 0;
    }

    .info-item i {
        font-size: 12px;
    }

    .info-label {
        font-size: 12px;
    }

    .info-value {
        font-size: 12px;
        font-weight: 600;
    }

    .progress-section {
        padding: 20px 12px;
    }

    .journey-step {
        padding: 20px;
        min-height: 300px;
    }
}

/* ===== Animations d'entrée ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card,
.location-card,
.journey-step {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Accessibilité ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Impression ===== */
@media print {
    .search-section,
    .whatsapp-float,
    .btn-tracking {
        display: none;
    }

    .tracking-info-grid {
        display: block;
    }

    .info-card,
    .location-card,
    .progress-section {
        box-shadow: none;
        border: 1px solid var(--border-color);
        page-break-inside: avoid;
    }
}
