/*
 * THE PANEL'S BANDS — the calendar, the time row under it, and the footer of
 * quick actions. The field's own frame is `date_field.css`.
 *
 * The panel's inset is the smallest rung, not a page gutter: the popover already
 * pads itself, so what this buys is an edge day's focus ring not meeting the
 * popup's own edge.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  /* THE TIME FORMAT'S TRIGGER — the bordered surface a `Select` uses, hovering on
     its BORDER, its open edge wearing the SAME ring keyboard focus does
     (`docs/accessibility.md`). The other formats' frame is `date_field.css`,
     which is why every rule below names the format it belongs to. */
  .lotics-date-picker[data-format="time"] {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    min-height: var(--lotics-control-height);
    gap: var(--lotics-space-6);
    margin: 0;
    padding-block: var(--lotics-control-pad-y);
    padding-inline: var(--lotics-space-8);
    border-width: 1px;
    border-style: solid;
    border-color: var(--border);
    border-radius: var(--lotics-radius-control);
    background-color: var(--card);
    background-image: none;
    color: var(--lotics-ink-default);
    --lotics-icon-color: var(--lotics-ink-muted);
    font-family: var(--font-sans);
    font-size: var(--lotics-text-sm);
    line-height: var(--lotics-leading-sm);
    letter-spacing: var(--lotics-tracking-sm);
    font-weight: var(--lotics-weight-regular);
    text-align: start;
    appearance: none;
    /* A field trigger SETS a value rather than acting on its own — the kit's
       cursor rule keeps the arrow for it. */
    cursor: default;
    outline-style: none;
    transition-property: border-color, outline-color;
    transition-duration: var(--lotics-duration-fast);
    transition-timing-function: var(--lotics-ease-standard);
  }

  .lotics-date-picker[data-format="time"]:not([data-disabled]):not([data-seamless]):hover {
    border-color: var(--lotics-border-hover);
  }

  .lotics-date-picker[data-format="time"]:not([data-seamless]):focus-visible,
  .lotics-date-picker[data-format="time"]:not([data-seamless])[data-popup-open] {
    outline-width: var(--lotics-ring-width);
    outline-style: solid;
    outline-color: var(--ring);
    outline-offset: 0;
  }

  /* ONE BOX, ONE OWNER — with verbs on the field the surface around this trigger
     owns the border, the ground, the inset and the ring (`field_surface.css`),
     so the trigger draws none of them. */
  .lotics-date-picker[data-format="time"][data-seamless] {
    padding-inline: 0;
    border-width: 0;
    background-color: transparent;
  }

  .lotics-date-picker[data-format="time"][data-disabled] {
    background-color: var(--muted);
    opacity: var(--lotics-disabled-opacity);
    --lotics-icon-color: var(--lotics-ink-inactive);
  }

  .lotics-date-picker__panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: var(--lotics-space-4);
  }

  .lotics-date-picker__times {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--lotics-space-12);
  }

  .lotics-date-picker__time {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    gap: var(--lotics-space-4);
  }

  /* A fixed floor, so adding the ✕ that drops a time does not move the field
     under the pointer. */
  .lotics-date-picker__time-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: var(--lotics-leading-sm);
  }

  .lotics-date-picker__add-time {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .lotics-date-picker__footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .lotics-date-picker__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--lotics-space-8);
  }
}
