/* style.css - Version Strava Orange pour GPX Fusion Pro */
:root {
    /* Couleurs Strava */
    --strava-orange: #FC4C02;
    --strava-orange-hover: #e04302;
    --color-bg: #f7f7f7;
    --color-sidebar: #ffffff;
    --color-primary: #FC4C02;
    --color-primary-light: #ff6b2d;
    --color-primary-dark: #c93d02;
    --color-accent: #2C3E50;
    --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;
    --space-xxl: 3rem;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-xxl: 1.5rem;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.10), 0 3px 6px rgba(0, 0, 0, 0.08);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--color-bg);
    min-height: 100vh;
    color: var(--color-text);
    line-height: 1.6;
}

.container {
    display: flex;
    height: calc(100vh - 60px);
    width: 100%;
}

/* 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);
}

.sidebar {
    background: var(--color-sidebar);
    padding: var(--space-lg);
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.map-container {
    position: relative;
    flex: 1;
    height: 100%;
    min-width: 640px;
}

#map {
    height: 100%;
    width: 100%;
}

/* Bouton d'export/fusion en position fixe */
.export-button-container {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 1000;
}

.export-button {
    padding: var(--space-sm) var(--space-md);
    background: var(--strava-orange);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    position: relative;
    min-height: 40px;
}

.export-button:hover:not(:disabled) {
    background: var(--strava-orange-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.export-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cccccc !important;
    transform: none;
    box-shadow: none;
}

.section {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.section-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--color-primary);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: 'Inter', sans-serif;
}

.section:nth-child(1) .section-title::before {
    content: "ðŸ“";
}

.section:nth-child(2) .section-title::before {
    content: "ðŸ›¤ï¸";
}

.file-input-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input {
    display: none;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: var(--strava-orange);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-align: center;
    gap: var(--space-sm);
    font-family: 'Inter', sans-serif;
}

.file-input-label:hover {
    background: var(--strava-orange-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.track-list {
    max-height: 640px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.file-item {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    cursor: move;
}

.file-item:hover {
    background: #F8F9FA;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.color-indicator {
    margin-right: var(--space-sm);
    height: 16px;
    width: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.file-info {
    flex-grow: 1;
    overflow: hidden;
}

.file-name {
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
    font-size: var(--text-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--text-xs);
    color: var(--color-text-light);
}

.file-time, .file-elevation, .file-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-btn {
    margin-left: auto;
    cursor: pointer;
    color: var(--color-danger);
    transition: color 0.2s;
    background: none;
    border: none;
    font-size: var(--text-lg);
    padding: var(--space-xs);
}

.delete-btn:hover {
    color: #c53030;
}

.status-message {
    background-color: #f0f4f8;
    padding: var(--space-md);
    border-radius: var(--radius);
    border-left: 4px solid var(--color-primary);
    font-weight: 500;
    margin-bottom: var(--space-md);
    font-family: 'Inter', sans-serif;
}

.drag-hint {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-sm);
    background-color: #e2e8f0;
    border-radius: var(--radius);
    font-size: var(--text-xs);
    color: var(--color-text-light);
    font-family: 'Inter', sans-serif;
}

.drag-hint svg {
    width: 16px;
    height: 16px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

.sortable-ghost {
    background-color: #cbd5e0;
    opacity: 0.8;
    border: 2px dashed var(--color-primary);
}

.controls-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.overlay-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-sm);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    color: var(--color-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
}

.overlay-btn:hover {
    background: white;
    color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.toast {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.98);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--color-success);
    backdrop-filter: blur(10px);
    max-width: 400px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left: 4px solid var(--color-danger);
}

.hidden {
    display: none;
}

/* Style pour le tooltip personnalisÃ© */
.gpx-tooltip-custom {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-sm);
    box-shadow: var(--shadow-md);
    font-family: 'Inter', sans-serif;
    font-size: var(--text-sm);
    backdrop-filter: blur(10px);
}

.gpx-tooltip-custom .gpx-tooltip {
    line-height: 1.4;
}

.gpx-tooltip-custom strong {
    color: var(--color-primary);
    display: block;
    margin-bottom: 4px;
}

.gpx-tooltip-custom span {
    display: block;
    margin-bottom: 2px;
}

/* Structure sÃ©mantique SEO */
.seo-content {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Styles pour les flÃ¨ches de direction */
.direction-arrow {
    background: transparent !important;
    border: none !important;
}

/* Footer pour l'éditeur GPX - Style identique à la FAQ */
footer[role="contentinfo"] {
    width: 100%;
    background: linear-gradient(135deg, var(--color-accent) 0%, #1a252f 100%);
    padding: 2rem 1rem;
    text-align: center;
    color: #d1d5db;
    font-size: 0.875rem;
    border-top: 3px solid var(--strava-orange);
    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(--strava-orange);
    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;
    }
}

/* Media Queries pour le responsive design */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 60px);
    }
    
    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-md);
    }
    
    .map-container {
        min-width: auto;
        min-height: 60vh;
    }

    .export-button-container {
        position: absolute;
        top: unset;
        bottom: 80px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        padding: var(--space-sm);
        gap: var(--space-md);
    }
    
    .section {
        padding: var(--space-md);
    }

    .export-button-container {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 40px);
    }
    
    .export-button {
        width: 100%;
        justify-content: center;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .breadcrumb {
        padding: 8px 15px;
    }
    
    .file-details {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: var(--space-sm);
    }
    
    .export-button {
        font-size: var(--text-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    footer {
        padding: var(--space-md);
    }
    
    .file-details {
        flex-direction: column;
        gap: 1px;
    }
}

/* AmÃ©liorations d'accessibilitÃ© */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour accessibilitÃ© */
button:focus-visible,
.file-input-label:focus-visible,
.overlay-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.text-gray-600 {
    color: var(--color-text-light);
}

.italic {
    font-style: italic;
}

.py-2 {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}