/* ==========================================================================
   Quantum Panel – style.css (grouped)
   Cel: łatwe odnajdywanie sekcji + top menu (text-only)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) CSS Variables (Theme)
   -------------------------------------------------------------------------- */
:root {
  --bg: #000000;
  --card: #111111;
  --text-main: #d4d4d4;
  --text-muted: #666666;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --highlight: #a78bfa;
  --danger: #ef4444;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   2) Base / Reset
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; touch-action: manipulation; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-ui);

  height: 100vh;   /* Fallback */
  height: 100dvh;  /* Dynamic viewport height (mobile) */
  /* zamiast overflow: hidden; */
  overflow-x: hidden;
  overflow-y: hidden;  /* zostawiasz dotychczasowy “app-like” scroll tylko w <main> */

  display: flex;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   3) Layout Container
   -------------------------------------------------------------------------- */
.container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  height: 100%;

  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* ==========================================================================
   TOP NAV (CMS MENU) — START
   ========================================================================== */

.topnav{
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;     /* jedna linia */
  overflow-x: auto;      /* gdy za dużo pozycji, przewijanie poziome */
  gap: 14px;
  align-items: center;
  padding: 8px 0 10px 0;
}
/* Link states (LVHA) — wymusza biały kolor także dla :visited */
.topnav__link:link,
.topnav__link:visited {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
}

.topnav__link:hover,
.topnav__link:focus-visible {
  color: #ffffff;
  opacity: 1;
  text-decoration: none;
}

.topnav__link:active {
  color: var(--accent);
  opacity: 1;
}

/* separator jako <hr> */
.topnav-sep{
  width: 100%;
  border: 0;             /* usuń domyślny border */
  height: 1px;
  background: #222;
  margin: 6px 0 12px 0;
}

/* ==========================================================================
   TOP NAV (CMS MENU) — END
   ========================================================================== */

/* --------------------------------------------------------------------------
   6) Buttons / Controls
   -------------------------------------------------------------------------- */
/* Exit button (X) */
.btn-exit {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;

  font-size: 20px;
  font-weight: bold;

  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}
.btn-exit:active { background: var(--danger); color: white; border-color: var(--danger); }

/* Generic buttons used in footer */
button {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  color: var(--text-main);

  font-size: 18px;
  font-weight: 600;
  cursor: pointer;

  height: 100%;
}
button:active { background: #333; transform: scale(0.98); }

.btn-next {
  background: var(--accent-glow);
  border-color: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}
.btn-next:active { background: rgba(56, 189, 248, 0.3); }

/* --------------------------------------------------------------------------
   7) Timer
   -------------------------------------------------------------------------- */
.timer-box { text-align: right; min-width: 100px; }

.timer-digits {
  font-size: 42px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.timer-bar-bg { width: 100%; height: 4px; background: #222; margin-top: 5px; border-radius: 2px; }

.timer-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 1s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* --------------------------------------------------------------------------
   8) Main content (scroll area)
   -------------------------------------------------------------------------- */
main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  margin-bottom: 16px;
  padding-right: 5px;
}

main::-webkit-scrollbar { width: 4px; }
main::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* --------------------------------------------------------------------------
   9) Cards / Typography
   -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid #222;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

p {
  margin: 0 0 15px 0;
  font-size: 19px;
  line-height: 1.5;
  white-space: pre-wrap;
}
p:last-child { margin-bottom: 0; }

ul { margin-top: 0; }
li { margin-bottom: 8px; }

.spoken {
  color: #fff;
  font-style: italic;
  border-left: 3px solid var(--highlight);
  padding-left: 12px;
}

.action { color: var(--accent); font-weight: 600; font-size: 18px; }

/* --------------------------------------------------------------------------
   10) Footer (session controls)
   -------------------------------------------------------------------------- */
footer {
  flex-shrink: 0;

  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 15px;

  height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: content-box;
}

/* --------------------------------------------------------------------------
   11) Home menu buttons (index)
   -------------------------------------------------------------------------- */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.menu-btn {
  display: block;
  text-decoration: none;

  background: #1a1a1a;
  border: 1px solid #333;
  padding: 25px;
  border-radius: 16px;

  color: var(--text-main);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.menu-btn span {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 400;
}
/* --------------------------------------------------------------------------
   12) LESSON SLIDES (mobile + tablet portrait: 1 kolumna, desktop/tablet landscape: 2 kolumny)
   -------------------------------------------------------------------------- */

/* Dla stron lekcji pozwól, by container był szerszy na desktopie */
body.page-lesson-detail .container {
  max-width: 1100px;
}

/* Layout slajdu lekcji: media + tekst */
.lesson-slide-container {
  display: flex;
  flex-direction: column;   /* domyślnie jedna kolumna (mobile / tablet portrait) */
  gap: 20px;
  margin: 20px 0;
}

.lesson-slide-media {
  flex: 1;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid #333;
  border-radius: 16px;
  padding: 20px;
}

.lesson-slide-text {
  flex: 1;
  padding: 20px;
  border: 1px solid #333;
  border-radius: 16px;
  background: var(--card);
  margin-top: 16px;         /* odstęp pod media przy 1 kolumnie */
}

.lesson-slide-image,
.lesson-slide-video {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* 2 kolumny dopiero od ~tablet landscape / desktop */
@media (min-width: 1024px) {
  .lesson-slide-container {
    flex-direction: row;
  }

  .lesson-slide-media {
    flex: 0 0 45%;
  }

  .lesson-slide-text {
    flex: 1;
    margin-top: 0;          /* w 2 kolumnach odstęp niepotrzebny */
  }
}

/* Duże ekrany – proporcje 40/60 */
@media (min-width: 1280px) {
  .lesson-slide-media {
    flex: 0 0 40%;
  }

  .lesson-slide-text {
    flex: 0 0 60%;
  }
}

/* Kontrolki lekcji – lewo: lista, prawo: cofnięcie/następny */
.lesson-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.lesson-controls-left,
.lesson-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson-controls-left {
  flex: 1;
  justify-content: flex-start;
}

.lesson-controls-right {
  flex: 1;
  justify-content: flex-end;
}

/* Wygląd przycisków lekcji (spójny z playerem scripts) */
.btn-lesson-nav,
.btn-lesson-secondary {
  text-align: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.btn-lesson-secondary {
  background: #111;
  border-color: #333;
}

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

/* Mobile + tablet portrait: 3 przyciski pod sobą na dole */
@media (max-width: 1023px) {
  .lesson-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .lesson-controls-left,
  .lesson-controls-right {
    flex-direction: column;
    justify-content: stretch;
    gap: 8px;
  }

  .btn-lesson-nav,
  .btn-lesson-secondary {
    width: 100%;
  }
}
/* Szerzej TYLKO dla detalu lekcji – lista zostaje jak scripts */
body.page-lesson-detail .container {
  max-width: 1100px;  /* szerokie 2 kolumny */
}
/* --------------------------------------------------------------------------
   13 PROFILE PAGE
   -------------------------------------------------------------------------- */
.profile {
  max-width: 800px;
  margin: 0 auto;
}

.profile__title {
  margin: 0 0 4px 0;
  font-size: 26px;
}

.profile__subtitle {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 15px;
}

.profile__card p {
  font-size: 16px;
  margin-bottom: 8px;
}

.profile__stats {
  margin-top: 24px;
}

.profile__stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.profile__stat {
  text-align: center;
}

.profile__stat-number {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile__stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* link-button w stylu reszty UI */
.btn-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.btn-link--danger {
  border-color: var(--danger);
  color: var(--danger);
}
