/* Календар на BestTickets */
/* Цветовете идват от темата; тези стойности важат само без нея. */
:where(html) { --ink: #0e1a2b; --muted: #3b4a61; --line: #dde3ec; --line-strong: var(--line-strong); --accent: #ffc531; --link: #1b4fd8; --surface: #fff; --surface-2: #f8f9fb; --bg: #f3f5f9; --night: #0e1a2b; --danger: #7a1610; --danger-bg: #fde8e8; }
.btc { color: var(--ink); }
.btc *, .btc *::before, .btc *::after { box-sizing: border-box; }
.btc button { font: inherit; color: inherit; cursor: pointer; }
.btc.is-ready .btc-fallback { display: none; }
.btc-fallback ul { padding-left: 20px; }

.btc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.btc-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.btc-tabs button { border: 0; background: transparent; border-radius: 8px; min-height: 40px; padding: 0 14px; font-weight: 600; }
.btc-tabs button.is-on { background: var(--night); color: #fff; }
.btc-nav { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; }
.btc-nav button { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 22px; line-height: 1; }
.btc-heading { margin: 0; font-size: clamp(20px, 2.6vw, 28px); min-width: 0; }
.btc-actions { display: flex; gap: 8px; }
.btc-actions button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-weight: 600; }
.btc-actions button[data-today] { background: var(--accent); border-color: var(--accent); }

.btc-filters { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.btc-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.btc-chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 600; font-size: 14px; }
.btc-chip:hover { border-color: var(--ink); }
.btc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.btc-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.btc-fields select, .btc-fields input[type="search"] { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); width: 100%; }
.btc-fields .btc-check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: var(--ink); }
.btc-check input { width: 20px; height: 20px; }
.btc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.btc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.btc-legend i, .btc-dots i, .btc-cat i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.btc-status { display: none; padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.btc-status.is-on { display: block; }
.btc-status.is-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.btc-body { transition: opacity 0.15s ease; min-height: 120px; }
.btc-body.is-loading { opacity: 0.45; }
.btc-link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; }
.btc-note { color: var(--muted); font-size: 14px; }

/* Месец */
.btc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.btc-dow { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.btc-cell { position: relative; min-height: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; }
.btc-cell.is-blank { background: transparent; border: 0; }
.btc-cell.is-empty { background: var(--surface-2); }
.btc-cell.is-past .btc-num { color: var(--muted); }
.btc-cell:hover { border-color: var(--muted); }
.btc-num { font-size: 22px; font-weight: 700; line-height: 1; }
.btc-count { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--night); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.btc-dots { display: flex; gap: 4px; }
.btc-cell.is-today, .btc-pill.is-today { border: 2px solid var(--link); }
.btc-cell.is-today .btc-num::after { content: " днес"; font-size: 12px; font-weight: 700; color: var(--link); }
.btc-cell.is-selected, .btc-pill.is-selected { background: var(--accent); border-color: var(--ink); }
.btc-strip { display: none; }
.btc-panel { margin-top: 24px; }

/* Ден от месеца, списък */
.btc-day { margin-bottom: 28px; }
.btc-day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 20px; }
.btc-day-head button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; text-align: left; }
.btc-day-head button:hover { text-decoration: underline; }
.btc-day-head span:last-child { font-size: 14px; font-weight: 600; color: var(--muted); }
.btc-day-head.is-today::after { content: "днес"; order: -1; background: var(--link); color: var(--brand-ink, #fff); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }

/* Събитие */
.btc-event { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--cat, #5b6b84); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.btc-event.is-off .btc-title { text-decoration: line-through; }
.btc-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: 0 0 72px; }
.btc-event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.btc-event-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; }
.btc-time { font-weight: 700; }
.btc-cat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.btc-cat i { background: var(--cat); }
.btc-flag { background: #7a1610; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.btc-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.btc-title:hover { text-decoration: underline; color: var(--ink); }
.btc-where { color: var(--muted); font-size: 15px; }
.btc-event-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 14px; margin-top: 4px; }
.btc-event-foot a { padding: 6px 0; }
.btc-fav { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.btc-fav.is-on { color: #c2255c; border-color: #c2255c; }

/* Седмица */
.btc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.btc-week-day { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.btc-week-day.is-today { border: 2px solid var(--link); }
.btc-week-day h3 { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.btc-week-day h3 button { background: none; border: 0; padding: 4px 0; font-weight: 700; }
.btc-week-day h3 em { font-style: normal; font-size: 13px; color: var(--muted); }
.btc-week .btc-event { flex-direction: column; padding: 10px; gap: 8px; }
.btc-week .btc-thumb, .btc-week .btc-event-foot a { display: none; }
.btc-week .btc-title { font-size: 15px; }
.btc-week .btc-where { font-size: 13px; }
.btc-none { color: var(--muted); font-size: 14px; margin: 0; }

/* Ден по часове */
.btc-hour { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); margin-bottom: 8px; }
.btc-hour h3 { margin: 0; font-size: 20px; }

/* Празно състояние */
.btc-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 24px; }
.btc-empty p { margin: 12px 0 0; }
.btc-next { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btc-links { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); line-height: 2; }
.btc-links a { margin-right: 12px; }

/* Мобилен изглед: лента с дати вместо таблица */
@media (max-width: 759px) {
  .btc-grid { display: none; }
  .btc-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .btc-pill { flex: 0 0 60px; min-height: 76px; scroll-snap-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 0; }
  .btc-pill span { font-size: 12px; color: var(--muted); }
  .btc-pill strong { font-size: 20px; line-height: 1; }
  .btc-pill em { font-style: normal; font-size: 12px; font-weight: 700; min-height: 16px; color: var(--link); }
  .btc-pill.is-empty { background: var(--surface-2); }
  .btc-pill.is-selected em, .btc-pill.is-selected span { color: var(--ink); }
  .btc-panel { margin-top: 8px; }
  .btc-week { grid-template-columns: 1fr; }
  .btc-week .btc-event { flex-direction: row; }
  .btc-hour { grid-template-columns: 1fr; gap: 8px; }
  .btc-tabs { width: 100%; }
  .btc-tabs button { flex: 1; padding: 0 6px; }
  .btc-nav { flex-basis: 100%; }
  .btc-heading { flex: 1; text-align: center; }
  .btc-filters { position: static; }
  .btc-fields { grid-template-columns: 1fr 1fr; }
  .btc-legend { display: none; }
  .btc-thumb { width: 56px; height: 56px; flex-basis: 56px; }
}
@media (prefers-reduced-motion: reduce) { .btc-body { transition: none; } }

/* Лента с предстоящи дни на началната страница */
.bt-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.bt-day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.bt-day:hover { border-color: var(--ink); color: var(--ink); }
.bt-day-name { font-size: 13px; color: var(--muted); text-transform: capitalize; }
.bt-day strong { font-size: 20px; }
.bt-day-count { font-size: 13px; color: var(--link); font-weight: 700; }
.bt-day--empty .bt-day-count { color: var(--muted); font-weight: 400; }

/* Филтрите са сгънати на телефон, за да се виждат датите веднага */
.btc-more > summary { display: none; }
@media (max-width: 759px) {
  .btc-more > summary { display: flex; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
  .btc-more[open] > summary { margin-bottom: 8px; }
}

/* 0.3.1: четимост върху жълтия акцент и в тъмна тема */
.btc-cell.is-selected, .btc-pill.is-selected, .btc-actions button[data-today] { color: #16132d; }
.btc-cell.is-selected .btc-num, .btc-cell.is-selected.is-past .btc-num { color: #16132d; }
.btc-cell.is-selected.is-today .btc-num::after { color: #16132d; }
