/* ============================================
   WEATHER WIDGET - CSS COMPLET
   Tous les styles pour le widget météo
   ============================================ */

/* ===== VISIBILITÉ ET BASE ===== */
.weather-sidebar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.weather-sidebar.visible {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== STYLES DE BASE ===== */
.weather-sidebar {
  position: fixed !important;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 15px;
  backdrop-filter: blur(5px);
  transition: transform 0.3s, opacity 0.3s;
  z-index: 10000;
  width: 240px !important;
  max-width: 240px !important;
}

/* Largeur du contenu météo */
#weather-widget {
  overflow-x: hidden;
  width: 100%;
}

/* ===== TITRES ===== */
.weather-sidebar h3,
.weather-sidebar p strong {
  margin: 0 0 10px 0;
  font-size: 15px;
  text-align: center;
  padding-bottom: 6px;
  font-weight: bold;
}

/* ===== THÈMES DE COULEUR ===== */

/* Thème Violet (Light) */
[data-theme="light"] .weather-sidebar {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(126, 87, 194, 0.2);
}

[data-theme="light"] .weather-sidebar h3,
[data-theme="light"] .weather-sidebar p strong {
  color: #ffffff !important;
  border-bottom: 1px solid rgba(126, 87, 194, 0.2);
}

[data-theme="light"] .weather-day {
  background: rgba(240, 240, 250, 0.8);
  border: 1px solid rgba(126, 87, 194, 0.2);
  color: #333 !important;
}

[data-theme="light"] .weather-day * {
  color: #333 !important;
}

[data-theme="light"] .min-temp {
  color: #1976d2 !important;
}

[data-theme="light"] .max-temp {
  color: #f57c00 !important;
}

[data-theme="light"] .weather-gif {
  filter: brightness(0.8) contrast(1.3) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  z-index: 10;
}

[data-theme="light"] .weather-day h4 {
  background-color: rgba(126, 87, 194, 0.2) !important;
  color: #7e57c2 !important;
  font-weight: bold !important;
}

[data-theme="light"] .weather-detail-item {
  background: rgba(126, 87, 194, 0.1);
  color: #333 !important;
  font-weight: 500 !important;
}

[data-theme="light"] .weather-condition {
  color: #333 !important;
  font-weight: 600 !important;
}

/* Thème Sombre (Dark) */
[data-theme="dark"] .weather-sidebar {
  background: rgba(26, 35, 126, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .weather-sidebar h3,
[data-theme="dark"] .weather-sidebar p strong {
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .weather-day {
  background: rgba(30, 40, 140, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

[data-theme="dark"] .weather-gif {
  filter: brightness(1.2) contrast(1.1);
  z-index: 10;
}

[data-theme="dark"] .weather-day h4 {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #90caf9 !important;
}

[data-theme="dark"] .weather-detail-item {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

[data-theme="dark"] .weather-condition {
  color: white;
}

/* Thème Rouge */
[data-theme="rouge"] .weather-sidebar {
  background: rgb(148, 0, 0) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="rouge"] .weather-sidebar h3,
[data-theme="rouge"] .weather-sidebar p strong {
  color: #ffeb3b !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="rouge"] .weather-day {
  background: rgba(0, 0, 0, 0.2) !important;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="rouge"] .weather-gif {
  filter: brightness(1.3) contrast(1.2) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  z-index: 10;
}

[data-theme="rouge"] .weather-day h4 {
  background-color: rgba(255, 235, 59, 0.2) !important;
  color: #ffeb3b !important;
}

[data-theme="rouge"] .weather-detail-item {
  background: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
}

[data-theme="rouge"] .weather-condition {
  color: white !important;
}

/* Thème Bleu Ciel */
[data-theme="bleuciel"] .weather-sidebar {
  background: linear-gradient(145deg, #0277bd, #03a9f4) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="bleuciel"] .weather-sidebar h3,
[data-theme="bleuciel"] .weather-sidebar p strong {
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="bleuciel"] .weather-day {
  background: rgba(255, 255, 255, 0.15) !important;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="bleuciel"] .weather-gif {
  filter: brightness(1.2) contrast(1.1) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  z-index: 10;
}

[data-theme="bleuciel"] .weather-day h4 {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

[data-theme="bleuciel"] .weather-detail-item {
  background: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
}

[data-theme="bleuciel"] .weather-condition {
  color: white !important;
}

/* ===== BOUTON DE FERMETURE ===== */
.weather-toggle {
  position: absolute;
  top: 8px;
  right: 8px !important;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

[data-theme="light"] .weather-toggle {
  background: #673AB7;
  border: 1px solid rgb(172 157 218);
  color: #7e57c2 !important;
}

[data-theme="dark"] .weather-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

[data-theme="rouge"] .weather-toggle {
  background: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="bleuciel"] .weather-toggle {
  background: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.weather-toggle:hover {
  transform: scale(1.05) !important;
}

.weather-toggle:active {
  transform: scale(0.95) !important;
}

/* ===== BOUTONS D'AFFICHAGE ===== */
.weather-show-btn,
.weather-mobile-btn {
  position: fixed;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  z-index: 990;
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Thème Rouge */
[data-theme="rouge"] .weather-show-btn,
[data-theme="rouge"] .weather-mobile-btn {
  background: rgb(148, 0, 0);
}

/* ===== JOURS MÉTÉO ===== */
.weather-day {
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 0.9em;
  position: relative;
}

.weather-day h4 {
  background-color: rgba(126, 87, 194, 0.15);
  border-radius: 6px;
  text-align: center;
  margin: 0 0 8px 0;
  padding: 4px 0;
  font-weight: bold;
  font-size: 13px;
  width: 100%;
}

/* ===== GIFS MÉTÉO ===== */
.weather-gif {
  width: 50px;
  height: 50px;
  display: block;
  margin: 5px auto;
  position: relative;
  z-index: 15 !important;
}

/* ===== TEMPÉRATURES ===== */
.temperature-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  padding: 3px 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.min-temp {
  color: #64B5F6 !important;
  font-weight: bold;
  font-size: 16px;
}

.max-temp {
  color: #FFA726 !important;
  font-weight: bold;
  font-size: 16px;
}

/* ===== DÉTAILS MÉTÉO ===== */
.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
}

.weather-detail-item {
  padding: 3px 6px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

/* ===== CONDITION MÉTÉO ===== */
.weather-condition {
  font-size: 13px;
  text-align: center;
  margin: 5px 0;
  font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Desktop (1101px+) */
@media (min-width: 1101px) {
  .weather-sidebar {
    top: 120px !important;
    left: 10px !important;
    width: 280px !important;
    max-width: 280px !important;
  }
  
  .weather-show-btn {
    top: 110px !important;
    left: 10px !important;
  }
}

/* Tablette (768px - 1100px) */
@media (min-width: 768px) and (max-width: 1100px) {
  .weather-sidebar {
    width: 300px !important;
    max-width: 300px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
  
  .weather-mobile-btn {
    display: none !important;
  }
  
  .weather-show-btn {
    display: flex !important;
    opacity: 1 !important;
    top: 70px !important;
    left: 10px !important;
  }
  
  .weather-day > img.weather-gif,
  .weather-day img[src*="images/weather-gifs"] {
    position: absolute !important;
    top: 40px !important;
    right: 10px !important;
    width: 45px !important;
    height: 45px !important;
    margin: 0 !important;
    z-index: 15 !important;
  }
  
  .weather-day > div[style*="flex: 1"] {
    font-size: 18px !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin-bottom: 5px !important;
    display: block !important;
    width: 80% !important;
  }
}

/* Mobile (767px et moins) */
@media (max-width: 767px) {
  .weather-sidebar {
    width: 98% !important;
    max-width: 380px !important;
    max-height: 98vh !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    padding: 10px 12px !important;
    z-index: 9999 !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
  }
  
  .weather-mobile-btn {
    display: flex !important;
    top: 70px !important;
    left: 5px !important;
    width: 40px;
    height: 40px;
  }
  
  .weather-show-btn {
    display: none !important;
  }
  
  .weather-day img[src*="images/weather-gifs"] {
    width: 60px !important;
    height: 60px !important;
    top: 5px !important;
  }
}