/* PALETTE VIOLET-BLEU TRÈS FONCÉ */
:root {
  /* MODE JOUR - Dégradé violet moins clair */
  --color-primary: #7C3AED;
  --color-gradient: linear-gradient(135deg, #8B5CF6, #6D28D9);
  --color-secondary: #8B5CF6;
  --color-font: #FFFFFF;
  --color-bg: linear-gradient(135deg, #DDD6FE, #C4B5FD);
  --color-text: #4C1D95;
  --color-border: rgba(124, 58, 237, 0.2);
  --card-bg-light: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(124, 58, 237, 0.1);
  --shadow-hover: 0 15px 40px rgba(124, 58, 237, 0.15);
}

.dark-mode {
  /* MODE NUIT - Violet et noir très sombre */
  --color-primary: #6B46C1;
  --color-gradient: linear-gradient(135deg, #1F1B2D, #0A0A0F);
  --color-secondary: #7C3AED;
  --color-font: #FFFFFF;
  --color-bg: linear-gradient(135deg, #0D0D16, #000000);
  --color-text: #E5E7EB;
  --color-text-2: #5c27b8;
  --color-border: rgba(107, 70, 193, 0.3);
  --card-bg-light: rgba(107, 70, 193, 0.15);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  --shadow-hover: 0 15px 40px rgba(107, 70, 193, 0.4);
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 0;
}

body {
  margin: auto;
  max-width: 1280px;
  background: var(--color-bg);
  font-family: "Roboto", sans-serif;
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, var(--color-primary), transparent, var(--color-secondary));
  opacity: 0.03;
  z-index: -1;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

header {
  background: var(--color-gradient);
  margin: 1rem auto;
  width: 95%;
  max-width: 800px;
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-font);
  position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

header p {
  margin: 0.5rem auto;
  opacity: 0.9;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

#cityForm_form legend {
  color: var(--color-text-2);
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

#darkModeToggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(14, 11, 11, 0.2);
  border: none;
  color: var(--color-font);
  font-size: 1.5rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

#darkModeToggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#cityForm {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  margin: 2rem auto;
  width: 95%;
  max-width: 600px;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#cityForm_form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#cityForm_form label {
  color: var(--color-text-2);
  font-weight: 500;
  font-size: 1.1rem;
}

#cityForm_form input, #cityForm_form select {
  padding: 1rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  outline: none;
}

#cityForm_form input:focus, #cityForm_form select:focus {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.sr-only { position: absolute; left: -9999px; }

#validationButton, .reloadButton {
  padding: 1rem 2rem;
  background: var(--color-gradient);
  color: var(--color-font);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  margin: 1rem auto;
  min-width: 200px;
  position: relative;
  overflow: hidden;
}

#validationButton::before, .reloadButton::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

#validationButton:hover::before, .reloadButton:hover::before {
  width: 300px;
  height: 300px;
}

#validationButton:hover, .reloadButton:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

#validationButton { display: none; }

.errorMessage {
  color: #e53e3e;
  text-align: center;
  font-weight: 600;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(229, 62, 62, 0.1);
  border-radius: 12px;
}

#communeSelect {
  display: none;
  margin-top: 1rem;
}

.days-selector {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.day-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.day-button:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

.day-button.active {
  background: var(--color-gradient);
  color: var(--color-font);
  transform: scale(1.15);
  box-shadow: var(--shadow-hover);
}

.checkboxes-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
}

.checkbox-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
}

#weatherInformation {
  display: none;
  flex-direction: column;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  margin: 2rem auto;
  width: 95%;
  max-width: 900px;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.location-info {
  text-align: center;
  padding: 1.5rem;
  background: var(--color-gradient);
  border-radius: 20px;
  color: var(--color-font);
  margin-bottom: 1rem;
}

.location-info h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.weather-day {
  background: var(--color-gradient);
  border-radius: 20px;
  padding: 2rem;
  color: var(--color-font);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.weather-day::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(180deg); }
}

.weather-day h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  position: relative;
  z-index: 1;
}

.weather-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--card-bg-light);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
  gap: 2rem;
}

.weather-icon {
  font-size: 4rem;
  animation: pulse 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / -1;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.weather-temps {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.weather-temps p {
  font-size: 1.5rem;
  margin: 0.5rem 0;
  font-weight: 600;
}

.weather-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  z-index: 1;
  position: relative;
  margin-top: 0;
}

.weather-info-item {
  background: var(--card-bg-light);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}

@media (max-width: 768px) {
  header, #weatherInformation, #cityForm { 
    width: 95%; 
    padding: 1.5rem; 
  }
  
  .weather-main { 
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }
  
  .weather-icon { 
    grid-row: auto;
    justify-self: center;
  }
  
  .weather-temps {
    text-align: center;
  }
  
  .checkboxes-container { 
    grid-template-columns: 1fr; 
  }
  
  .days-selector { 
    gap: 0.5rem; 
  }
  
  .day-button { 
    width: 40px; 
    height: 40px; 
  }
}

@media (max-width: 425px) {
  .weather-info-grid { 
    grid-template-columns: 1fr; 
  }
  
  header { 
    padding: 2rem 1rem; 
  }
  
  #cityForm, #weatherInformation { 
    padding: 1.5rem 1rem; 
  }
}