/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F0F0F0;
  color: #1A1A1A;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

main.container {
  padding-top: 20px;
  padding-bottom: 48px;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  background: #1A1A1A;
  padding: 18px 0;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  color: #E31837;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  padding: 9px 18px;
  background: #E31837;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-primary:hover    { background: #c41530; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  color: #E31837;
  font-weight: 500;
}

.btn-link:hover { text-decoration: underline; }

/* ── Three Columns ────────────────────────────────────────── */
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 16px;
  align-items: start;
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #F0F0F0;
}

.col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
}

.col-actions {
  display: flex;
  gap: 10px;
}

/* ── All / None row below column divider ──────────────────── */
.col-list-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

/* ── Theater Column: Search Controls ─────────────────────── */
.col-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F0F0F0;
}

.col-search input {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  color: #1A1A1A;
  transition: border-color 0.15s;
}

.col-search input:focus { border-color: #E31837; }

.col-search-row2 {
  display: flex;
  gap: 6px;
}

.col-search-row2 select {
  flex: 1;
  padding: 9px 10px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  outline: none;
  color: #1A1A1A;
}

/* ── Films Column: Date Controls ─────────────────────────── */
.col-date {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F0F0F0;
}

.col-date input[type="date"] {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  color: #1A1A1A;
  transition: border-color 0.15s;
}

.col-date input[type="date"]:focus { border-color: #E31837; }

.col-date .btn-primary {
  width: 100%;
}

/* ── Status message (inside theater column) ───────────────── */
#search-status:not(:empty) {
  margin-bottom: 10px;
  font-size: 13px;
}

.status-msg { color: #666; }

.error-msg {
  color: #c0122c;
  padding: 10px 14px;
  background: #FFF5F6;
  border-radius: 6px;
  border-left: 3px solid #E31837;
  line-height: 1.5;
  font-size: 13px;
}

/* ── Theater List ─────────────────────────────────────────── */
#theater-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.theater-card {
  border: 1.5px solid #e5e5e5;
  border-radius: 6px;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
  outline: none;
}

.theater-card:hover { border-color: #c0c0c0; }

.theater-card:focus-visible {
  border-color: #E31837;
  box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.15);
}

.theater-card.selected {
  border-color: #E31837;
  background: #FFF5F6;
}

.theater-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: #fff;
}

.theater-card.selected .theater-check {
  background: #E31837;
  border-color: #E31837;
}

.theater-check svg {
  width: 8px;
  height: 8px;
  opacity: 0;
  transition: opacity 0.1s;
}

.theater-card.selected .theater-check svg { opacity: 1; }

.theater-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.theater-distance {
  font-size: 11px;
  color: #E31837;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Film List ────────────────────────────────────────────── */
#film-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.filter-item:hover { background: #F8F8F8; }

.filter-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #E31837;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.filter-item span {
  font-size: 13px;
  line-height: 1.3;
  color: #1A1A1A;
}

/* ── Showtimes ────────────────────────────────────────────── */
.showtime-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #F0F0F0;
}

.showtime-row:last-child { border-bottom: none; }
.showtime-row.sold-out   { opacity: 0.45; }

.showtime-time {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A1A;
  min-width: 72px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.showtime-details { flex: 1; min-width: 0; }

.showtime-movie {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.4;
}

.showtime-meta {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-imax    { background: #003087; color: #fff; }
.badge-dolby   { background: #5b1a8a; color: #fff; }
.badge-4dx     { background: #1a6b2e; color: #fff; }
.badge-plf     { background: #0070c0; color: #fff; }
.badge-prime   { background: #1a1a1a; color: #ffe066; }
.badge-dinein  { background: #c84b00; color: #fff; }
.badge-default { background: #555;    color: #fff; }
.badge-soldout { background: #ddd;    color: #888; }
.badge-almost  { background: #f07b00; color: #fff; }

/* ── Summary ──────────────────────────────────────────────── */
.summary {
  font-size: 12px;
  font-weight: 400;
  color: #888;
}

/* ── Loading / Empty ──────────────────────────────────────── */
.loading {
  padding: 24px 0;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

.no-results {
  color: #999;
  font-size: 14px;
  padding: 8px 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .three-col {
    grid-template-columns: 1fr 1fr;
  }

  .three-col .col:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .three-col {
    grid-template-columns: 1fr;
  }

  .three-col .col:last-child {
    grid-column: auto;
  }

  .showtime-row {
    flex-direction: column;
    gap: 4px;
  }

  .showtime-time {
    min-width: unset;
    font-size: 13px;
  }
}
