/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.navbar-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.navbar-nav a:hover {
    opacity: 0.8;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page d'accueil */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Barre de recherche */
.search-container {
    max-width: 500px;
    margin: 0 auto 3rem auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: #666;
}

/* Sections */
.section-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

/* Grille de cartes météo */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Cartes météo */
.weather-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

.weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.weather-card:hover::before {
    transform: translateX(100%);
}

.city-name {
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.temperature {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.weather-icon {
    width: 60px;
    height: 60px;
    margin: 1rem auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.weather-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-transform: capitalize;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    margin: 0.25rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-danger {
    background: rgba(220, 53, 69, 0.2);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.5);
}

.btn-danger:hover {
    background: rgba(220, 53, 69, 0.4);
}

/* Boutons des cartes */
.card-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Page de détail */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.detail-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
}

.detail-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.detail-value {
    color: white;
    font-size: 1.5rem;
    font-weight: 500;
}

/* Formulaires */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    box-sizing: border-box;
}

.form-title {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 300;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-label {
    color: white;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    resize: vertical; /* Pour les textareas */
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Styles spécifiques pour les inputs file */
.form-input[type="file"] {
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    text-align: center;
    cursor: pointer;
}

.form-input[type="file"]:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Textarea spécifique */
textarea.form-input {
    min-height: 100px;
    max-height: 200px;
    resize: vertical;
}

/* Correction pour les erreurs de formulaire */
.form-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* S'assurer que rien ne déborde */
* {
    box-sizing: border-box;
}

.form-container * {
    max-width: 100%;
}

/* Pour les écrans très petits */
@media (max-width: 480px) {
    .form-container {
        max-width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    .form-input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Checkbox pour les préférences */
.checkbox-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-item:last-child {
    margin-bottom: 0;
}

.checkbox-input {
    margin-right: 1rem;
    transform: scale(1.2);
}

.checkbox-label {
    color: white;
    font-size: 1rem;
}

/* Alertes */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: none;
}

.alert-info {
    background: rgba(13, 202, 240, 0.2);
    color: white;
    border: 1px solid rgba(13, 202, 240, 0.3);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: white;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert-success {
    background: rgba(25, 135, 84, 0.2);
    color: white;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

/* Liens de navigation */
.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin-bottom: 1rem;
    display: inline-block;
}

.nav-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .navbar-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-nav {
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .weather-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.weather-card {
    animation: fadeIn 0.6s ease forwards;
}

.weather-card:nth-child(1) { animation-delay: 0.1s; }
.weather-card:nth-child(2) { animation-delay: 0.2s; }
.weather-card:nth-child(3) { animation-delay: 0.3s; }
.weather-card:nth-child(4) { animation-delay: 0.4s; }
.weather-card:nth-child(5) { animation-delay: 0.5s; }
.weather-card:nth-child(6) { animation-delay: 0.6s; }

/* Prévisions météo */
.forecast-container {
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.forecast-title {
    color: white;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.forecast-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}

.forecast-slider::-webkit-scrollbar {
    display: none;
}

.forecast-day {
    flex: 0 0 auto;
    width: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem 0.8rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.forecast-day:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.forecast-day.current-day {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.forecast-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.forecast-icon {
    font-size: 2.5rem;
    margin: 0.5rem 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.forecast-temp {
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
    margin: 0.5rem 0;
}

.forecast-minmax {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    font-size: 0.8rem;
}

.temp-max {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.temp-min {
    color: rgba(255, 255, 255, 0.6);
}

.forecast-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    line-height: 1.2;
    height: 2.4rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Responsive pour les prévisions */
@media (max-width: 768px) {
    .forecast-container {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .forecast-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .forecast-slider {
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0 -0.5rem;
    }
    
    .forecast-day {
        width: 100px;
        padding: 0.8rem 0.6rem;
    }
    
    .forecast-icon {
        font-size: 2rem;
    }
    
    .forecast-temp {
        font-size: 1.2rem;
    }
}

@media (min-width: 769px) {
    /* Sur PC, plus d'espace pour les prévisions */
    .forecast-container {
        margin: 3rem 0;
    }
    
    .forecast-slider {
        justify-content: space-between;
        gap: 1.5rem;
    }
    
    .forecast-day {
        width: 140px;
        padding: 1.5rem 1rem;
    }
    
    .forecast-icon {
        font-size: 3rem;
    }
    
    .forecast-temp {
        font-size: 1.6rem;
    }
}

/* Résultats de recherche */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.search-result-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: center;
    backdrop-filter: blur(10px);
}

.search-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: inherit;
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: -1;
}

.search-result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.search-result-card:hover::before {
    opacity: 1;
}

.search-city-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.search-city-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.search-city-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.search-city-location {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.location-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.search-city-action {
    margin-top: auto;
}

.search-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    border-radius: 12px;
    font-size: 0.95rem;
}

.search-tip {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-top: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.search-tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.search-tip-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-tip-text strong {
    color: white;
}

.search-tip-text em {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Responsive pour les résultats de recherche */
@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-result-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .search-city-header {
        gap: 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    .search-city-name {
        font-size: 1.3rem;
    }
    
    .search-city-icon {
        font-size: 2rem;
    }
    
    .search-city-location {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
    
    .search-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .search-tip {
        padding: 0.8rem 1rem;
        gap: 0.8rem;
    }
    
    .search-tip-icon {
        font-size: 1.2rem;
    }
    
    .search-tip-text {
        font-size: 0.8rem;
    }
}
