/* ============================================================
   CHALET DU PÈRE SAPIN — Calendrier de disponibilités
   calendar.css
   ============================================================ */

/* ── Section wrapper ─────────────────────────────────────── */
.cal-section {
  padding: 3rem 1rem;
  background: #F5F0E8;
}

.cal-section-inner {
  max-width: 80rem;
  margin: 0 auto;
}

.cal-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.cal-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.cal-section-sub {
  color: rgba(26,26,26,0.55);
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

/* ── Widget ──────────────────────────────────────────────── */
.cal-widget {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.08);
  padding: 1.5rem;
  overflow: hidden;
}

/* ── Navigation ──────────────────────────────────────────── */
.cal-nav {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.cal-nav-btn {
  background: #1A1A1A;
  color: #C9A84C;
  border: none;
  border-radius: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.25rem;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav-btn:hover {
  background: #C9A84C;
  color: #1A1A1A;
  transform: scale(1.08);
}

.cal-months-wrapper {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  flex-wrap: wrap;
}

/* ── Mois ────────────────────────────────────────────────── */
.cal-month {
  flex: 1;
  min-width: 220px;
}

.cal-month-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1A1A1A;
  text-align: center;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

/* ── Grille 7 colonnes ───────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-header-cell {
  text-align: center;
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(26,26,26,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
}

/* ── Cellules ────────────────────────────────────────────── */
.cal-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform 0.12s;
  overflow: hidden;
  min-height: 36px;
}

.cal-empty {
  background: transparent;
}

.cal-past {
  background: #F0EDE8;
}

.cal-past .cal-day-num {
  color: rgba(26,26,26,0.25);
}

.cal-available {
  background: #E8F5E9;
  border: 1px solid #A5D6A7;
}

.cal-available:hover {
  transform: scale(1.08);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.cal-reserved {
  background: #FFEBEE;
  border: 1px solid #EF9A9A;
  cursor: help;
}

.cal-reserved:hover {
  transform: scale(1.08);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.cal-today {
  outline: 2px solid #C9A84C;
  outline-offset: -2px;
}

.cal-day-num {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1;
}

.cal-available .cal-day-num { color: #2E7D32; }
.cal-reserved .cal-day-num  { color: #C62828; }

.cal-res-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #C62828;
  line-height: 1;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* ── Légende ─────────────────────────────────────────────── */
.cal-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: rgba(26,26,26,0.65);
}

.cal-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.cal-legend-available { background: #A5D6A7; border: 1px solid #81C784; }
.cal-legend-reserved  { background: #EF9A9A; border: 1px solid #E57373; }
.cal-legend-past      { background: #E0D8CE; border: 1px solid #BCAAA4; }
.cal-legend-selected  { background: #C9A84C; }

/* ── Sélection de plage ─────────────────────────────────── */
.cal-available {
  cursor: pointer;
}

.cal-sel-start,
.cal-sel-end {
  background: #C9A84C !important;
  border-color: #B8943E !important;
}

.cal-sel-start .cal-day-num,
.cal-sel-end .cal-day-num {
  color: #fff !important;
  font-weight: 700;
}

.cal-sel-range {
  background: rgba(201,168,76,0.22) !important;
  border-color: rgba(201,168,76,0.4) !important;
  border-radius: 0 !important;
}

.cal-sel-range .cal-day-num {
  color: #7a5c10 !important;
}

.cal-sel-hover {
  background: rgba(201,168,76,0.12) !important;
  border-color: rgba(201,168,76,0.3) !important;
}

.cal-sel-hover .cal-day-num {
  color: #9a7420 !important;
}

/* ── Message d'erreur sélection ──────────────────────────── */
.cal-selection-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 0.5rem;
  color: #856404;
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  text-align: center;
}

/* ── Bouton réservation conditionnel ─────────────────────── */
.cal-reserve-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1A1A1A;
  color: #fff;
  border: none;
  padding: 0.85rem 2rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
  text-decoration: none;
  border-radius: 2px;
}

.cal-reserve-btn:hover:not([disabled]):not(.disabled) {
  background: #C9A84C;
  color: #1A1A1A;
  transform: translateY(-1px);
}

.cal-reserve-btn[disabled],
.cal-reserve-btn.disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.cal-reserve-hint {
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  color: rgba(26,26,26,0.5);
  margin-top: 0.4rem;
  font-style: italic;
}

.cal-section-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

/* ── Tooltip ─────────────────────────────────────────────── */
.cal-tooltip {
  position: absolute;
  background: #1A1A1A;
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .cal-months-wrapper {
    flex-direction: column;
  }
  .cal-month {
    min-width: unset;
  }
  .cal-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   ADMIN — Page de gestion des réservations
   ============================================================ */

/* ── Login overlay ───────────────────────────────────────── */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1A1A1A 0%, #2C2C2C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.admin-login-box {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}

.admin-login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 0.25rem;
}

.admin-login-sub {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: rgba(26,26,26,0.5);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.admin-login-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #E8E0D0;
  border-radius: 0.6rem;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: #1A1A1A;
  background: #FAFAF8;
  margin-bottom: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 0.15em;
}

.admin-login-input:focus {
  outline: none;
  border-color: #C9A84C;
}

.admin-login-btn {
  width: 100%;
  padding: 0.9rem;
  background: #1A1A1A;
  color: #C9A84C;
  border: none;
  border-radius: 0.6rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.admin-login-btn:hover {
  background: #C9A84C;
  color: #1A1A1A;
}

.admin-login-error {
  color: #C62828;
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  display: none;
}

/* ── Admin layout ────────────────────────────────────────── */
.admin-body {
  background: #F5F0E8;
  min-height: 100vh;
  font-family: 'Lato', sans-serif;
}

.admin-header {
  background: #1A1A1A;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.admin-header-title {
  font-family: 'Playfair Display', serif;
  color: #C9A84C;
  font-size: 1.2rem;
  font-weight: 700;
}

.admin-header-sub {
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.admin-logout-btn {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.4);
  color: #C9A84C;
  padding: 0.4rem 1rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Lato', sans-serif;
}

.admin-logout-btn:hover {
  background: #C9A84C;
  color: #1A1A1A;
}

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ── Tabs chalets ────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 0.6rem 1.4rem;
  border-radius: 2rem;
  border: 2px solid #1A1A1A;
  background: transparent;
  color: #1A1A1A;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-tab:hover, .admin-tab.active {
  background: #1A1A1A;
  color: #C9A84C;
}

/* ── Formulaire d'ajout ──────────────────────────────────── */
.admin-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  margin-bottom: 1.5rem;
}

.admin-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

@media (max-width: 768px) {
  .admin-form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(26,26,26,0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-form-input, .admin-form-select {
  padding: 0.65rem 0.85rem;
  border: 2px solid #E8E0D0;
  border-radius: 0.5rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: #1A1A1A;
  background: #FAFAF8;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.admin-form-input:focus, .admin-form-select:focus {
  outline: none;
  border-color: #C9A84C;
}

.admin-add-btn {
  padding: 0.65rem 1.5rem;
  background: #C9A84C;
  color: #1A1A1A;
  border: none;
  border-radius: 0.5rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.admin-add-btn:hover {
  background: #B8943E;
  transform: translateY(-1px);
}

/* ── Liste des réservations ──────────────────────────────── */
.admin-res-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-res-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #FAFAF8;
  border: 1px solid #E8E0D0;
  border-radius: 0.6rem;
  transition: box-shadow 0.15s;
}

.admin-res-item:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.admin-res-dates {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1A1A1A;
  min-width: 200px;
}

.admin-res-label {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-reserve  { background: #FFEBEE; color: #C62828; }
.label-bloque   { background: #FFF3E0; color: #E65100; }
.label-entretien{ background: #E3F2FD; color: #1565C0; }
.label-option   { background: #F3E5F5; color: #6A1B9A; }

.admin-res-note {
  flex: 1;
  font-size: 0.82rem;
  color: rgba(26,26,26,0.5);
  font-style: italic;
}

.admin-res-delete {
  background: transparent;
  border: 1px solid #EF9A9A;
  color: #C62828;
  padding: 0.3rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.admin-res-delete:hover {
  background: #FFEBEE;
}

.admin-empty-state {
  text-align: center;
  padding: 2rem;
  color: rgba(26,26,26,0.4);
  font-size: 0.9rem;
}

/* ── Calendrier admin (aperçu) ───────────────────────────── */
.admin-cal-preview {
  margin-top: 1.5rem;
}

/* ── Toast notification ──────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1A1A1A;
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 0.6rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 9999;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.4s, transform 0.4s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-toast.hide {
  opacity: 0;
  transform: translateY(1rem);
}

.admin-toast-icon {
  font-size: 1.1rem;
}

/* ── Stats rapides ───────────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

.admin-stat-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(26,26,26,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1;
}

.admin-stat-sub {
  font-size: 0.75rem;
  color: rgba(26,26,26,0.4);
}
