/* MySkiTrip Frontend Enhanced Styles */
/* Design moderne et attractif pour le shortcode [my_ski_trip_form] */

:root {
    --mst-primary: #0EA5E9;
    --mst-secondary: #F97316;
    --mst-success: #22C55E;
    --mst-warning: #F59E0B;
    --mst-error: #EF4444;
    --mst-gray-50: #F8FAFC;
    --mst-gray-100: #F1F5F9;
    --mst-gray-200: #E2E8F0;
    --mst-gray-300: #CBD5E1;
    --mst-gray-500: #64748B;
    --mst-gray-600: #475569;
    --mst-gray-700: #334155;
    --mst-gray-800: #1E293B;
    --mst-white: #FFFFFF;
    --mst-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --mst-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --mst-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --mst-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Container principal */
.my-ski-trip-route-form {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--mst-white);
    border-radius: 16px;
    box-shadow: var(--mst-shadow-xl);
    overflow: hidden;
    border: 1px solid var(--mst-gray-200);
}

/* En-tête avec gradient */
.my-ski-trip-route-form::before {
    content: '';
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--mst-primary), var(--mst-secondary), var(--mst-success));
}

/* Formulaire */
.route-planning-form {
    padding: 0;
}

/* Sections du formulaire */
.form-section {
    padding: 32px;
    border-bottom: 1px solid var(--mst-gray-100);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mst-gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--mst-primary);
    border-radius: 2px;
}

/* Rangées de formulaire */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* Groupes de formulaire */
.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group label {
    font-weight: 600;
    color: var(--mst-gray-700);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Inputs et selects */
.form-group input[type="text"],
.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--mst-gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--mst-white);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--mst-primary);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}

.form-group input[type="text"]:hover,
.form-group select:hover {
    border-color: var(--mst-gray-300);
}

/* Suggestions d'autocomplétion */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--mst-white);
    border: 2px solid var(--mst-gray-200);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--mst-shadow-lg);
    max-height: 200px;
    overflow-y: auto;
}

.suggestions-container ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--mst-gray-100);
}

.suggestion-item:hover {
    background-color: var(--mst-gray-50);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-label {
    font-weight: 600;
    color: var(--mst-gray-800);
}

.suggestion-meta {
    font-size: 0.85rem;
    color: var(--mst-gray-500);
    margin-top: 4px;
}

/* Points intermédiaires */
.intermediates-section {
    grid-column: 1 / -1;
}

.intermediate-point {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.intermediate-point input {
    flex: 1;
}

.remove-intermediate {
    width: 36px;
    height: 36px;
    border: 2px solid var(--mst-error);
    background: var(--mst-white);
    color: var(--mst-error);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.remove-intermediate:hover {
    background: var(--mst-error);
    color: var(--mst-white);
}

/* Sélecteur de difficulté */
.difficulty-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.difficulty-selector input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--mst-gray-200);
    outline: none;
    -webkit-appearance: none;
}

.difficulty-selector input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--mst-primary);
    cursor: pointer;
    border: 2px solid var(--mst-white);
    box-shadow: var(--mst-shadow);
}

.difficulty-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1.2rem;
    color: var(--mst-gray-300);
    cursor: pointer;
    transition: color 0.2s ease;
}

.star.active {
    color: var(--mst-warning);
}

.difficulty-text {
    font-weight: 600;
    color: var(--mst-gray-700);
}

/* Boutons */
.button-primary,
.button-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-primary {
    background: var(--mst-primary);
    color: var(--mst-white);
    box-shadow: var(--mst-shadow);
}

.button-primary:hover {
    background: #0284C7;
    box-shadow: var(--mst-shadow-lg);
}

.button-primary:disabled {
    background: var(--mst-gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.button-secondary {
    background: var(--mst-white);
    color: var(--mst-gray-700);
    border: 2px solid var(--mst-gray-200);
}

.button-secondary:hover {
    background: var(--mst-gray-50);
    border-color: var(--mst-gray-300);
}

/* Actions du formulaire */
.form-actions {
    padding: 32px;
    background: var(--mst-gray-50);
    text-align: center;
    border-top: 1px solid var(--mst-gray-100);
}

#calculate_route {
    min-width: 200px;
    font-size: 1.1rem;
    padding: 16px 32px;
}

/* Spinner de chargement */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Résultats */
#route_results {
/* padding: 32px; */	
    padding: 0px;
    background: var(--mst-gray-50);
    border-top: 1px solid var(--mst-gray-100);
}

#routes_container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.route-card {
    background: var(--mst-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--mst-shadow);
    border: 1px solid var(--mst-gray-200);
    transition: all 0.3s ease;
}

.route-card:hover {
    box-shadow: var(--mst-shadow-lg);
    transform: translateY(-2px);
}

.route-card h4 {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-conservative h4 { color: var(--mst-success); }
.route-balanced h4 { color: var(--mst-warning); }
.route-progressive h4 { color: var(--mst-error); }

/* Carte */
#route_map {
    height: 500px;
    border-radius: 12px;
    border: 1px solid var(--mst-gray-200);
    box-shadow: var(--mst-shadow);
}

/* Disclaimer */
#disclaimer {
    background: var(--mst-warning);
    color: var(--mst-white);
    padding: 16px 24px;
    border-radius: 8px;
    margin: 24px 0 0 0;
}

/* Météo */
#weather_info {
    background: var(--mst-white);
    border-radius: 12px;
    padding: 0px;
    box-shadow: var(--mst-shadow);
    border: 1px solid var(--mst-gray-200);
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    #routes_container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .my-ski-trip-route-form {
        margin: 16px;
        border-radius: 12px;
    }
    
    .form-section {
        padding: 24px 20px;
    }
    
    .form-actions {
        padding: 24px 20px;
    }
    
    #route_results {
	/* padding: 24px 20px; */	
        padding: 12px 0px;
    }
    
    #route_map {
        height: 400px;
    }
    
    .intermediate-point {
        flex-direction: column;
        align-items: stretch;
    }
    
    .remove-intermediate {
        align-self: flex-end;
        width: auto;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .form-section h3 {
        font-size: 1.25rem;
    }
    
    #calculate_route {
        width: 100%;
        min-width: auto;
    }
    
    #route_map {
        height: 300px;
    }
}