* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-container {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.date-input {
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn,
.clear-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.clear-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.clear-btn:hover {
    background: #e9ecef;
    color: #495057;
}



.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.file-list-header h3 {
    color: #2c3e50;
    font-weight: 600;
}

.file-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.file-list {
    max-height: 600px;
    overflow-y: auto;
}

.gpx-file-item {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.gpx-file-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateX(5px);
}

.gpx-file-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.file-date {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.file-stats {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #495057;
}



.map {
    height: 500px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.map-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
}

.control-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    z-index: 1000;
    display: none;
}

.info-panel.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.info-header h4 {
    color: #2c3e50;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.info-content {
    line-height: 1.6;
}

.info-content h5 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-content p {
    margin-bottom: 8px;
    color: #495057;
}

.info-content .stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.info-content .stat:last-child {
    border-bottom: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.show {
    display: block;
}

/* Section de chargement des fichiers */
.file-upload-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
}

.file-count {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.upload-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.upload-info p {
    margin: 0;
}

/* Amélioration de la sidebar */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* Amélioration des contrôles de carte */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design - Disposition mobile-first */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

/* Sections principales - disposition verticale */
.files-section,
.map-section,
.profile-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Liste des fichiers */
.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.file-list-header h3 {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

.file-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.gpx-file-item {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.gpx-file-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateX(5px);
}

.gpx-file-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.95rem;
    word-break: break-word;
}

.file-date {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.file-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: #495057;
    flex-wrap: wrap;
}

/* Carte */
.map-section {
    position: relative;
}

.map {
    height: 400px;
    border-radius: 10px;
    width: 100%;
}

.map-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.control-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

/* Profil altimétrique */
.profile-section {
    margin-bottom: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.profile-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.profile-content {
    position: relative;
}

.profile-content canvas {
    width: 100% !important;
    height: 200px !important;
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: 20px;
    }

    .files-section,
    .map-section,
    .profile-section {
        padding: 25px;
        margin-bottom: 30px;
    }

    .map {
        height: 500px;
    }

    .file-list {
        max-height: 400px;
    }

    .file-stats {
        gap: 15px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 30px;
    }

    .map {
        height: 600px;
    }

    .file-list {
        max-height: 500px;
    }

    .profile-content canvas {
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .date-input,
    .search-btn,
    .clear-btn {
        width: 100%;
    }

    .map {
        height: 350px;
    }

    .file-stats {
        flex-direction: column;
        gap: 5px;
    }

    .file-list {
        max-height: 250px;
    }

    .profile-content canvas {
        height: 180px !important;
    }
}

/* Gestion des écrans */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.screen-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.screen-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.screen-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 20px;
}

/* Navigation entre écrans */
.screen-navigation {
    text-align: center;
    margin-top: 30px;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    min-width: 280px;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Informations des fichiers sélectionnés */
.selected-files-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.selected-files-info h3 {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.selected-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-file-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid #bbdefb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-file-tag .remove-file {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.selected-file-tag .remove-file:hover {
    background: #bbdefb;
    color: #1565c0;
}

/* Responsive Design pour les écrans */
@media (max-width: 768px) {
    .screen-header h2 {
        font-size: 1.6rem;
    }

    .screen-header p {
        font-size: 1rem;
    }

    .primary-btn {
        min-width: 250px;
        padding: 12px 24px;
        font-size: 1rem;
    }

    .secondary-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .screen-header h2 {
        font-size: 1.4rem;
    }

    .primary-btn {
        min-width: 200px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .selected-files-list {
        flex-direction: column;
    }

    .selected-file-tag {
        justify-content: space-between;
    }
}