/* ── Schedule create wizard styles ─────────────────────────────────────────
   Loaded globally from the admin layout so they survive HTMX body swaps.
   All selectors are prefixed with .sw-* to avoid collisions.             */

:root {
    --sw-accent: #ff9a3c;
    --sw-accent-soft: rgba(255,154,60,.12);
    --sw-line: #e6e6e6;
    --sw-step: #10b981;
    --sw-step-dark: #059669;
    --sw-step-soft: rgba(16,185,129,.14);
    --sw-step-pending: #d1d5db;
}

/* ─── Progress stepper ──────────────────────────────────────────────────── */
.sw-stepper-wrap {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 20px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.sw-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    position: relative;
}
.sw-step {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    position: relative;
    padding: 0 4px;
}
.sw-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #9ca3af;
    font-weight: 700;
    font-size: .78rem;
    border: 2px solid var(--sw-step-pending);
    position: relative;
    z-index: 2;
    transition: all .25s ease;
}
.sw-step.done .sw-dot {
    background: linear-gradient(180deg, var(--sw-step) 0%, var(--sw-step-dark) 100%);
    border-color: var(--sw-step-dark);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(16,185,129,.3);
}
.sw-step.done .sw-dot::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(16,185,129,.15);
}
.sw-step.now .sw-dot {
    background: #ffffff;
    border-color: var(--sw-step);
    color: var(--sw-step-dark);
    box-shadow: 0 0 0 4px var(--sw-step-soft), 0 1px 4px rgba(16,185,129,.18);
    transform: scale(1.06);
}
.sw-step::before,
.sw-step::after {
    content: "";
    position: absolute;
    top: 12px;
    height: 2px;
    background: var(--sw-step-pending);
    z-index: 1;
}
.sw-step::before { left: 0;  right: 50%; }
.sw-step::after  { left: 50%; right: 0;  }
.sw-step:first-child::before,
.sw-step:last-child::after { display: none; }
.sw-step.done::before,
.sw-step.done::after,
.sw-step.now::before {
    background: linear-gradient(90deg, var(--sw-step) 0%, var(--sw-step-dark) 100%);
}
.sw-label {
    display: block;
    margin-top: 6px;
    font-size: .72rem;
    color: #6b7280;
    letter-spacing: .02em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-step.now  .sw-label { color: var(--sw-step-dark); font-weight: 700; }
.sw-step.done .sw-label { color: #374151; font-weight: 600; }

@media (max-width: 576px) {
    .sw-stepper-wrap { padding: 10px 10px 8px; }
    .sw-dot { width: 22px; height: 22px; font-size: .7rem; }
    .sw-step::before, .sw-step::after { top: 10px; height: 2px; }
    .sw-label { font-size: .66rem; }
}

/* ─── Selection cards ────────────────────────────────────────────────────── */
.sw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.sw-card {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    background: #ffffff;
    text-decoration: none !important;
    color: #111827 !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    display: block !important;
}
.sw-card:hover {
    border-color: var(--sw-accent);
    box-shadow: 0 6px 16px rgba(17,24,39,.08);
    transform: translateY(-2px);
    color: #111827 !important;
    text-decoration: none !important;
}
.sw-card-title  { font-weight: 600; color: #111827; font-size: .98rem; letter-spacing: -.01em; }
.sw-card-meta   { font-size: .82rem; color: #6b7280; margin-top: 4px; }
.sw-card-badge  { display: inline-block; font-size: .7rem; padding: 2px 8px; border-radius: 10px;
                  background: #f4f4f4; color: #555; letter-spacing: .04em; }
.sw-card-add    { border: 2px dashed var(--sw-line); background: #fafafa; color: #666; text-align: center;
                  display: flex; align-items: center; justify-content: center; font-weight: 500; }
.sw-card-add:hover { border-color: var(--sw-accent); background: var(--sw-accent-soft); color: var(--sw-accent); }

/* City chips */
.sw-grid-city {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-template-columns: none;
}
.sw-card-city {
    display: inline-flex !important;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1.5px solid var(--sw-accent);
    color: #111827 !important;
    line-height: 1.2;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
    text-decoration: none !important;
}
.sw-card-city:hover {
    background: var(--sw-accent-soft);
    box-shadow: 0 2px 6px rgba(255,154,60,.25);
    transform: translateY(-1px);
    color: #111827 !important;
}
.sw-card-city .sw-card-title {
    font-weight: 500;
    font-size: .9rem;
    white-space: nowrap;
}

/* ─── Step-summary rows ─────────────────────────────────────────────────── */
.sw-summary {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border: 1px solid var(--sw-line); border-radius: 8px; background: #fafafa; margin-bottom: 8px;
}
.sw-summary-num {
    width: 26px; height: 26px; border-radius: 50%; background: var(--sw-accent); color: white;
    display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600;
}
.sw-summary-body { flex: 1; }
.sw-summary-label { font-size: .72rem; color: #999; text-transform: uppercase; letter-spacing: .05em; }
.sw-summary-value { font-weight: 600; color: #222; }
.sw-summary a  { color: var(--sw-accent) !important; font-size: .85rem; text-decoration: none !important; }
.sw-summary a:hover { text-decoration: underline !important; }
.sw-summary-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--sw-accent) !important;
    text-decoration: none !important;
    transition: background-color .15s ease;
}
.sw-summary-edit:hover { background: var(--sw-accent-soft); text-decoration: none !important; }

/* ─── Step panel & misc ─────────────────────────────────────────────────── */
.sw-panel { border: 1px solid var(--sw-line); border-radius: 10px; padding: 20px; background: white; }
.sw-panel h6 { color: #444; font-weight: 700; letter-spacing: .01em; }
.sw-search { max-width: 320px; }

/* ─── Locked-event banner ───────────────────────────────────────────────── */
.sw-event-locked {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--sw-accent);
    border-radius: 8px;
}
.sw-event-locked-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--sw-accent-soft);
    color: var(--sw-accent);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.sw-event-locked-body { flex: 1; min-width: 0; }
.sw-event-locked-label {
    font-size: 0.7rem; color: #92400e;
    text-transform: uppercase; letter-spacing: 0.05em;
    font-weight: 600;
}
.sw-event-locked-value {
    font-size: 0.95rem; color: #111827; font-weight: 600;
    line-height: 1.3; margin-top: 1px;
}
.sw-event-locked-sub  { font-weight: 400; color: #6b7280; font-size: 0.85rem; }
.sw-event-locked-swap {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    font-size: 0.78rem; font-weight: 500;
    color: #92400e; background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background-color 0.15s, border-color 0.15s;
}
.sw-event-locked-swap:hover {
    background: var(--sw-accent-soft);
    border-color: var(--sw-accent);
    color: #92400e;
    text-decoration: none !important;
}

/* ─── Wizard action buttons ─────────────────────────────────────────────── */
.sw-btn {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
}
.sw-btn-accent {
    background: var(--sw-accent) !important;
    color: #ffffff !important;
    border: 1px solid var(--sw-accent);
}
.sw-btn-accent:hover {
    background: #e8892e !important;
    color: #ffffff !important;
}

/* ─────────────────────────────────────────────────────────────────────
   Step 4 (Schedule details) form polish
   ─────────────────────────────────────────────────────────────────────
   Minimal overrides — lets Bootstrap 5 do the heavy lifting. Brand
   orange (#F08143 — matches .rm-text-orange in main.css) shows up only
   on the primary CTA and the input focus ring, so the form reads
   mostly neutral. Every rule below is scoped under .sw-slot / .sw-time
   / .sw-actions so it can't leak into other pages.
   ────────────────────────────────────────────────────────────────── */

/* Wizard container width — was inline on the step-4 outer div. */
.sw-wizard-container { max-width: 1100px; }
/* Same, but narrower on the single-schedule edit form. */
.sw-edit-container   { max-width: 900px; }

/* Slot card */
.sw-slot { margin-bottom: 1rem !important; }
.sw-slot > .border {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    padding: 1.25rem !important;
}
.sw-slot > .d-flex.align-items-center.justify-content-between {
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f5;
}
.sw-slot > .d-flex .fw-semibold.text-secondary.small {
    color: #212529 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}
.sw-slot > .d-flex .fw-semibold.text-secondary.small i.bi-clock {
    color: #6c757d !important;
    margin-right: 0.4rem !important;
}

/* Sections (Showtimes / Prices / Poster) */
.sw-section { margin-top: 1.25rem; }
.sw-section:first-of-type { margin-top: 0; }
.sw-section-title {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}
.sw-section-title i {
    color: #6c757d;
    margin-right: 0.4rem;
    font-size: 0.9rem;
}

/* "(optional)" modifier next to a section title */
.sw-section-title-opt {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Showtime cards — plain Bootstrap-style card */
.sw-time {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
}
.sw-time-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.sw-time-label {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
}
.sw-time-label i { display: none; }

/* Subsections (Ticket sale window / Check-in window) */
.sw-subsection { margin-top: 1rem; }
.sw-subsection-title {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.sw-subsection-title i { display: none; }

/* Field labels + inputs — Bootstrap defaults with a brand focus ring. */
.sw-slot .form-label.small {
    color: #495057;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}
.sw-slot .form-control:focus,
.sw-slot .form-select:focus {
    border-color: #F08143;
    box-shadow: 0 0 0 0.2rem rgba(240, 129, 67, 0.20);
}

/* Resolved-datetime line under each preset dropdown. */
.sw-preset-resolved {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.3rem !important;
    word-break: break-word;
}

/* Slot remove — btn-outline-danger with a tighter footprint. */
.sw-slot-remove {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    padding: 0.3rem 0.75rem !important;
    border-radius: 0.375rem !important;
    line-height: 1.2 !important;
}

/* Showtime remove — icon-only, compact. */
.sw-time-remove {
    border-radius: 0.375rem !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1 !important;
    font-size: 0.78rem !important;
}

/* "+ Add another showtime / slot" — dashed ghost in brand orange. */
.sw-time-add,
#sw-add-slot {
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.85rem !important;
    background: transparent !important;
    color: #F08143 !important;
    border: 1px dashed #F08143 !important;
}
.sw-time-add:hover,
#sw-add-slot:hover {
    background: rgba(240, 129, 67, 0.08) !important;
    color: #d96b2e !important;
    border-color: #d96b2e !important;
}

/* Action bar (Cancel · Save as draft · Save & publish) */
.sw-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.sw-actions .btn {
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
}

/* Override Bootstrap's btn-primary for the brand-orange "Save & publish"
   using Bootstrap 5's own CSS custom properties so hover / focus /
   active states stay correct. */
.sw-actions .sw-btn-publish {
    --bs-btn-bg: #F08143;
    --bs-btn-border-color: #F08143;
    --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #d96b2e;
    --bs-btn-hover-border-color: #d96b2e;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-bg: #b95a25;
    --bs-btn-active-border-color: #b95a25;
    --bs-btn-focus-shadow-rgb: 240, 129, 67;
    box-shadow: 0 1px 2px rgba(240, 129, 67, 0.35),
                0 4px 10px rgba(240, 129, 67, 0.22);
}
.sw-actions .sw-btn-publish:hover {
    box-shadow: 0 2px 4px rgba(240, 129, 67, 0.4),
                0 6px 14px rgba(240, 129, 67, 0.28);
}

/* Edit-form single "Save changes" button — same brand orange. */
.sw-btn-save {
    background: #F08143 !important;
    color: #ffffff !important;
    border-color: #F08143 !important;
}
.sw-btn-save:hover {
    background: #d96b2e !important;
    border-color: #d96b2e !important;
    color: #ffffff !important;
}

/* Wizard header icon — brand orange. */
.sw-header-icon { color: #F08143; }

/* Slot / venue summary sub-labels — quieter meta text. */
.sw-summary-label--meta {
    margin-top: 2px;
    text-transform: none;
    letter-spacing: 0;
    color: #888;
    font-size: 0.78rem;
}

/* Mobile-friendly touch targets + iOS auto-zoom prevention. */
@media (max-width: 767px) {
    .sw-slot > .border { padding: 0.85rem !important; }
    .sw-slot-remove,
    .sw-time-remove,
    .sw-time-add,
    #sw-add-slot {
        min-height: 40px;
    }
    .sw-time-remove {
        min-width: 40px;
    }
    .sw-panel input,
    .sw-panel select,
    .sw-panel textarea {
        font-size: 16px;
    }
    /* Stack the three action buttons full-width on phones, primary at
       the top for thumb reach. */
    .sw-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.4rem;
    }
    .sw-actions .btn {
        width: 100%;
        min-height: 44px;
    }
}
