:root {
  --accent: #1f2933;
  --accent-light: #e4f4f1;
  --border-soft: #dcdfe4;
  --text-main: #111827;
  --text-muted: #6b7280;
  --bg-surface: #ffffff;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.18);
  --radius-pill: 999px;
  --radius-card: 18px;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Wrapper */
.date-picker {
  position: relative;
  display: inline-block;
}

/* Button that opens the calendar */
.date-picker-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-pill);
  border: none;
  outline: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(15, 122, 107, 0.45);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.date-picker-button:hover {
  background: #4b5563;
}

.date-picker-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(15, 122, 107, 0.35);
}

.date-picker-button-label {
  white-space: nowrap;
}

/* Popup container */
.calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: none;
}

.date-picker.is-open .calendar-popup {
  display: block;
}

/* Card styling around Pikaday */
.calendar-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 10px 12px 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}

/* --- Pikaday overrides to match screenshot --- */

.calendar-card .pika-single {
  box-shadow: none;
  border: none;
  background: transparent;
  font-family: var(--font-main);
}

.calendar-card .pika-title {
  padding: 4px 4px 8px;
  position: relative;
}

.calendar-card .pika-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.calendar-card .pika-prev,
.calendar-card .pika-next {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  text-indent: -9999px;
  overflow: hidden;
  position: relative;
  background: transparent;
  border: none;
}

.calendar-card .pika-prev::before,
.calendar-card .pika-next::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  transform: rotate(135deg);
}
.calendar-card .pika-next::before {
  transform: rotate(-45deg);
}

.calendar-card .pika-prev:hover,
.calendar-card .pika-next:hover {
  background: var(--accent-light);
}

.calendar-card .pika-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar-card .pika-table th {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: 6px;
}

.calendar-card .pika-table abbr {
  text-decoration: none;
}

.calendar-card .pika-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  line-height: 32px;
  margin: 1px auto;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.calendar-card .pika-button:hover {
  background: var(--accent-light);
}

.calendar-card .is-today .pika-button {
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}

.calendar-card .is-selected .pika-button {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.calendar-card .is-disabled .pika-button {
  opacity: 0.3;
  cursor: default;
}

.calendar-card .pika-week {
  display: none; /* hide week numbers if enabled */
}

/* small responsive tweak */
@media (max-width: 480px) {
  .calendar-card {
    transform: scale(0.95);
    transform-origin: top left;
  }
}

.calendar-card .pika-button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  padding: 0;
  margin: 0 auto;
  cursor: pointer;
  line-height: 1; /* Ensures number is centered */
}

.calendar-card .is-today .pika-button {
  box-shadow: inset 0 0 0 2px var(--accent); /* thinner ring looks centered */
}

.calendar-card .is-selected .pika-button {
  background: rgb(1, 127, 112);
  color: #fff;
}

.calendar-card .is-disabled .pika-button {
  opacity: 0.3;
  cursor: default;
  pointer-events: none; /* extra safety */
}

/* Toolbar: date picker + extra controls */
.puzzle-toolbar {
  display: flex;
  align-items: center;
  gap: 12px; /* space between date button & Reveal All */
  margin-bottom: 24px; /* space between the toolbar and the waffle grid */
}

/* Generic secondary pill button (Reveal All) */
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}

.toolbar-btn:hover {
  background: #f9fafb;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.toolbar-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

/* SVG calendar icon inside the button */
.date-picker-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.date-picker-button-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
