/* Unde Se Joacă — calendar page (/calendar-evenimente-sportive/), look C.
   Loaded after css/home.css, which holds the tokens, header, footer, buttons,
   add-event form and feedback widget. The calendar markup comes from js/app.js. */

.calendar-page {
  max-width: var(--max); margin: 0 auto;
  padding: 32px var(--gutter) 64px;
  display: flex; flex-direction: column; gap: 28px;
}
.calendar-head { display: flex; flex-direction: column; gap: 12px; }
.calendar-intro { margin: 0; max-width: 640px; font-size: 16px; color: var(--text-2); }

/* ── Toolbar: filters, view switch, period ───────────────────────────── */
.cal-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: stretch;
  margin-bottom: 20px;
}
.cal-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-filters .filter-select {
  width: auto; max-width: 220px; min-height: 44px;
  border: 2px solid var(--line-strong); background-color: var(--bg);
  padding: 8px 34px 8px 12px; background-position: right 12px center;
  font-size: 14px;
}
.cal-filters .filter-select:hover, .cal-filters .filter-select:focus-visible { border-color: var(--mint); }
.cal-toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.cal-viewtoggle { display: flex; border: 2px solid var(--line-strong); }
.cal-view-btn {
  border: 0; background: transparent; color: var(--muted);
  font-weight: 800; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 14px; min-height: 40px; white-space: nowrap;
}
.cal-view-btn:hover { color: var(--text); }
.cal-view-btn.is-active { background: var(--mint); color: var(--bg); }
.cal-nav { display: flex; align-items: stretch; border: 2px solid var(--line-strong); }
.cal-nav-btn {
  width: 44px; border: 0; background: transparent; color: var(--text);
  font-size: 22px; line-height: 1;
}
.cal-nav-btn:hover { background: var(--mint); color: var(--bg); }
.cal-period {
  display: flex; align-items: center; justify-content: center;
  min-width: 170px; padding: 0 10px;
  font-family: var(--font-display); font-size: 20px; line-height: 1.1; text-transform: uppercase;
  border-left: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong);
  white-space: nowrap;
}

.cal-empty {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; margin-bottom: 20px;
  border: 2px solid var(--line-strong); background: var(--surface);
  color: var(--text-2); font-weight: 600;
}
.cal-empty-icon { display: none; }

/* ── Month and week grids ────────────────────────────────────────────── */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px; background: var(--line); border: 2px solid var(--line);
}
.cal-grid--header { border-bottom: 0; }
.cal-weekday {
  background: var(--bg); padding: 10px 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label);
}
.cal-cell {
  background: var(--bg); min-width: 0; min-height: 116px; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell--outside { background: #060e08; }
.cal-cell--outside .cal-date { color: var(--line-strong); }
.cal-cell--today { background: var(--surface); box-shadow: inset 0 3px 0 var(--mint); }
.cal-date {
  font-family: var(--font-display); font-size: 20px; line-height: 1.1; color: var(--text);
  align-self: flex-start;
}
.cal-cell--today .cal-date { background: var(--mint); color: var(--bg); padding: 0 6px; }
.cal-cell--week { min-height: 260px; gap: 6px; }

.event-chip {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 6px; min-width: 0;
  background: var(--surface); border-left: 3px solid var(--mint);
  padding: 4px 6px;
}
.event-chip:hover { background: var(--surface-active); }
.event-chip:hover .chip-name { color: var(--mint); }
.chip-emoji { flex: none; font-size: 11px; line-height: 1; }
.chip-time { flex: none; font-size: 11px; font-weight: 800; line-height: 1.3; color: var(--mint); }
.cal-cell--week .chip-time { font-size: 12px; }
.chip-name {
  font-size: 11px; font-weight: 700; line-height: 1.3; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.cal-cell--week .event-chip { align-items: flex-start; padding: 6px 8px; }
.cal-cell--week .chip-name { white-space: normal; overflow: visible; font-size: 12px; overflow-wrap: break-word; }
.chip-page-link {
  flex: none; margin-left: auto; padding: 0 2px;
  font-size: 11px; font-weight: 800; color: var(--label); text-decoration: none;
}
.chip-page-link:hover { color: var(--mint); }
.cal-more {
  align-self: flex-start; margin-top: auto;
  border: 0; background: none; padding: 4px 2px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mint);
}
.cal-more:hover { color: var(--mint-hover); text-decoration: underline; }
.cal-more--less { color: var(--muted); }

/* ── List (agenda) view ──────────────────────────────────────────────── */
.cal-agenda { display: flex; flex-direction: column; }
.agenda-day {
  display: flex; gap: 20px; padding: 16px 0;
  border-bottom: 2px solid var(--line);
}
.agenda-day:first-child { border-top: 3px solid var(--mint); }
.agenda-date {
  flex: none; width: 60px; min-height: 56px; align-self: flex-start;
  background: var(--mint); color: var(--bg);
  display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; line-height: 1;
}
.agenda-daynum { font-family: var(--font-display); font-size: 26px; line-height: 1.08; }
.agenda-dow { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.agenda-day--today .agenda-date { background: var(--coral); }
.agenda-events { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agenda-event {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  padding: 8px 8px 8px 0; border-bottom: 2px solid var(--line);
}
.agenda-event:last-child { border-bottom: 0; }
.agenda-event:hover { background: var(--surface); }
.agenda-event:hover .agenda-title { color: var(--mint); }
.agenda-emoji { flex: none; font-size: 18px; line-height: 1; width: 24px; text-align: center; }
.agenda-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agenda-title {
  font-family: var(--font-display); font-size: 22px; line-height: 1.18; text-transform: uppercase;
  color: var(--text); overflow-wrap: break-word;
}
.agenda-comp { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint); order: -1; }
.agenda-place { font-size: 13px; color: var(--muted); }
.agenda-badge {
  flex: none; font-family: var(--font-display); font-size: 13px; line-height: 1.2; text-transform: uppercase;
  padding: 3px 10px; background: var(--text); color: var(--bg); white-space: nowrap; transform: rotate(-3deg);
}
.agenda-page-link {
  flex: none; padding: 8px 6px; font-size: 14px; font-weight: 800; color: var(--label); text-decoration: none;
}
.agenda-page-link:hover { color: var(--mint); }
.agenda-none { font-size: 14px; color: var(--label); padding: 4px 0; }

/* ── Event detail popup (markup from renderModal in js/app.js) ───────── */
.modal-head { align-items: flex-start; }
.modal-emoji { flex: none; font-size: 28px; line-height: 1.2; }
.modal-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.modal-comp { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint); }
.modal-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border: 2px solid var(--line-strong); color: var(--text-2);
}
.badge--sport { background: var(--text); border-color: var(--text); color: var(--bg); }
.badge--ok { border-color: var(--mint); color: var(--mint); }
.badge--warn { background: var(--coral); border-color: var(--coral); color: var(--bg); }
.modal-description { font-size: 15px; color: var(--text-2); white-space: pre-line; }
.modal-description:empty { display: none; }
.modal-details { display: flex; flex-direction: column; gap: 8px; border-top: 2px solid var(--line); padding-top: 14px; }
.detail-row { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.detail-icon { flex: none; width: 20px; }
.detail-strong { color: var(--text); font-weight: 700; }
.modal-footer {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 14px 24px 20px; border-top: 2px solid var(--line-strong);
}
.modal-footer:empty { display: none; }
.modal-cta--secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.modal-cta--secondary:hover { background: var(--text); color: var(--bg); }

.error { color: var(--coral); font-weight: 700; }

/* ── Phone: one column, days stacked ─────────────────────────────────── */
@media (max-width: 767px) {
  .calendar-page { padding: 24px var(--gutter) 48px; gap: 20px; }
  .calendar-intro { font-size: 15px; }
  .cal-toolbar, .cal-toolbar-right { flex-direction: column; align-items: stretch; }
  .cal-filters { display: grid; grid-template-columns: 1fr; }
  .cal-filters .filter-select { max-width: none; width: 100%; font-size: 16px; }
  .cal-view-btn { flex: 1; min-height: 44px; }
  .cal-period { flex: 1; min-width: 0; font-size: 18px; }
  .cal-grid--header { display: none; }
  .cal-grid--body { display: flex; flex-direction: column; }
  .cal-cell { min-height: 0; }
  .cal-cell--week { min-height: 0; }
  .cal-cell--outside { display: none; }
  .chip-name { white-space: normal; font-size: 13px; }
  .event-chip { padding: 8px 10px; }
  .agenda-day { gap: 12px; }
  .agenda-date { width: 52px; }
  .agenda-event { flex-wrap: wrap; gap: 6px 10px; padding: 10px 0; }
  .agenda-emoji { display: none; }
  .agenda-main { flex-basis: 100%; }
  .agenda-title { font-size: 20px; }
  .agenda-page-link { margin-left: auto; padding: 10px; }
}
