:root {
  --gold: #d4a116;
  --gold-2: #f4c542;
  --black: #0b0b0b;
  --ink: #1d1d1f;
  --muted: #6b7280;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  /* PARANDUS: Keelame horisontaalse kerimise kogu lehel */
  overflow-x: hidden;
}

iframe {
  max-width: 100%;
  border: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.container.narrow {
  max-width: 850px;
}

.muted {
  color: var(--muted);
}

.section {
  padding: 64px 0;
}

.section.alt {
  background: #fff;
}

.nav {
  position: sticky;
  top: 0;
  background: rgba(11, 11, 11, .9);
  color: #fff;
  border-bottom: 1px solid #1f2937;
  z-index: 50;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .5px;
}

.brand.small span {
  font-weight: 600;
}

.logo {
  height: 36px;
  width: 36px;
  object-fit: contain;
}

.links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.links .menu {
  display: flex;
  gap: 12px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.links a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.links a:hover {
  color: var(--gold-2);
  background: rgba(255, 255, 255, .06);
}

.menu a.active {
  background: var(--gold);
  color: #111;
  font-weight: 700;
}

.has-sub {
  position: relative;
}

.submenu {
  position: absolute;
  display: none;
  top: 30px;
  /* --- PARANDUS: Tõstetud ülespoole, et vältida tühimikku --- */
  left: 0;
  background: #111;
  border: 1px solid #27272a;
  border-radius: 12px;
  min-width: 240px;
  padding: 16px 8px 8px 8px;
  /* --- PARANDUS: Suurendatud ülemist padding'ut sisu allapoole lükkamiseks --- */
  list-style: none;
  margin: 0;
}

.submenu li a {
  display: block;
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 8px;
}

.submenu li a:hover {
  background: #1f2937;
  color: #fff;
}

.has-sub:hover .submenu {
  display: block;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: #e5e7eb;
  border-color: #374151;
}

.btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
  font-weight: 700;
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.shadow {
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
}

.hero {
  background: linear-gradient(180deg, #0b0b0b, #1a1a1a);
  color: #fff;
  padding: 80px 0;
}

.hero-inner {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
}

.hero h1 {
  font-size: 48px;
  margin: 0 0 12px;
}

.hero p {
  color: #cbd5e1;
}

.cta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.logo-wrap {
  background: #0b0b0b;
  border: 1px solid #3f3f46;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-wrap img {
  width: 70%;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 8px;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

.admin .card>input,
.admin .card>textarea {
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logo-box {
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.card.coach h3 {
  margin-top: 0;
}

.card.inline {
  display: inline-block;
}

.two {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.grid2 {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr 1fr;
}

.list {
  padding-left: 18px;
}

.list-flat {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-flat li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  align-items: center;
}

.list-flat li span:first-child {
  word-break: break-all;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.table thead th {
  color: var(--muted);
  text-align: left;
  font-size: 14px;
}

.table tbody tr {
  background: #fff;
}

.table td,
.table th {
  padding: 10px 12px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.badge.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.chk {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer {
  background: #0b0b0b;
  color: #9ca3af;
  padding: 28px 0;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.burger {
  display: none;
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 6px 10px;
}

.grid.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.logo-box {
  flex: 1 1 300px;
  max-width: 300px;
  min-height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.logo-box img {
  max-width: 90%;
  max-height: 120px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-dialog {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  max-width: 520px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.hero-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}

.hero-art .logo-wrap {
  margin-bottom: 24px;
}


/* --- KALENDER --- */
#calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#calendar-header h2 {
  margin: 0;
  font-size: 20px;
}

#calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 120px;
  font-size: 14px;
  position: relative;
}

.calendar-day.empty {
  background-color: var(--bg);
  border: 1px solid transparent;
}

.calendar-day-number {
  font-weight: 600;
}

.calendar-day.today .calendar-day-number {
  background: var(--gold);
  color: var(--black);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-event {
  background: #eef2ff;
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  margin-top: 6px;
  word-break: break-word;
}

/* --- SÜNDMUSTE HÜPIKAKEN --- */
.event-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 110;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  width: 90vw;
  max-width: 350px;
}

.event-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.event-popover-header h4 {
  margin: 0;
}

.event-popover .modal-close {
  position: static;
  padding: 2px 6px;
  border: none;
  background: transparent;
  font-size: 24px;
}

#popoverContent {
  padding: 16px;
}

#popoverContent .calendar-event {
  display: block;
  margin-bottom: 8px;
}


/* --- KÕIK MOBIILIVAATE PARANDUSED --- */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid.cards-3 {
    grid-template-columns: 1fr;
  }

  .admin.grid2 {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .burger {
    display: block;
  }

  /* PARANDUS: Filtrid (otsing ja rippmenüü) üksteise all */
  .filters {
    flex-direction: column;
    width: 100%;
  }

  /* --- PARANDATUD PAREMALE JOONDATUD MENÜÜ --- */
  .links {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: #111;
    padding: 20px;
    border-left: 1px solid #27272a;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
  }

  .links .menu {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .links .menu a {
    display: block;
    text-align: right;
    padding: 14px 80px 14px 0;
  }

  .links .btn.ghost {
    margin-top: 20px;
  }

  .has-sub:hover .submenu {
    display: none;
  }

  .submenu {
    position: static;
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  .submenu li a {
    color: #cbd5e1;
    padding: 10px 100px 10px 0;
  }

  /* --- KALENDRI MOBIILIVAATE PARANDUSED --- */
  .calendar-day {
    min-height: unset;
    height: 60px;
    padding: 4px;
    font-size: 12px;
    cursor: pointer;
  }

  .calendar-event {
    display: none;
    /* Peidame sündmused kalendrikastis */
  }

  .calendar-day.has-events .calendar-day-number::after {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    margin: 2px auto 0;
  }
}
/* Vormi stiilid tuletrenni */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.form-group input,
.form-group textarea {
  width: 100%;
}
.coach-image {
    width: 120px; /* Või sobiv suurus vastavalt disainile */
    height: 120px;
    border-radius: 50%; /* Muudab pildi ümmarguseks */
    object-fit: cover; /* Tagab, et pilt katab kogu ala, isegi kui proportsioonid ei klapi */
    margin: 0 auto 1rem; /* Asetab pildi horisontaalselt keskele ja lisab alla veidi ruumi */
    display: block;
}

.card.coach {
    text-align: center; /* Joondab kaardi sisu (nimi, tekst) keskele */
}
/* Pisipildi stiil */
#myThumbnail {
    border-radius: 5px;      /* Ümarad nurgad */
    cursor: pointer;         /* Muudab hiirekursori käeks */
    transition: 0.3s;        /* Sujuv üleminek */
    width: 200px;            /* Määra pisipildi laius */
    height: auto;            /* Kõrgus arvutatakse automaatselt */
}

#myThumbnail:hover {
    opacity: 0.7;            /* Muudab pildi kergelt läbipaistvaks, kui hiir on peal */
}

/* Modaali taust (must läbipaistev kiht) */
.modal {
    display: none;           /* Vaikimisi peidetud */
    position: fixed;         /* Püsib paigal ka kerides */
    z-index: 1000;           /* On kõige pealmine kiht */
    padding-top: 100px;      /* Kaugus ülevalt servast */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;          /* Võimaldab kerimist, kui pilt on liiga suur */
    background-color: rgba(0,0,0,0.9); /* Must taust 90% läbipaistvusega */
}

/* Modaali sisu (pilt ise) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;        /* Maksimaalne pildi laius */
}

/* Sulgemisnupp (ristike) */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
