/* style.css - Version complète mise à jour avec footer */
:root {
    /* Couleurs inspirées de Strava */
    --color-bg: #f7f7f7;
    --color-sidebar: #ffffff;
    --color-primary: #FC4C02;
    --color-primary-light: #FF6B35;
    --color-primary-dark: #D83A00;
    --color-accent: #FF3847;
    --color-success: #27AE60;
    --color-warning: #F39C12;
    --color-danger: #E74C3C;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #e0e0e0;
    --color-card: #FFFFFF;
    
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 6px;
    --radius-lg: 8px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Style du Fil d'Ariane (Breadcrumb) */
.breadcrumb {
    padding: 10px 20px;
    background-color: var(--color-bg);
    margin-bottom: 5px;
}

.breadcrumb ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
}

.breadcrumb li {
    display: inline;
    margin-right: 8px;
    color: var(--color-text-light);
}

.breadcrumb li a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb li a:hover {
    text-decoration: underline;
    color: var(--color-accent);
}

.breadcrumb li:nth-child(even) {
    margin-right: 8px;
    color: var(--color-text-light);
}

.breadcrumb li span[aria-current="page"] {
    font-weight: 600;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .breadcrumb {
        padding: 8px 15px;
    }
}

/* Layout principal */
main {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: calc(100vh - 60px);
}

@media (min-width: 1024px) {
    main {
        flex-direction: row;
    }
}

/* Sidebar */
.sidebar-strava {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-right: 1px solid var(--color-border);
    width: 100%;
    padding: var(--space-lg);
    overflow-y: auto;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .sidebar-strava {
        width: 400px;
        max-height: none;
    }
}

@media (max-width: 1024px) {
    .sidebar-strava {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        max-height: 50vh;
    }
}

.container-box {
    background-color: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
}

/* En-tête de l'application */
.app-header {
    text-align: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.app-title {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    font-weight: 500;
}

/* Labels et champs de formulaire */
.file-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.file-input {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-card);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--color-text);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.file-input:hover {
    border-color: var(--color-primary);
    background-color: rgba(252, 76, 2, 0.03);
}

.file-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.1);
}

/* Styles spécifiques pour les select */
.file-input:is(select) {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Bouton principal */
.btn-strava {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    font-weight: 600;
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--text-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.btn-strava:hover {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #FF5260 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-strava:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Carte de statut */
.status-card {
    background-color: var(--color-card);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-top: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.section-description {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
}

.status-message {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-text);
    padding: var(--space-sm);
    background-color: rgba(252, 76, 2, 0.05);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-primary);
    min-height: 20px;
}

.debug-info {
    font-size: var(--text-xs);
    color: var(--color-text-light);
    margin-top: var(--space-sm);
    font-family: 'Courier New', monospace;
    min-height: 16px;
}

/* Informations sur les formats */
.format-info {
    background: rgba(252, 76, 2, 0.05);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-top: var(--space-lg);
    border-left: 3px solid var(--color-primary);
}

.format-info h3 {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.format-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.4;
}

.format-info li {
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.format-info strong {
    color: var(--color-primary);
}

/* Conteneur de la carte */
#map-container {
    position: relative;
    flex-grow: 1;
    height: 400px;
}

@media (min-width: 1024px) {
    #map-container {
        height: auto;
    }
}

#map {
    width: 100%;
    height: 100%;
    background-color: #e5e7eb;
}

.disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.9) 100%);
    z-index: 10;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius);
    backdrop-filter: blur(2px);
}

/* Footer pour l'éditeur GPX - Style identique à la FAQ */
footer[role="contentinfo"] {
    width: 100%;
    background: linear-gradient(135deg, #2C3E50 0%, #1a252f 100%);
    padding: 2rem 1rem;
    text-align: center;
    color: #d1d5db;
    font-size: 0.875rem;
    border-top: 3px solid var(--color-primary);
    margin-top: 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

footer[role="contentinfo"] p {
    margin-bottom: 1rem;
    color: #f3f4f6;
    font-weight: 500;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.footer-links a:hover {
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.1);
}

.footer-links a:not([href*="strava"]):hover {
    transform: translateY(-2px);
}

/* Style spécial pour le badge Strava */
.footer-links a[href*="strava"] {
    display: inline-block;
    background-color: #FC5200;
    color: #fff;
    padding: 5px 10px 5px 30px;
    font-size: 11px;
    font-family: Helvetica, Arial, sans-serif;
    white-space: nowrap;
    text-decoration: none;
    background-repeat: no-repeat;
    background-position: 10px center;
    border-radius: 3px;
    background-image: url('https://badges.strava.com/logo-strava-echelon.png');
    transition: all 0.3s ease;
}

.footer-links a[href*="strava"]:hover {
    background-color: #e04800;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(252, 82, 0, 0.3);
}

.footer-links a[href*="strava"] img {
    margin-left: 2px;
    vertical-align: text-bottom;
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    footer[role="contentinfo"] {
        padding: 1.5rem 1rem;
    }
    
    .footer-links a {
        font-size: 0.8125rem;
    }
}

/* Overlay d'export */
.legal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.legal-overlay.show {
    display: flex;
}

.legal-modal {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow-y: auto;
    border: 1px solid var(--color-border);
}

.legal-modal h2 {
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
    text-align: center;
    font-size: var(--text-xl);
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.legal-content {
    font-size: var(--text-sm);
    line-height: 1.6;
}

.close-modal {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: #4b5563;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: var(--text-lg);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.close-modal:hover {
    background: var(--color-accent);
    transform: scale(1.1);
}

/* Options de format */
.format-options {
    background: rgba(0, 0, 0, 0.03);
    padding: var(--space-md);
    border-radius: var(--radius);
    margin: var(--space-md) 0;
    border-left: 3px solid var(--color-primary);
}

.format-options h4 {
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    margin-top: 0;
}

.format-options label {
    font-size: var(--text-sm);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.format-options input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

/* Informations sur le fichier */
#file-info {
    font-size: var(--text-xs);
    color: var(--color-text-light);
    margin-top: var(--space-xs);
    font-style: italic;
}

/* Styles pour la carte Leaflet */
.leaflet-container {
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    font-size: var(--text-sm);
}

/* États de chargement */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animation de pulse pour le bouton */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Messages d'erreur et succès */
.error-message {
    color: var(--color-danger);
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--color-danger);
}

.success-message {
    color: var(--color-success);
    background-color: rgba(39, 174, 96, 0.1);
    border-left: 3px solid var(--color-success);
}

.warning-message {
    color: var(--color-warning);
    background-color: rgba(243, 156, 18, 0.1);
    border-left: 3px solid var(--color-warning);
}

/* Améliorations responsive */
@media (max-width: 640px) {
    .sidebar-strava {
        padding: var(--space-md);
    }
    
    .app-title {
        font-size: var(--text-lg);
    }
    
    .app-subtitle {
        font-size: var(--text-xs);
    }
    
    .legal-modal {
        padding: var(--space-lg);
        margin: var(--space-md);
    }
    
    .format-info {
        font-size: var(--text-xs);
    }
    
    .format-info ul {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        padding: 6px 12px;
    }
    
    .breadcrumb ul {
        font-size: 0.7rem;
    }
    
    .sidebar-strava {
        padding: var(--space-sm);
    }
    
    .btn-strava {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.8rem;
    }
}

/* Styles d'impression */
@media print {
    .sidebar-strava,
    .breadcrumb,
    .legal-overlay,
    footer {
        display: none !important;
    }
    
    #map-container {
        height: 100vh;
        position: static;
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour l'accessibilité */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Mode sombre basique */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1a1a1a;
        --color-sidebar: #2d2d2d;
        --color-text: #e5e5e5;
        --color-text-light: #a0a0a0;
        --color-border: #404040;
        --color-card: #363636;
    }
    
    .file-input {
        background-color: var(--color-card);
        color: var(--color-text);
    }
}