/**
 * LibZen MonthPicker — YYYY-MM period control with optional “all months”.
 */

:root {
  --libzen-mp-bg: var(--bg, #0f1419);
  --libzen-mp-surface: var(--surface, #1a2332);
  --libzen-mp-text: var(--text, #e2e8f0);
  --libzen-mp-muted: var(--text-muted, #94a3b8);
  --libzen-mp-border: var(--border, #2d3a4f);
  --libzen-mp-hover: rgba(255, 255, 255, 0.06);
  --libzen-mp-accent: var(--accent, #3b82f6);
  --libzen-mp-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --libzen-mp-radius: 6px;
  --libzen-mp-font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-libzen-month-theme='light'] {
  --libzen-mp-bg: #ffffff;
  --libzen-mp-surface: #ffffff;
  --libzen-mp-text: #37352f;
  --libzen-mp-muted: #9b9a97;
  --libzen-mp-border: rgba(55, 53, 47, 0.16);
  --libzen-mp-hover: rgba(55, 53, 47, 0.06);
  --libzen-mp-accent: #2383e2;
  --libzen-mp-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,
    rgba(15, 15, 15, 0.1) 0px 3px 6px;
}

.libzen-mp-root {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--libzen-mp-font);
  color: var(--libzen-mp-text);
}

.libzen-mp-control {
  position: relative;
  display: flex;
  align-items: center;
}

.libzen-mp-trigger {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.5rem;
  border: none;
  border-radius: var(--libzen-mp-radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.libzen-mp-trigger:hover,
.libzen-mp-trigger[aria-expanded='true'] {
  background: var(--libzen-mp-hover);
}

.libzen-mp-trigger:focus-visible {
  outline: 2px solid var(--libzen-mp-accent);
  outline-offset: 1px;
}

.libzen-mp-label {
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.libzen-mp-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--libzen-mp-radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.libzen-mp-step:hover {
  background: var(--libzen-mp-hover);
}

.libzen-mp-step:focus-visible {
  outline: 2px solid var(--libzen-mp-accent);
  outline-offset: 1px;
}

.libzen-mp-chevron {
  display: block;
  width: 7px;
  height: 7px;
  border-style: solid;
  border-color: currentColor;
  border-width: 0 0 2px 2px;
  flex-shrink: 0;
}

.libzen-mp-chevron-prev {
  transform: rotate(45deg);
  margin-left: 2px;
}

.libzen-mp-chevron-next {
  transform: rotate(-135deg);
  margin-right: 2px;
}

.libzen-mp-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 220px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--libzen-mp-border);
  background: var(--libzen-mp-surface);
  box-shadow: var(--libzen-mp-shadow);
  color: var(--libzen-mp-text);
}

.libzen-mp-popover[hidden] {
  display: none;
}

.libzen-mp-year {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
}

.libzen-mp-year-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.libzen-mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.libzen-mp-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: var(--libzen-mp-radius);
  background: transparent;
  color: var(--libzen-mp-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.libzen-mp-option:hover {
  background: var(--libzen-mp-hover);
}

.libzen-mp-option.is-selected {
  color: var(--libzen-mp-accent);
  background: color-mix(in srgb, var(--libzen-mp-accent) 18%, var(--libzen-mp-surface));
}

.libzen-mp-option-all {
  width: 100%;
  margin-bottom: 6px;
  border: 1px solid var(--libzen-mp-border);
}

.libzen-mp-root:not(.libzen-mp-transparent) .libzen-mp-trigger {
  border: 1px solid var(--libzen-mp-border);
  background: var(--libzen-mp-bg);
}

.libzen-mp-disabled {
  opacity: 0.55;
  pointer-events: none;
}
