/*
 * IGLOUPS RELEVÉS - STYLES DES SHORTCODES
 * Fichier CSS pour remplacer tous les styles inline
 * Version: 1.0.0
 * Auteur: Refactoring Étape 1
 */

/* ========================================
   🎯 CONTENEURS PRINCIPAUX
========================================= */

/* Remplace: style="background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);" */
.igloups-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Container principal pour les formulaires */
.igloups-form-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   🔔 MESSAGES ET ALERTES
========================================= */

/* Base pour tous les messages */
.igloups-message {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideInDown 0.5s ease-out;
}

/* Messages de succès */
.igloups-message--success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

/* Messages d'erreur */
.igloups-message--error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

/* Messages d'avertissement */
.igloups-message--warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
    text-align: center;
}

/* Messages d'information */
.igloups-message--info {
    background: #f0f8ff;
    color: #0056b3;
    border-color: #0056b3;
}

/* Contenu des messages avec icônes */
.igloups-message__content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.igloups-message__icon {
    font-size: 24px;
}

.igloups-message__text h3 {
    margin: 0 0 5px 0;
}

.igloups-message__text p {
    margin: 0;
    font-size: 16px;
}

.igloups-message__text small {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
    display: block;
}

/* ========================================
   👤 INFORMATIONS UTILISATEUR
========================================= */

.igloups-user-info {
    background: #f0f8ff;
    padding: 1em;
    border-radius: 4px;
    margin-bottom: 1.5em;
    border-left: 4px solid #0056b3;
}

.igloups-user-info__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* ========================================
   📊 BARRE DE PROGRESSION (ÉTAPES)
========================================= */

.igloups-steps-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.igloups-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.igloups-step-circle {
    background: #007cba;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    z-index: 2;
}

.igloups-step-text {
    font-size: 12px;
    text-align: center;
    color: #666;
    font-weight: 500;
}

.igloups-step-item--active .igloups-step-circle {
    background: #28a745;
}

.igloups-step-item--active .igloups-step-text {
    color: #28a745;
    font-weight: 600;
}

/* ========================================
   🌡️ AFFICHAGE TEMPÉRATURES
========================================= */

.igloups-temp-display {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.igloups-temp-card {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.igloups-temp-card--air {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

.igloups-temp-card--water {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.igloups-temp-label {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.9;
    font-weight: 600;
}

.igloups-temp-value {
    font-size: 2.5em;
    font-weight: bold;
}

/* ========================================
   📍 GÉOLOCALISATION
========================================= */

.igloups-location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

.igloups-location-field {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.igloups-location-icon {
    width: 25px;
    margin-right: 10px;
}

.igloups-location-label {
    font-weight: 600;
    min-width: 80px;
    margin-right: 10px;
}

.igloups-location-value {
    color: #2c3e50;
    font-weight: 500;
}

.igloups-map-container {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.igloups-map-title {
    margin: 0 0 10px 0;
    font-weight: 600;
}

/* ========================================
   📋 LISTES DE RELEVÉS
========================================= */

.igloups-releves-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.igloups-releves-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #007cba;
    padding-bottom: 15px;
}

.igloups-releves-title {
    color: #2c3e50;
    margin: 0;
}

.igloups-releves-counter {
    color: #666;
    font-size: 0.9em;
}

.igloups-releve-item {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
    transition: all 0.3s ease;
}

.igloups-releve-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.igloups-releve-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.igloups-releve-content {
    flex: 1;
    min-width: 250px;
}

.igloups-releve-temp-main {
    margin-bottom: 8px;
}

.igloups-releve-temp-value {
    font-size: 20px;
    color: #2c3e50;
    font-weight: bold;
}

.igloups-releve-temp-label {
    margin-left: 15px;
    color: #666;
    font-size: 14px;
}

.igloups-releve-temp-air {
    color: #888;
    margin-left: 15px;
    font-size: 0.9em;
}

.igloups-releve-location {
    margin-bottom: 8px;
}

.igloups-releve-location-name {
    font-weight: bold;
}

.igloups-releve-meta {
    font-size: 13px;
    color: #888;
}

.igloups-releve-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.igloups-releve-id {
    color: #999;
    font-size: 0.8em;
}

.igloups-releve-comment {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
}

/* ========================================
   🔲 SECTIONS DE FORMULAIRES
========================================= */

.igloups-form-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #4a90e2;
}

.igloups-form-title {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.igloups-visibility-options {
    background: #f0f8ff;
    padding: 1em;
    border-radius: 4px;
    margin: 1em 0;
}

.igloups-visibility-title {
    margin-top: 0;
    color: #0056b3;
}

.igloups-help-text {
    background: #f9f9f9;
    padding: 1em;
    border-radius: 4px;
    margin: 1em 0;
    font-size: 0.9em;
    color: #666;
}

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

.igloups-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
}

.igloups-btn--primary {
    background: #007cba;
    color: white;
}

.igloups-btn--primary:hover {
    background: #005a87;
    color: white;
}

.igloups-btn--success {
    background: #28a745;
    color: white;
}

.igloups-btn--success:hover {
    background: #1e7e34;
    color: white;
}

.igloups-btn--secondary {
    background: #6c757d;
    color: white;
}

.igloups-btn--secondary:hover {
    background: #545b62;
    color: white;
}

.igloups-btn--info {
    background: #17a2b8;
    color: white;
}

.igloups-btn--info:hover {
    background: #117a8b;
    color: white;
}

.igloups-btn--geo {
    background: #0056b3;
    color: white;
    margin-bottom: 1em;
}

.igloups-btn--small {
    padding: 6px 12px;
    font-size: 0.875em;
}

.igloups-btn--large {
    padding: 12px 25px;
    font-size: 1.1em;
}

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

.igloups-pagination {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.igloups-pagination__controls {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.igloups-pagination__link {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.igloups-pagination__link:hover {
    background: #e9ecef;
    color: #333;
}

.igloups-pagination__link--active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.igloups-pagination__info {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* ========================================
   🎨 ANIMATIONS
========================================= */

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

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

.igloups-message--fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

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

@media (max-width: 768px) {
    .igloups-location-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .igloups-temp-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .igloups-releve-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .igloups-releve-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .igloups-steps-progress {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .igloups-step-item {
        min-width: 120px;
    }
    
    .igloups-pagination__controls {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .igloups-releves-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .igloups-form-container {
        padding: 15px;
    }
    
    .igloups-form-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .igloups-btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .igloups-temp-value {
        font-size: 2em;
    }
    
    .igloups-message {
        padding: 15px;
    }
    
    .igloups-message__content {
        flex-direction: column;
        text-align: center;
    }
}

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

.igloups-text-center { text-align: center; }
.igloups-text-right { text-align: right; }
.igloups-text-left { text-align: left; }

.igloups-mb-1 { margin-bottom: 0.5rem; }
.igloups-mb-2 { margin-bottom: 1rem; }
.igloups-mb-3 { margin-bottom: 1.5rem; }
.igloups-mb-4 { margin-bottom: 2rem; }

.igloups-mt-1 { margin-top: 0.5rem; }
.igloups-mt-2 { margin-top: 1rem; }
.igloups-mt-3 { margin-top: 1.5rem; }
.igloups-mt-4 { margin-top: 2rem; }

.igloups-p-1 { padding: 0.5rem; }
.igloups-p-2 { padding: 1rem; }
.igloups-p-3 { padding: 1.5rem; }
.igloups-p-4 { padding: 2rem; }

.igloups-text-primary { color: #007cba; }
.igloups-text-success { color: #28a745; }
.igloups-text-danger { color: #dc3545; }
.igloups-text-warning { color: #ffc107; }
.igloups-text-info { color: #17a2b8; }
.igloups-text-muted { color: #6c757d; }

.igloups-bg-light { background-color: #f8f9fa; }
.igloups-bg-primary { background-color: #007cba; color: white; }
.igloups-bg-success { background-color: #28a745; color: white; }

.igloups-border { border: 1px solid #dee2e6; }
.igloups-border-primary { border-color: #007cba; }
.igloups-border-radius { border-radius: 0.25rem; }

.igloups-d-flex { display: flex; }
.igloups-justify-center { justify-content: center; }
.igloups-justify-between { justify-content: space-between; }
.igloups-align-center { align-items: center; }
.igloups-flex-wrap { flex-wrap: wrap; }
.igloups-gap-2 { gap: 1rem; }
.igloups-gap-3 { gap: 1.5rem; }

/* ========================================
   🎭 OVERRIDES SPÉCIFIQUES
========================================= */

#igloups-releve-form .form-step {
    display: none;
}

#igloups-releve-form .form-step:first-child {
    display: block;
}

#map-iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #ccc;
    margin-bottom: 1em;
    border-radius: 4px;
}

.igloups-detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.igloups-detail-title {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.igloups-detail-meta {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.igloups-final-nav {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.igloups-photo-container {
    text-align: center;
    margin: 1em 0;
}

.igloups-photo-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

.igloups-comment-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
    font-size: 1.1em;
    line-height: 1.6;
    color: #495057;
    margin: 1em 0;
}

/* ========================================
   🔄 SYSTÈME DE LOADING (AJOUT)
========================================= */

/* Sections de loading */
.igloups-loading-section {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin-bottom: 10px;
    min-height: 20px; /* Pour éviter les sauts */
}

.igloups-loading-section.loading {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: igloups-shimmer 1.5s infinite;
    border-left: 3px solid #007bff;
    padding-left: 10px;
}

.igloups-loading-section.success {
    border-left: 3px solid #28a745;
    background-color: #f8fff9;
    padding-left: 10px;
}

.igloups-loading-section.error {
    border-left: 3px solid #dc3545;
    background-color: #fff8f8;
    padding-left: 10px;
}

@keyframes igloups-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Barre de progression globale */
.igloups-global-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(248, 249, 250, 0.9);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.igloups-global-progress.active {
    opacity: 1;
}

.igloups-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0;
    transition: width 0.4s ease;
}

/* Toast notifications */
.igloups-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 300px;
}

.igloups-toast {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-left: 4px solid #007bff;
    animation: igloups-slideIn 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.igloups-toast.success { border-left-color: #28a745; }
.igloups-toast.error { border-left-color: #dc3545; }
.igloups-toast.warning { border-left-color: #ffc107; }

@keyframes igloups-slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Skeleton pour inputs */
.igloups-input-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: igloups-skeleton 1.5s infinite !important;
    color: transparent !important;
}

@keyframes igloups-skeleton {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Sections de champs spécifiques */
#nominatim-section,
#marine-section,
#overpass-section {
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 600px) {
    .igloups-toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}