/* ============================================================================
 * Module : shared/styles/components/date-range-picker.css
 * Rôle   : Styles du composant <mda-date-range-picker> (2 triggers + popovers
 *          calendrier mois).
 *
 * Dépend de : tokens.css
 * Utilisé par : <mda-date-range-picker> (devis.html + factures.html à venir + ...)
 * ============================================================================ */

mda-date-range-picker {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.drp-field {
  position: relative;
  min-width: 170px;
}

.drp-label {
  display: block;
  font-size: .72rem;
  font-weight: var(--weight-bold);
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.drp-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--brand-100);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-family: inherit;
  color: var(--brand-dark);
  background: var(--brand-50);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast);
}
.drp-trigger:hover { border-color: var(--brand-mid); }

.drp-text {
  flex: 1;
  font-weight: var(--weight-medium);
}

.drp-icon {
  font-size: .95rem;
}

.drp-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: .78rem;
  color: var(--gray-500);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.drp-clear:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ─── Popover calendrier ──────────────────────────────────────── */
.drp-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 999;
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .14), 0 4px 12px rgba(0, 0, 0, .08);
  min-width: 310px;
  animation: drpSlideIn .2s ease;
}
@keyframes drpSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.drp-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drp-cal-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.drp-nav {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  color: var(--brand);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  font-weight: var(--weight-bold);
}
.drp-nav:hover { background: var(--brand-100); }

.drp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
}
.drp-weekdays span {
  font-size: .72rem;
  font-weight: var(--weight-bold);
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 0;
}

.drp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.drp-day {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: var(--weight-medium);
  cursor: pointer;
  color: var(--gray-700);
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  background: transparent;
  margin: 0 auto;
  font-family: inherit;
}
.drp-day:hover { background: var(--brand-50); color: var(--brand); }
.drp-day.other-month {
  color: var(--gray-300);
  cursor: default;
}
.drp-day.other-month:hover { background: transparent; color: var(--gray-300); }
.drp-day.today {
  background: var(--brand-50);
  color: var(--brand);
  font-weight: var(--weight-bold);
  border: 2px solid var(--brand-mid);
}
.drp-day.selected {
  background: var(--brand);
  color: white;
  font-weight: var(--weight-bold);
  box-shadow: 0 3px 10px rgba(6, 95, 70, .3);
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .drp-field { min-width: 140px; }
  .drp-popover {
    left: auto;
    right: 0;
  }
}
