/* =========================
   CALENDRIER ADAPTATIF
   S'adapte automatiquement selon l'appareil
   ========================= */

.calendar-container {
  margin: 3rem 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 16px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.calendar-container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.1);
}

.calendar-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.03) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light, #f9fafb);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.calendar-subtitle {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.95rem;
  margin: 0;
  opacity: 0.8;
}

.responsive-calendar {
  position: relative;
  padding: 1.5rem;
  min-height: 600px;
}

.calendar-iframe {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  width: calc(100% - 3rem);
  border-radius: 12px;
  border: none;
  background: #ffffff;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.calendar-iframe {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  width: calc(100% - 3rem);
  height: 550px;
  border-radius: 12px;
  border: none;
  background: #ffffff;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

/* Bouton toggle calendar */
.calendar-toggle-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text-primary, #2c3e50);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.calendar-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =========================
   RESPONSIVE BREAKPOINTS - TAILLE UNIQUEMENT
   ========================= */

/* TABLETS - 768px à 1024px */
@media (max-width: 1024px) and (min-width: 768px) {
  .calendar-iframe {
    height: 450px;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
  }
  
  .responsive-calendar {
    min-height: 500px;
    padding: 1rem;
  }
}

/* MOBILE LANDSCAPE - 568px à 767px */
@media (max-width: 767px) and (min-width: 568px) {
  .calendar-iframe {
    height: 400px;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
  }
  
  .responsive-calendar {
    min-height: 450px;
    padding: 1rem;
  }
}

/* MOBILE PORTRAIT - 320px à 567px */
@media (max-width: 567px) {
  .calendar-iframe {
    height: 350px;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    width: calc(100% - 1.5rem);
    border-radius: 8px;
  }
  
  .responsive-calendar {
    min-height: 400px;
    padding: 0.75rem;
  }
  
  .calendar-actions {
    position: static;
    transform: none;
    padding: 1rem 0 0;
    text-align: center;
  }
  
  .calendar-btn {
    width: 100%;
    max-width: 200px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    justify-content: center;
  }
}

/* TRÈS PETIT MOBILE - < 320px */
@media (max-width: 319px) {
  .calendar-iframe {
    height: 300px;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    width: calc(100% - 1rem);
  }
  
  .responsive-calendar {
    min-height: 350px;
    padding: 0.5rem;
  }
}

/* =========================
   ÉTATS DE CHARGEMENT
   ========================= */

.calendar-iframe {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.calendar-iframe[src] {
  opacity: 1;
}

.responsive-calendar.loaded::before {
  opacity: 0;
}

/* =========================
   MODE SOMBRE
   ========================= */

@media (prefers-color-scheme: dark) {
  .calendar-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .calendar-header {
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.05) 0%, 
      rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .calendar-iframe {
    box-shadow: 
      0 4px 16px rgba(0, 0, 0, 0.2),
      0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

/* =========================
   ANIMATIONS D'ENTRÉE
   ========================= */

.calendar-container {
  opacity: 0;
  transform: translateY(30px);
  animation: calendarSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
}

@keyframes calendarSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   ACCESSIBILITÉ
   ========================= */

@media (prefers-reduced-motion: reduce) {
  .calendar-container,
  .calendar-iframe,
  .calendar-btn {
    animation: none !important;
    transition: none !important;
  }
}

.calendar-btn:focus-visible {
  outline: 2px solid var(--primary-600, #00b4d8);
  outline-offset: 2px;
}

/* Améliorer la lisibilité sur petits écrans */
@media (max-width: 567px) {
  .calendar-container {
    font-size: 0.95rem;
  }
}