/* Az éles Naptár app static/style.css másolata (F-07), a végén a demó saját kiegészítéseivel. */
:root {
  --border: #e1e4e8;
  --text: #1f2328;
  --text-muted: #656d76;
  --bg: #ffffff;
  --bg-muted: #f6f8fa;
  --accent: #3b82f6;
  --today-bg: #eff6ff;
  --today-border: #dc2626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; }
.current-label { font-size: 1.1rem; margin: 0 0 0 8px; text-transform: capitalize; }

.nav-btn, .view-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}
.view-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.today-btn { font-weight: 600; }
.new-event-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

@media (max-width: 680px) {
  .topbar-left, .topbar-right { width: 100%; flex-wrap: wrap; }
  .topbar-right .view-btn { flex: 1 1 18%; text-align: center; padding: 8px 4px; }
  .topbar-right .new-event-btn { flex: 1 1 100%; }
}

/* Month grid */
.month-grid { display: flex; flex-direction: column; }
.weekday-header, .month-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekday-cell {
  text-align: center;
  padding: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.month-cell {
  border: 1px solid var(--border);
  min-height: 100px;
  padding: 4px;
  cursor: pointer;
  overflow: hidden;
}
.month-cell.other-month { background: var(--bg-muted); color: var(--text-muted); }
.month-cell.is-today { background: var(--today-bg); box-shadow: inset 0 0 0 3px var(--today-border); }
.cell-date { display: flex; align-items: center; justify-content: space-between; gap: 3px; font-size: 0.85rem; margin-bottom: 2px; }
.cell-events { display: flex; flex-direction: column; gap: 2px; }

/* Week / day columns */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 70vh; }
.week-col { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.week-col.is-today { background: var(--today-bg); box-shadow: inset 0 0 0 3px var(--today-border); }
.week-col-header {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.week-col-events, .day-col { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.day-view { min-height: 70vh; }
.day-office-header {
  display: flex;
  justify-content: center;
  padding: 12px calc(16px + env(safe-area-inset-right)) 12px calc(16px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}

.office-day-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.office-day-control input {
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.office-day-control input:disabled { cursor: wait; opacity: 0.55; }
.office-day-control-compact { font-size: 0.65rem; line-height: 1; }
.office-day-control-compact input { width: 13px; height: 13px; }
.office-day-control-day {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}
.office-day-control-day input { width: 20px; height: 20px; }

.office-feedback {
  position: fixed;
  z-index: 150;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 7px;
  background: #166534;
  color: white;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
  font-size: 0.88rem;
}
.office-feedback.error { background: #b42318; }

/* Office-day report */
.office-report {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px calc(16px + env(safe-area-inset-right)) 28px calc(16px + env(safe-area-inset-left));
}
.office-report-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.office-report-filters label { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: 0.82rem; }
.office-report-filters input,
.office-report-filters button,
.office-report-export {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
}
.office-report-filters input { font-size: 16px; }
.office-report-filters button { background: var(--accent); border-color: var(--accent); color: white; cursor: pointer; }
.office-report-export { display: inline-flex; align-items: center; text-decoration: none; }
.office-report-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-muted);
}
.office-report-total strong { font-size: 1.5rem; }
.office-report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.office-report-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.office-report-card h2 { margin: 0 0 12px; font-size: 1rem; }
.office-report-months, .office-report-dates { margin: 0; padding-left: 1.3rem; }
.office-report-months { list-style: none; padding-left: 0; }
.office-report-months li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.office-report-months li:last-child { border-bottom: none; }
.office-report-dates { columns: 2; column-gap: 24px; }
.office-report-dates li { padding: 3px 0; break-inside: avoid; }
.empty-state { color: var(--text-muted); margin: 0; }

@media (max-width: 680px) {
  .office-day-control-compact span { display: none; }
  .office-report-filters > * { flex: 1 1 140px; }
  .office-report-filters button, .office-report-export { justify-content: center; }
  .office-report-grid { grid-template-columns: 1fr; }
  .office-report-dates { columns: 1; }
}

/* Event pills — compact: time + title only */
.event-pill {
  background: color-mix(in srgb, var(--event-color) 15%, white);
  border-left: 3px solid var(--event-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.event-pill:hover { filter: brightness(0.96); }

/* Multi-day spans: solid color bar, edges only rounded where the span
   actually starts/ends, so adjacent day cells read as one continuous bar. */
.event-pill.multi-day {
  background: var(--event-color);
  border-left: none;
  color: white;
  min-height: 1.1em;
  border-radius: 0;
}
.event-pill.multi-day.segment-single { border-radius: 4px; }
.event-pill.multi-day.segment-start { border-radius: 4px 0 0 4px; margin-right: -1px; }
.event-pill.multi-day.segment-middle { border-radius: 0; margin-left: -1px; margin-right: -1px; }
.event-pill.multi-day.segment-end { border-radius: 0 4px 4px 0; margin-left: -1px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-box {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  width: min(480px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  border: none; background: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted);
}
#event-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
#event-form label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; color: var(--text-muted); }
#event-form input, #event-form select, #event-form textarea {
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* 16px minimum — below this iOS Safari auto-zooms the viewport on focus */
  font-size: 16px;
  font-family: inherit;
}
.form-row { display: flex; gap: 10px; }
.form-row label { flex: 1; }
.modal-actions { display: flex; justify-content: space-between; margin-top: 6px; }
.modal-actions .primary { background: var(--accent); color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.modal-actions .danger { background: none; color: #d1242f; border: 1px solid #d1242f; padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.hidden { display: none !important; }

.push-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.85rem;
}
.push-widget[hidden] { display: none; }
.push-label { color: var(--text-muted); }
.push-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}
.push-btn[hidden] { display: none; }
.push-error { color: #d1242f; font-size: 0.8rem; }
.push-error[hidden] { display: none; }

.reminders-widget {
  padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: #fff8e1;
  font-size: 0.85rem;
}
.reminders-summary { cursor: pointer; font-weight: 600; }
.reminders-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reminders-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reminder-ack-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Demó kiegészítések                                                     */
/* ---------------------------------------------------------------------- */

.demo-banner {
  background: #b42318;
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
}

.demo-banner-link { margin-left: 10px; color: white; font-weight: 700; white-space: nowrap; }
.demo-banner-link:hover { text-decoration: none; }

.nav-btn.disabled { opacity: 0.35; cursor: default; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin-left: 4px; }
.lang-switch a { padding: 6px 10px; color: var(--text-muted); text-decoration: none; font-size: 0.78rem; font-weight: 700; letter-spacing: .05em; }
.lang-switch a.active { background: var(--text); color: white; }

.month-cell { cursor: pointer; }
.event-pill {
  display: block;
  width: 100%;
  text-align: left;
  border-top: none; border-right: none; border-bottom: none;
  font: inherit;
  font-size: 0.78rem;
  color: var(--text);
}
.event-pill.multi-day { color: white; }
.week-col-header a { color: var(--text); text-decoration: none; }
.week-col-header a:hover { color: var(--accent); }
.day-col { cursor: pointer; }

.reminders-summary { border: none; background: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.reminders-summary::before { content: "\1F514  "; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, 0.55); }
.dialog-backdrop[hidden] { display: none; }
.dialog { width: min(480px, 100%); padding: 22px 24px; border-radius: 12px; background: white; box-shadow: 0 24px 64px rgba(0,0,0,0.25); }
.dialog .eyebrow { margin: 0 0 6px; color: #b42318; font-size: 0.72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.dialog p:not(.eyebrow) { color: var(--text-muted); line-height: 1.5; margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.dialog-actions button { background: var(--accent); color: white; border: none; padding: 8px 18px; border-radius: 6px; cursor: pointer; font: inherit; }

@media (max-width: 680px) {
  .topbar-right .lang-switch { flex: 0 0 auto; }
  .event-pill { font-size: 0.7rem; }
}
