@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --bg:       #f6f4f7;
  --white:    #ffffff;
  --text:     #2b2233;
  --muted:    #7a7183;
  --line:     #e6e1ea;

  --purple-dark:  #472a52;
  --purple-mid:   #6d3f78;
  --purple-light: #c9a3d6;
  --accent:       #9c4d9c;
  --gold:         #f0b429;

  --good: #2e7d4f;
  --bad:  #c0392b;

  --shadow: 0 2px 10px rgba(60, 30, 80, 0.07);
  --r:  12px;
  --r2: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px;
}


/* virsutine juosta - tamsiai violetine kaip mokyklos puslapyje */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--purple-dark);
  box-shadow: 0 2px 10px rgba(30, 10, 45, 0.25);
}

.topbar .wrap { width: 100%; }

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.brand__logo {
  height: 44px;
  flex-shrink: 0;
}

.brand__logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
}

.brand__text { min-width: 0; }

.brand__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav__link {
  white-space: nowrap;
  padding: 9px 13px;
  border-radius: var(--r2);
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  font-size: 0.87rem;
  transition: background 0.15s, color 0.15s;
}

.nav__link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav__link--active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.nav__link--teacher {
  color: var(--gold);
  font-weight: 600;
}

.nav__link--teacher:hover {
  background: rgba(240,180,41,0.15);
  color: var(--gold);
}

.nav .btn--ghost {
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.85);
}

.nav .btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
  color: #fff;
}


/* mygtukas meniu atidaryti telefone */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
}


.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.card__hd {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.card__bd { padding: 20px; }

.card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.card__sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.stack { display: grid; gap: 16px; }
.stack > * { min-width: 0; }


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r2);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--accent);
}
.btn--ghost:hover {
  background: #f6ecf6;
  border-color: var(--accent);
  filter: none;
}

.btn--gold {
  background: var(--gold);
  color: var(--purple-dark);
}
.btn--gold:hover { filter: brightness(1.05); }

.btn--good { background: var(--good); color: #fff; }
.btn--bad  { background: var(--bad);  color: #fff; }

.btn--mine {
  background: #fff;
  color: var(--good);
  border: 2px solid var(--good);
  font-weight: 600;
}
.btn--mine:hover {
  background: #fdecea;
  color: var(--bad);
  border-color: var(--bad);
}

.list { display: grid; gap: 12px; }

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.item:hover {
  border-color: var(--purple-light);
  box-shadow: 0 2px 8px rgba(110, 60, 120, 0.08);
}

.item__title { font-weight: 700; color: var(--text); }
.item__meta  { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }


.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #f1ebf3;
  color: var(--purple-mid);
  border: 1px solid var(--line);
}

.badge--free {
  background: #e7f4ec;
  color: var(--good);
  border-color: #bfe3cc;
}


.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.9rem;
}

th {
  background: #f6f1f8;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: left;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #faf7fb; }


.times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.times__form { margin: 0; }

.btn--time {
  flex-wrap: wrap;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
}

/* emoji sriftas tik ten kur yra emoji - visam mygtukui deti negalima,
   nes emoji sriftuose yra ir skaitmenys, tai neuzsikrovus Montserrat
   laikai virstu spalvotais zenklais */
.slot__x {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  flex-shrink: 0;
  font-size: 0.85em;
  line-height: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #e8b8b2;
  background: #faeae8;
  color: var(--bad);
}

.pill--free {
  border-color: #bfe3cc;
  background: #e7f4ec;
  color: var(--good);
}


input, select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r2);
  border: 1.5px solid var(--line);
  background: #fbfafc;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}


.alert {
  padding: 13px 16px;
  border-radius: var(--r2);
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 0.88rem;
  background: #f1ebf3;
  color: var(--purple-mid);
  border: 1px solid var(--line);
}

.alert.success {
  background: #e7f4ec;
  color: #1e5c39;
  border: 1px solid #bfe3cc;
}

.alert.error {
  background: #faeae8;
  color: #922b21;
  border: 1px solid #e8b8b2;
}


.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 520px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn { width: 100%; }
}


/* pradzios puslapio kortelės */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  gap: 24px;
  padding: 24px 0;
}

.landing__hint {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.landing__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 620px;
}

.lcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 22px;
  border-radius: var(--r);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.lcard:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(110, 60, 120, 0.14);
}

.lcard--dal { border-top-color: var(--purple-dark); }

.lcard--dal:hover { border-color: var(--purple-dark); }

.lcard__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.lcard__sub {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.lcard__go {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.lcard--dal .lcard__go { color: var(--purple-mid); }


/* telefonams */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 80vw);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 70px 16px 16px;
    background: var(--purple-dark);
    box-shadow: -4px 0 20px rgba(20, 5, 35, 0.4);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 60;
  }

  .nav.open { transform: translateX(0); }

  .nav__link {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .nav .btn--ghost { margin-top: 8px; }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 5, 35, 0.45);
    z-index: 55;
  }

  .nav-backdrop.open { display: block; }

  .nav-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
  }

  .brand__title {
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
  }
  .brand__logo { height: 36px; }

  .card__hd { padding: 14px 14px 12px; }
  .card__bd { padding: 14px; }
  .item { padding: 12px 14px; }

  .btn--time {
    padding: 10px 16px;
    font-size: 0.88rem;
  }

  .times { gap: 10px; }

  table { min-width: 560px; }

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

@media (min-width: 901px) {
  .nav-close, .nav-backdrop { display: none; }
}

/* paspaudziamos saraso eilutes (pvz. datu sarasas) */
.item--link { cursor: pointer; }

.item--link:hover {
  border-color: var(--accent);
  background: #faf7fb;
}

.item__arrow {
  font-size: 1.4rem;
  color: var(--line);
  font-weight: 700;
  flex-shrink: 0;
  transition: color 0.15s;
}

.item--link:hover .item__arrow { color: var(--accent); }

/* siauruose ekranuose lentele nesitraukia, tai kiekviena eilute
   verciam i atskira kortele su antrastemis is data-antraste */
@media (max-width: 760px) {
  .table-wrap {
    overflow: visible;
    border: none;
    border-radius: 0;
  }

  table { min-width: 0; }

  thead { display: none; }

  tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--white);
  }

  tbody tr:last-child { margin-bottom: 0; }

  tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 14px;
    text-align: right;
  }

  tbody td::before {
    content: attr(data-antraste);
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: left;
  }

  tbody tr td:last-child { border-bottom: none; }

  tbody tr:hover td { background: transparent; }
}
