/* ============================================================================
   CALENDAR BASE - Styles de base communs à tous les calendriers
   ============================================================================ */

/* Reset de base */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body { 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  padding: 20px;
}

/* ============================================================================
   LAYOUT PRINCIPAL
   ============================================================================ */

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  overflow: hidden;
}

.header {
  color: white;
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 16px;
}

.user-email {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.main-content {
  padding: 1px;
}

/* ============================================================================
   CALENDRIER - STRUCTURE DE BASE
   ============================================================================ */

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.calendar-nav {
  display: flex;
  gap: 15px;
  align-items: center;
}

.month-year {
  font-size: 26px;
  font-weight: 700;
  color: #2c3e50;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: #f8f9fa;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.day-header {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  color: white;
  padding: 18px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   JOURS DU CALENDRIER - STRUCTURE
   ============================================================================ */

.day {
  background: white;
  min-height: 120px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
}

.day:hover {
  background: #f8f9fa;
  transform: scale(1.03);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.day.other-month {
  background: #f8f9fa;
  color: #bdc3c7;
  cursor: not-allowed;
}

.day.past {
  background: #f8f9fa;
  color: #bdc3c7;
  cursor: not-allowed;
}

.day-number {
  font-weight: 700;
  font-size: 18px;
}

.day-status {
  font-size: 11px;
  text-align: center;
  margin-top: 5px;
  font-weight: 500;
}

/* ============================================================================
   INFORMATIONS DE CAPACITÉ
   ============================================================================ */

.capacity-info {
  font-size: 10px;
  text-align: center;
  margin-top: 4px;
  padding: 3px 6px;
  border-radius: 5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.capacity-good {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
}

.capacity-warning {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.capacity-full {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

.capacity-icon {
  font-size: 8px;
}

/* ============================================================================
   SECTIONS DE CONTENU
   ============================================================================ */

.dog-selection, .my-reservations {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
}

.dog-selection h3, .my-reservations h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.my-reservations h3 {
  font-size: 20px;
  margin-bottom: 20px;
}

.dogs-count {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  text-align: center;
}

/* ============================================================================
   SÉLECTEUR DE CHIEN
   ============================================================================ */

.dog-select {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 16px;
  background: white;
  transition: all 0.3s ease;
}

.dog-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dog-info {
  margin-top: 15px;
  padding: 15px;
  background: white;
  border-radius: 10px;
  border-left: 4px solid #27ae60;
  display: none;
}

.dog-info.show {
  display: block;
}

.dog-info h4 {
  color: #27ae60;
  margin-bottom: 8px;
  font-size: 16px;
}

.dog-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 14px;
  color: #555;
}

/* ============================================================================
   STATUTS DES CHIENS
   ============================================================================ */

.dogs-status-summary {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  padding: 15px;
  margin-top: 15px;
  border: 1px solid rgba(0,0,0,0.1);
}

.status-counts {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  margin-bottom: 15px;
}

.status-item {
  text-align: center;
  flex: 1;
}

.status-number {
  font-size: 24px;
  font-weight: bold;
  display: block;
}

.status-number.approved { color: #27ae60; }
.status-number.pending { color: #f39c12; }
.status-number.rejected { color: #e74c3c; }

.status-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dogs-list {
  font-size: 14px;
  color: #555;
  line-height: 1.4;
}

.dogs-list strong {
  color: #2c3e50;
}

/* ============================================================================
   ACTIONS ET BOUTONS
   ============================================================================ */

.actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 25px;
}

/* ============================================================================
   LÉGENDE
   ============================================================================ */

.legend {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
}

.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ============================================================================
   RÉSERVATIONS
   ============================================================================ */

.reservation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.reservation-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.reservation-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.reservation-date {
  font-size:16px;
  font-weight: 600;
  color: #2c3e50;
}

.reservation-dog {
  font-size: 14px;
  color: #27ae60;
  font-weight: 500;
}

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

@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 15px;
  }
  
  .main-content {
    padding: 25px;
  }
  
  .calendar {
    font-size: 12px;
  }
  
  .day {
    min-height: 100px;
    padding: 6px;
  }
  
  .capacity-info {
    font-size: 9px;
    padding: 2px 4px;
  }
  
  .capacity-icon {
    font-size: 7px;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .legend {
    gap: 15px;
  }
  
  .header {
    padding: 20px;
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .dog-details {
    grid-template-columns: 1fr;
  }
  
  .status-counts {
    flex-direction: column;
    gap: 10px;
  }
}

/* ============================================================================
   CSS POUR L'AFFICHAGE DES CAPACITÉS PAR TYPE DE BOX - AJOUT AU calendar-user.css
   ============================================================================ */

/* Conteneur principal pour l'affichage de capacité par type de box */
.box-capacity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  margin-top: 4px;
}

/* Styles pour les capacités des boxes standards */
.capacity-single {
  padding: 1px 3px;
  border-radius: 3px;
  text-align: center;
  font-weight: 500;
  border: 1px solid;
}

.capacity-single.good {
  background: rgba(40, 167, 69, 0.2);
  color: #155724;
  border-color: rgba(40, 167, 69, 0.3);
}

.capacity-single.warning {
  background: rgba(255, 193, 7, 0.3);
  color: #856404;
  border-color: rgba(255, 193, 7, 0.5);
}

.capacity-single.full {
  background: rgba(220, 53, 69, 0.3);
  color: #721c24;
  border-color: rgba(220, 53, 69, 0.5);
}

/* Styles pour les capacités des boxes doubles */
.capacity-double {
  padding: 1px 3px;
  border-radius: 3px;
  text-align: center;
  font-weight: 500;
  border: 1px solid;
}

.capacity-double.good {
  background: rgba(23, 162, 184, 0.2);
  color: #0c5460;
  border-color: rgba(23, 162, 184, 0.3);
}

.capacity-double.warning {
  background: rgba(253, 126, 20, 0.3);
  color: #8a4a06;
  border-color: rgba(253, 126, 20, 0.5);
}

.capacity-double.full {
  background: rgba(220, 53, 69, 0.3);
  color: #721c24;
  border-color: rgba(220, 53, 69, 0.5);
}

/* Styles pour les jours selon l'état des réservations */
.day.dog-reserved {
  background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
  color: white;
  cursor: not-allowed;
}

.day.no-double-box {
  background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
  color: white;
  cursor: not-allowed;
}

.day.no-box {
  background: linear-gradient(135deg, #dc3545 0%, #6f42c1 100%);
  color: white;
  cursor: not-allowed;
}

/* Amélioration des styles existants pour les jours de capacité */
.day.capacity-warning {
  border: 2px solid #ffc107;
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.day.capacity-full {
  border: 2px solid #dc3545;
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
  cursor: not-allowed;
}

/* Hover effects pour les jours cliquables */
.day:not(.past):not(.other-month):not(.capacity-full):not(.dog-reserved):not(.no-box):not(.no-double-box):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: #007bff;
}

.day:not(.past):not(.other-month):not(.capacity-full):not(.dog-reserved):not(.no-box):not(.no-double-box):hover .box-capacity-info {
  opacity: 0.8;
}

/* Styles pour les réservations de l'utilisateur */
.day.my-reservation {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  cursor: default;
}

.day.my-reservation .box-capacity-info {
  opacity: 0.7;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .box-capacity-info {
    font-size: 9px;
    gap: 1px;
  }
  
  .capacity-single,
  .capacity-double {
    padding: 1px 2px;
  }
}

/* Animation pour les changements d'état */
.day {
  transition: all 0.3s ease;
}

.box-capacity-info {
  transition: opacity 0.2s ease;
}

/* Amélioration de la légende */
.legend {
  margin-top: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 8px 0;
  font-size: 14px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 10px;
  border: 1px solid rgba(0,0,0,0.1);
}

/* Styles spécifiques pour les messages de statut */
.day-status {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.8;
  text-align: center;
  font-weight: 500;
}

/* Messages d'état dans les réservations */
.reservation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.reservation-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.reservation-info {
  flex: 1;
}

.reservation-date {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.reservation-dog {
  color: #666;
  font-size: 14px;
}

.reservation-price {
  color: #28a745;
  font-weight: bold;
  font-size: 14px;
  margin-top: 4px;
}

.cancel-btn {
  padding: 8px 16px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s ease;
}

.cancel-btn:hover {
  background: #c82333;
}

/* Messages de succès/erreur améliorés */
.success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 10px 0;
  border: none;
  box-shadow: 0 3px 6px rgba(40, 167, 69, 0.3);
}

.error {
  background: linear-gradient(135deg, #dc3545, #fd7e14);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 10px 0;
  border: none;
  box-shadow: 0 3px 6px rgba(220, 53, 69, 0.3);
}

/* ========================================
   ÉTATS DES JOURS DU CALENDRIER
   ======================================== */

/* Jour sélectionné (état normal) */
.calendar .day.selected {
    background: #2196F3;
    color: white;
    border: 2px solid #1976D2;
    transition: all 0.3s ease;
}

/* Jour sélectionné AU SURVOL (hover) */
.calendar .day.selected:hover {
    background: #1976D2 !important; /* Bleu plus foncé */
    border-color: #0D47A1 !important;
    transform: scale(0.95); /* Légère réduction */
    cursor: pointer;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

/* Animation lors de la DÉ-sélection */
.calendar .day.deselecting {
    animation: deselect-animation 0.4s ease-out;
    background: #FFF3E0 !important; /* Orange clair temporaire */
}

@keyframes deselect-animation {
    0% {
        background: #2196F3;
        transform: scale(1);
    }
    50% {
        background: #FF9800; /* Orange vif au milieu */
        transform: scale(1.1);
    }
    100% {
        background: white;
        transform: scale(1);
    }
}

/* Alternative : Effet "pulse" rouge lors de la désélection */
.calendar .day.deselecting-red {
    animation: deselect-red 0.3s ease-out;
}

@keyframes deselect-red {
    0% {
        background: #2196F3;
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    50% {
        background: #EF5350; /* Rouge clair */
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        background: white;
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}