:root {
  --start-hour: 7;
  /* bal oldali időtengely kezdete */
  --end-hour: 21;
  /* vége (nem tartalmazza) */
  --slot-minutes: 30;
  /* rács felbontása */
  --cell-height: 36px;
  /* 30 perces cella px-ben */
  --gap: 8px;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .08);
  --bg: #0f172a;
  --panel: #111827;
  --text: #55656e;
  --muted: #9ca3af;
  --accent: #7dd3fc;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: (180deg, #ffffff, #fff4df);
  color: var(--text);
}

.container {
  max-width: 95%;
  margin: 24px auto;
  padding: 0 16px;
  margin-top: 10px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.head-text h1 {
  margin: 0;
  font-size: 24px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome {
  margin-right: 8px;
  color: #55656e;
}

.week-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.week-controls button {
  background: #d2ab67;
  color: #ffffff;
  border: 1px solid #a78851;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

.week-controls button:hover {
  background: #273244;
}

#weekLabel {
  font-weight: 600;
}

.hint {
  color: var(--muted);
  margin: 0;
}

.calendar {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--gap);
  align-items: start;
}

.time-col {
  position: sticky;
  top: 8px;
  background: transparent;
}

.time-col .time {
  height: var(--cell-height);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 8px;
  color: var(--muted);
  font-size: 12px;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--gap);
}

.day {
  background: rgba(255, 235, 199, 0.2);
  border: 1px solid #dddddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  background: #d2ab67;
  border-bottom: 1px dashed #b1b1b1;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

.day-header .day-name {
  font-size: 18px;
  color: #ffffff;
}

.day-header .day-date {
  font-size: 13px;
  color: #ffffff;
}


.day-grid {
  display: grid;
  /* rácssorok a félórás lépésekhez */
  grid-template-rows: repeat(calc(((var(--end-hour) - var(--start-hour)) * 60) / var(--slot-minutes)), var(--cell-height));
  position: relative;
}

.row-line {
  height: var(--cell-height);
  /* NE legyen border, mert eltol! */
  border-top: 0;

  /* 1px-es vonal a sor tetején – nem befolyásolja a méretet */
  background-image: linear-gradient(to bottom,
      rgba(148, 163, 184, .12) 0, rgba(148, 163, 184, .12) 1px,
      transparent 1px, transparent 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.event {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  background: #0ea5e9;
  color: #0b1220;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  text-decoration: none;
}

.event:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.event .title {
  font-weight: 700;
}

.event .time {
  font-size: 12px;
  opacity: .85;
}

/* külön színek opció (slug alapján) */
.event[data-slug="gerinc"] {
  background: #22d3ee;
}

.event[data-slug="max"] {
  background: #fca5a5;
}

.event[data-slug="basic"] {
  background: #a7f3d0;
}

.event[data-slug="trx"] {
  background: #fcd34d;
}

.event[data-slug="joga"] {
  background: #c4b5fd;
}

.event[data-slug="pilates"] {
  background: #86efac;
}

.event[data-slug="spinning"] {
  background: #f9a8d4;
}

.event .time {
  font-size: 12px;
  opacity: .85;
  line-height: 1.3;
  /* kicsit sűrűbb sorok */
}

.event.disabled::after {
  content: "Már elkezdődött";
}


.auth-hint {
  margin-bottom: 10px;
}

.time-col {
  padding-top: var(--day-header-h, 44px);
}

/* Globális gomb stílus (anchorokra is) */
.btn {
  display: inline-block;
  background: #d2ab67;
  color: #ffffff;
  border: 1px solid #a5854e;
  padding: 15px 22px;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
}

.lout {
  background: #d2ab67;
  border: 1px solid #a18350;
}

.lout:hover {
  background: #f8d393;

}

.btn.primary {
  background: #849daa;
  color: #ffffff;
  border-color: transparent;
}

.btn.admin {
  background: #17698f;
  color: #ffffff;
  border-color: transparent;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(2, 6, 23, .6);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal__dialog {
  width: min(520px, 92vw);
  background: #0b1220;
  color: var(--text);
  border: 1px solid #1f2937;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}

.modal__dialog-login {
  width: min(450px, 92vw);
  background: #ffffff;
  color: var(--text);
  border: 1px solid #1f2937;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}

.modal__header {
  display: flex;
  justify-content: space-between;
}

.modal__close {
  position: absolute;
  margin-left: calc(min(430px, 92vw) - 36px);
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.modal h2 {
  margin: 6px 0 12px;
  color: #8d8d8d;
}

.lbl-text {
  color: #b3b3b3;
}

input,
textarea {
  width: 100%;
  padding: 15px 12px;
  border-radius: 6px;
  border: 1px solid #cbcbcb;
  background: #ffffff;
  color: #09142b;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.form-error {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #7f1d1d22;
  border: 1px solid #ef444422;
  color: #fecaca;
}

.day.past-day {
  opacity: 0.7;
  filter: grayscale(100%);
}

.day.past-day .event,
.event.disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.4;
}

#myBookingsModal .modal__body {
  color: #222;
  max-height: 70vh;
  /* a képernyő 70%-áig nőhet */
  overflow-y: auto;
  /* ha túl sok a foglalás, görgethető lesz */
  /* sötétebb, jól olvasható szöveg */
}

#myBookingsModal .booking-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

#myBookingsModal .booking-title {
  color: #000;
  font-weight: 600;
}

#myBookingsModal .booking-when,
#myBookingsModal .booking-loc,
#myBookingsModal .booking-status {
  color: #333;
}

#myBookingsModal .modal__footer {
  margin-top: 16px;
  /* ad egy kis térközt a gomb fölé */
  padding-top: 10px;
  border-top: 1px solid #eee;
  /* finom elválasztó vonal */
}


.modal[aria-hidden="true"] {
  display: none;
}

.modal[aria-hidden="false"] {
  display: flex;
  /* vagy grid – ahogy a többi modalod */
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  /* legyen a naptár fölött */
  background: rgba(0, 0, 0, 0.4);
  /* ha szeretnél hátteret */
}

.modal__dialog {
  background-color: #ffffff;
  border-radius: 12px;
  color: #7b7b7b;
  padding: 16px 18px;
  max-width: 640px;
  width: min(92vw, 640px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px 30px;
  text-align: center;
  max-width: 300px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.modal-overlay.hidden {
  display: none;
}

.modal-box .btn {
  margin-top: 15px;
}

.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg, #fff);
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px 14px;
}

.booking-main {
  display: grid;
  gap: 4px;
}

.booking-title {
  font-size: 16px;
}

.booking-when,
.booking-loc {
  font-size: 14px;
}

.booking-actions {
  display: flex;
  gap: 8px;
}

/* —— Naptár konténer: ne legyen grid —— */
.calendar {
  display: block !important;
}

/* 7 napos elrendezés a belső #days-en */
#days {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 0 16px !important;
}

/* Nap-oszlop + lista */
#days .day {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#days .day .day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Eseménykártya: normál blokk, NEM abszolút */
#days .event {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;

  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255);
  color: #63747d;
}

/* Kurzor és hover állapotok */
#days .event:not(.disabled) {
  cursor: pointer;
}

#days .event.disabled {
  cursor: not-allowed;
  opacity: .6;
}

#days .event:not(.disabled):hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  background: rgba(255, 255, 255, .08);
}

/* Belső tipók */
#days .event .title {
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.2;
}

#days .event .time {
  font-size: 12px;
  opacity: .8;
  margin: 0;
  line-height: 1.3;
}

/* ——— Színek a típustól/slugtól függően ——— */
/* A JS már beállítja: a.dataset.slug = "trx"/"basic"/"joga"/"max"/"gerinc" */
#days .event {
  border: 1px solid #dddddd;
  border-left: 6px solid rgba(255, 255, 255, .18);
}

#days .event[data-slug^="trx"] {
  border-left-color: #45d1ff;
}

#days .event[data-slug^="basic"] {
  border-left-color: #ffd45e;
}

#days .event[data-slug^="joga"],
#days .event[data-slug^="jóga"] {
  border-left-color: #d992ff;
}

#days .event[data-slug^="max"] {
  border-left-color: #ff7b7b;
}

#days .event[data-slug^="gerinc"] {
  border-left-color: #87e887;
}

#days .event[data-slug^="spinracing"] {
  border-left-color: #eb2651;
}

#days .event[data-slug^="spinning"] {
  border-left-color: #fa1c96;
}

#days .event[data-slug^="pilates"] {
  border-left-color: #ff8e23;
}

#days .event[data-slug^="fedzi"] {
  border-left-color: #3aa6ff;
}

/* Ha régi pseudo díszek zavarnak, kapcsoljuk ki */
#days .event::before,
#days .event::after {
  content: none !important;
  display: none !important;
}

#calendarHeader {
  text-align: center;
  margin-bottom: 10px;
}

.calendar-logo {
  height: 80px;
  /* állítsd, hogy jól nézzen ki */
  width: auto;
}





@media (max-width: 1200px) {
  #days {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .time-col {
    display: none;
  }
}


@media (max-width: 900px) {
  .calendar {
    grid-template-columns: 56px 1fr;
  }

  .event {
    padding: 8px 10px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .nav-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .head-text h1 {
    font-size: 20px;
  }

  .days {
    grid-template-columns: 650px;
  }
}


@media (max-width: 680px) {
  .days {
    grid-template-columns: 350px;
  }

  #days {
    grid-template-columns: 1fr !important;
    justify-items: center;
    /* középre a nap-oszlop */
    gap: 12px !important;
  }

  #days .day {
    width: 100%;
    max-width: 420px;
    /* kért max szélesség */
    margin: 0 auto;
    background: rgba(255, 255, 255, .02);
    border-radius: 12px;
    /* padding: 10px 12px; */
  }

  .time-col {
    display: none;
  }

  .week-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
  }

  .head-text {
    text-align: center;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .calendar-logo {
    height: 50px;

  }

}

/* biztos, ami biztos: a nap-oszlop tartalma oszlopként maradjon */
#days .day {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#days .day .day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-bottom: 5px;
}

/* eseménykártyák pointer/hover (ha még nincs) */
#days .event {
  position: static !important;
  width: 95% !important;
  height: auto !important;
}

#days .event:not(.disabled) {
  cursor: pointer;
}

#days .event.disabled {
  cursor: not-allowed;
  opacity: .65;
}