:root {
    --primary-color: #ff6b2f;
    --secondary-color: #4682B4;
    --dark-blue: #0a1832;
    --light-color: #ffffff;
    --card-radius: 16px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: #7f289d73;
    opacity: 1;
    background-image: radial-gradient(circle at center center, #ffffff, #ff6b2f), 
                      repeating-radial-gradient(circle at center center, #ffffff, #ffffff, 7px, transparent 14px, transparent 7px);
    background-blend-mode: multiply;
    color: var(--dark-blue);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    padding: 20px 0;
}

header h1 {
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 2.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.search-panel {
    background-color: #6315291a;
    border-radius: var(--card-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
}

.centered-group {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 15px auto;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-blue);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--card-radius);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 47, 0.2);
    outline: none;
}

.dates-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.date-column {
    width: 48%;
}

.radius-slider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    flex-grow: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.radius-value {
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: var(--card-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: #e5624f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

#searchBtn {
    width: 100%;
    max-width: 200px;
    margin: 10px auto;
    display: block;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.course-card {
    background-color: white;
    border-radius: var(--card-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.course-image {
    height: 30px;
    background-color: var(--primary-color);
    position: relative;
}

.course-details {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.course-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark-blue);
    line-height: 1.3;
}

.course-location, .course-date {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 15px;
}

.distance-option {
    background-color: rgba(255, 113, 88, 0.1);
    color: var(--dark-blue);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.distance-value {
    font-weight: 700;
}

.course-link {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

.course-link a {
    flex: 1;
    font-size: 14px;
    padding: 8px 12px;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--dark-blue);
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.distance-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--dark-blue);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
}

.type-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: white;
}

.loading i {
    animation: spin 1.2s infinite linear;
    margin-right: 10px;
}

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

.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    z-index: 20;
    background: white;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.autocomplete-item:hover {
    background-color: #f9f9f9;
}

.export-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.export-btn {
    background-color: var(--dark-blue);
    border-radius: 24px;
    padding: 12px 30px;
    font-size: 16px;
}

.export-btn:hover {
    background-color: #152347;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 18px;
}

.search-stats {
    text-align: center;
    padding: 15px 0 5px;
    font-weight: 500;
    color: var(--dark-blue);
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 15px;
}

.search-stats i {
    color: var(--primary-color);
    margin-right: 5px;
}

.distance-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--dark-blue);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.travel-info {
    display: flex;
    align-items: center;
    margin: 8px 0;
    color: #555;
    font-size: 0.9rem;
}

.travel-info i {
    margin-right: 8px;
    color: #1976d2;
}

.travel-info .text-muted {
    color: #777;
    margin-left: 4px;
    font-size: 0.85rem;
}

.course-card {
    padding-bottom: 16px;
}

.course-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-maps {
    background-color: #4285F4;
    color: white;
    font-size: 14px;
    padding: 8px 12px;
}

.btn-maps:hover {
    background-color: #3367D6;
}

.course-link {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.course-link a {
    flex: 1 1 auto;
    min-width: 100px;
    text-align: center;
}

.progress-container {
    width: 80%;
    max-width: 400px;
    margin: 15px auto;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 0.3s ease-in-out;
    width: 0%;
}

.progress-text {
    color: white;
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
    opacity: 0.9;
}

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

.progress-bar.indeterminate {
    width: 100%;
    background: linear-gradient(
        90deg, 
        var(--primary-color) 0%, 
        rgba(255, 255, 255, 0.7) 50%, 
        var(--primary-color) 100%
    );
    background-size: 200% 100%;
    animation: progress-animation 2s linear infinite, pulse 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.progress-container.estimating .progress-bar {
    background-image: linear-gradient(
        45deg, 
        var(--primary-color) 25%, 
        rgba(255, 255, 255, 0.4) 25%, 
        rgba(255, 255, 255, 0.4) 50%, 
        var(--primary-color) 50%, 
        var(--primary-color) 75%, 
        rgba(255, 255, 255, 0.4) 75%, 
        rgba(255, 255, 255, 0.4)
    );
    background-size: 20px 20px;
    animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.btn-favorite {
    background-color: #f0f0f0;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-favorite:hover {
    background-color: #e6e6e6;
    transform: translateY(-2px);
}

.btn-favorite.active {
    background-color: #ffedd9;
    color: #ff6b2f;
}

.btn-favorite.active:hover {
    background-color: #ffdfc0;
}

.favorite-badge {
    margin-left: 8px;
    color: #ff6b2f;
    animation: pulse-favorite 1s ease-in-out;
}

@keyframes pulse-favorite {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.course-link {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.course-link a, 
.course-link button {
    flex: 1 1 auto;
    min-width: 80px;
    white-space: nowrap;
}

@keyframes favorite-added {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.favorite-badge.animate {
    animation: favorite-added 0.5s ease-in-out;
}

@media (max-width: 768px) {
    .dates-container {
        flex-direction: column;
    }
    
    .date-column {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .results-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.responsive-logo {
    width: 100%;          /* L'image prendra toute la largeur de son conteneur */
    max-width: 300px;     /* Définissez une largeur maximale pour l'image */
    height: auto;         /* La hauteur s'ajuste automatiquement pour maintenir le ratio */
}

.favorites-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
}

.toggle-label {
    margin-left: 10px;
    font-weight: 500;
    color: #333;
}

/* Le switch - conteneur */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* Cache la checkbox par défaut */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Le slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #FF6B2F; /* Couleur orange assortie à votre bouton */
}

input:focus + .slider {
    box-shadow: 0 0 1px #FF6B2F;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Slider arrondi */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Styles pour le conteneur du toggle qui doit rester visible */
.favorites-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    /* S'assurer que ce conteneur n'est jamais masqué */
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Animations de transition uniquement pour le panneau de recherche */
.search-panel {
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
}

.search-panel.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.btn-add-calendar {
    background-color: #34A853;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    padding: 0;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-add-calendar:hover {
    background-color: #2E8B57;
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* S'assurer que la course-date est bien configurée pour accueillir le bouton */
.course-date {
    display: flex;
    align-items: center;
}