/* /opt/skynet-portal/app/static/css/datepicker.css */
/* v0.1.1 — z-index панели 1200 -> 2100: календарь поверх модалки (modal-overlay 2000) */
/* 30.07.2026: v0.1.0 первый выпуск */

/* Поле-триггер: иконка календаря справа */
.dp-display {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7699' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-9, 36px);
  cursor: pointer;
}

/* Поповер календаря */
.dp-popup {
  position: absolute;
  z-index: 2100;
  width: 296px;
  padding: var(--sp-3);
  background: var(--surface-gradient, var(--bg-surface));
  border: var(--border-thin, 1px) solid var(--border-default);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-lg, 0 24px 60px -12px rgba(0, 0, 0, 0.55));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.16s var(--ease-out-soft, ease),
              transform 0.16s var(--ease-out-soft, ease);
}
.dp-popup.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Шапка: навигация + месяц/год */
.dp-header {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--sp-2);
}
.dp-nav {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md, 10px);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.dp-nav:hover {
  background: var(--bg-surface-2);
  color: var(--accent);
}
.dp-title {
  flex: 1 1 auto;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold, 600);
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

/* Дни недели */
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
}
.dp-weekday {
  text-align: center;
  font-size: var(--fs-2xs, 11px);
  font-weight: var(--fw-medium, 500);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0;
}

/* Сетка дней */
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md, 10px);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.dp-day:hover {
  background: var(--bg-surface-2);
}
.dp-day.is-other {
  color: var(--text-muted);
  opacity: 0.5;
}
.dp-day.is-today {
  box-shadow: inset 0 0 0 1px var(--border-accent, var(--accent));
}
.dp-day.is-in-range {
  background: var(--accent-dim, rgba(139, 92, 246, 0.15));
  border-radius: 0;
}
.dp-day.is-range-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.dp-day.is-range-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.dp-day.is-selected,
.dp-day.is-range-start,
.dp-day.is-range-end {
  background: var(--accent);
  color: #fff;
  font-weight: var(--fw-semibold, 600);
}

/* Футер: Сегодня / Очистить */
.dp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: var(--border-thin, 1px) solid var(--border-default);
}
.dp-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium, 500);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius-md, 10px);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.dp-btn:hover {
  background: var(--accent-dim, rgba(139, 92, 246, 0.15));
}
.dp-btn-ghost {
  color: var(--text-tertiary);
}
.dp-btn-ghost:hover {
  color: var(--danger-text, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 480px) {
  .dp-popup { width: calc(100vw - 24px); }
}
