﻿/* =====================================================
   UI KIT — SCHEDULE BUILDER (Reusable)
   Compact, aligned, consistent
   ===================================================== */

/* ---------- Card ---------- */
.ui-schedule {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface), black 6%);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- Title ---------- */
.ui-schedule__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

    .ui-schedule__title .CMLabel {
        font-size: 12px;
        font-weight: 800;
        color: var(--text-muted);
        white-space: nowrap;
    }

/* ---------- Layout ---------- */
.ui-schedule__row {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: start;
}

/* Left controls */
.ui-schedule__controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
}

/* Right content */
.ui-schedule__lines {
    display: grid;
    grid-template-rows: auto 16px auto;
    gap: 6px;
}

/* ---------- Line grids ---------- */
/* Day | Hour | Minute */
.ui-schedule__line {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 64px 64px;
    gap: 8px;
    align-items: center;
}

/* Arrow between lines */
.ui-schedule__arrow {
    display: grid;
    place-items: center;
    font-weight: 900;
    color: var(--text-subtle);
    user-select: none;
}

/* ---------- Dropdowns ---------- */
.ui-schedule select,
.ui-schedule .CMDropdown {
    height: 34px; /* ↓ was 38 */
    padding: 0 8px; /* tighter */
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface), black 10%);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    outline: none;
    width: 100%;
}

/* Limit day width dominance */
.ui-schedule .cm-day {
    max-width: 200px;
}

/* Hour / minute tighter */
.ui-schedule .cm-hour,
.ui-schedule .cm-minute {
    text-align: center;
}

/* Focus */
.ui-schedule select:focus {
    border-color: var(--main-border);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---------- Buttons ---------- */
.ui-schedule .CMButton {
    height: 34px; /* ↓ match dropdowns */
    min-width: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface), white 4%);
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .ui-schedule .CMButton:hover {
        background: var(--surface-hover);
        border-color: var(--border-strong);
    }

/* Icon buttons */
.ui-schedule__controls .CMRemove,
.ui-schedule__controls .CMAdd {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
}

/* Add */
.ui-schedule__controls .CMAdd {
    background: var(--main);
    border-color: var(--main-border);
    color: #fff;
}

    .ui-schedule__controls .CMAdd:hover {
        background: var(--main-hover);
    }

/* Remove */
.ui-schedule__controls .CMRemove {
    background: color-mix(in srgb, var(--surface), black 12%);
    color: var(--text-muted);
}

/* ---------- Empty state ---------- */
.ui-schedule-start {
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface), black 4%);
}

/* ---------- Mobile safety ---------- */
@media (max-width: 420px) {
    .ui-schedule__line {
        grid-template-columns: 1fr 56px 56px;
    }
}
