/*
 * OPLEX — month picker styles. Companion to oplexMonthPicker.js.
 * Replaces native <input type="month"> visuals on billings pages.
 */

.oplex-month-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: 100%;
}

.oplex-month-input--enhanced {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

.oplex-month-trigger {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  text-align: left;
}

.oplex-month-trigger:hover {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.05);
}

.oplex-month-trigger:focus-visible {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.20);
}

.oplex-month-trigger__value {
  flex: 1;
  text-transform: capitalize;
  font-variant-numeric: tabular-nums;
}

.oplex-month-trigger__value.is-empty::before {
  content: attr(data-empty);
  color: #6b7280;
  font-weight: 400;
  text-transform: none;
}

.oplex-month-trigger svg {
  stroke: #9ca3af;
  flex-shrink: 0;
}

/* ---------- Popup ---------- */

.oplex-month-popup {
  position: absolute;
  z-index: 9999;
  width: 280px;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.30);
  padding: 14px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: #e5e7eb;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.oplex-month-popup.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.oplex-month-popup__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.oplex-month-popup__title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #f3f4f6;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.oplex-month-nav {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, border-color 120ms;
}

.oplex-month-nav:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ---------- Month grid: 3 cols × 4 rows ---------- */

.oplex-month-popup__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.oplex-month-cell {
  padding: 12px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #d1d5db;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
  transition: background 100ms, border-color 100ms, color 100ms, transform 60ms;
}

.oplex-month-cell:hover {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.30);
  color: #f3f4f6;
}

.oplex-month-cell:active {
  transform: translateY(1px);
}

.oplex-month-cell.is-current {
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.oplex-month-cell.is-selected,
.oplex-month-cell.is-selected:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* ---------- Footer ---------- */

.oplex-month-popup__footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.oplex-month-quick {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #d1d5db;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.oplex-month-quick:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f3f4f6;
}
