/* ── Loader ──────────────────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-border {
  border-color: var(--gold) transparent var(--gold) transparent !important;
}

/* ── Design tokens (shared with codillin' / wiciędze / bazgrollin' / wyraj) ─ */
:root {
  --ink: #060606;
  --gold: #c4922a;
  --gold-2: #a0522d;
  --gold-hover: #d4a535;
  --muted: #c4c4c4;
  --panel: rgba(10, 10, 10, 0.95);
  --card: #0d0d0d;
  --border: rgba(255, 255, 255, 0.08);
  --border-quiet: rgba(255, 255, 255, 0.14);
  --radius: 10px;
  /* Local aliases used across this stylesheet */
  --primary: var(--gold);
  --dark: var(--ink);
  --surface: var(--card);
  --surface2: #151515;
  --light: #e0e0e0;
  /* Hub Poppins scale */
  --fs-nav: clamp(1.2rem, 2.9vw, 1.55rem);
  --fs-page: clamp(1.8rem, 5vw, 2.8rem);
  --fs-section: clamp(1.25rem, 2.8vw, 1.5rem);
  --fs-body: 1.05rem;
  --fs-caption: 0.875rem;
  --fs-muted: clamp(1rem, 2.2vw, 1.15rem);
  --measure: 920px;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%);
  background-color: var(--ink);
  background-attachment: fixed;
  color: var(--light);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  color: var(--gold);
}

p { color: var(--light); }

a { color: var(--gold); }
a:hover { color: var(--gold-hover); }

#lingwo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: transparent;
}

.lingwo-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1100;
  background: var(--gold);
  color: #fff;
  font-weight: 400;
  font-family: 'Poppins', sans-serif;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}

.lingwo-skip:focus {
  left: 0;
}

.lingwo-brand,
.navbar-brand.lingwo-brand {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 300 !important;
  font-size: var(--fs-nav) !important;
  letter-spacing: 3px !important;
  color: var(--gold) !important;
  text-decoration: none !important;
  text-transform: none !important;
  gap: 0 !important;
}

.lingwo-brand:hover,
.navbar-brand.lingwo-brand:hover {
  color: var(--gold-hover) !important;
  text-decoration: none !important;
}

.footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--panel);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-weight: 300;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  padding: 1.6rem 1rem 1.8rem;
}

.footer p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.footer a {
  color: var(--gold);
  text-decoration: none;
}

.footer a:hover {
  color: var(--gold-hover);
}


/* ── Swiper overflow wrapper ─────────────────────────────────────────────────── */
.swiper-overflow-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* ── Swiper container — autoHeight ──────────────────────────────────────────── */
.mySwiper {
  overflow: visible !important;
  width: 100%;
  flex: 1;
  background: transparent;
}

/* Slides — padding-top makes room for the pagination bar above */
.mySwiper .swiper-slide {
  overflow: visible;
  height: auto;
  min-height: 100%;
  background: transparent;
  padding: 36px 48px 10px;  /* top: room for progressbar; sides: room for arrows */
  box-sizing: border-box;
}

/* Pagination progressbar — Swiper puts this at top:0 by default, keep it there */
.mySwiper .swiper-pagination {
  top: 0 !important;
  bottom: auto !important;
}

/* ── Navigation arrows ───────────────────────────────────────────────────────── */
.swiper-button-next,
.swiper-button-prev {
  position: absolute !important;
  top: 120px !important;           /* fixed distance from swiper top, below heading */
  transform: none !important;
  z-index: 200 !important;
  color: var(--primary) !important;
  background: rgba(6, 6, 6, 0.7);
  border-radius: 50%;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: rgba(196, 146, 42, 0.2);
}

.swiper-button-prev { left: 4px !important; }
.swiper-button-next { right: 4px !important; }

/* Swiper default arrow size override */
.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 14px !important;
  font-weight: 900;
}

/* Desktop — slightly larger */
@media (min-width: 768px) {
  .swiper-button-next,
  .swiper-button-prev {
    width: 44px !important;
    height: 44px !important;
    top: 140px !important;
  }

  .swiper-button-next::after,
  .swiper-button-prev::after {
    font-size: 18px !important;
  }

  .mySwiper .swiper-slide {
    padding: 10px 64px;
  }
}

/* ── Swiper chrome ──────────────────────────────────────────────────────────── */
.textSwiper {
  background: transparent;
  margin: 0;
  padding: 0;
}

.swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
  background: var(--primary) !important;
}

/* ── Bootstrap card overrides ───────────────────────────────────────────────── */
.card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--light) !important;
  border-radius: var(--radius) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: var(--primary) !important;
}

.card-text,
.card p,
.card .text-muted {
  color: var(--muted) !important;
}

.card-title { color: var(--light) !important; }

/* Success / completion cards — add bottom padding so they're never clipped */
#card-articulator,
#card-exercises,
#card-twister,
#card-trivia,
#card-bonuses,
[id^="card-"] {
  margin-bottom: 2rem !important;
  padding-bottom: 1.5rem !important;
}

/* Swiper slide needs enough padding at bottom for completion cards */
.swiper-slide {
  padding-bottom: 2rem;
}

/* ── Headings with gold underbar ────────────────────────────────────────────── */
h1 {
  font-size: var(--fs-page);
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 1.5rem;
  text-align: center;
}

h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(45deg, var(--gold), var(--gold-2));
  margin: 14px auto 0; /* auto centers the bar under centered text */
  border-radius: 2px;
}

/* Category headings (slides) — match portfolio section h2 style */
.swiper-slide h2,
.swiper-slide h1 {
  text-align: center;
  font-size: var(--fs-section);
}

.swiper-slide h2::after,
.swiper-slide h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(45deg, var(--gold), var(--gold-2));
  margin: 14px auto 28px;
  border-radius: 2px;
}

/* Arrows SVG below 'Otwórz lusterko' — force gold on dark slides (incl. mobile). */
img[src*="arrows.svg"] {
  filter: brightness(0) saturate(100%) invert(64%) sepia(48%) saturate(700%) hue-rotate(5deg) brightness(95%) contrast(92%);
  -webkit-filter: brightness(0) saturate(100%) invert(64%) sepia(48%) saturate(700%) hue-rotate(5deg) brightness(95%) contrast(92%);
  opacity: 1;
}

/* ── Buttons — gold CTAs so they don't disappear on dark slides ─────────────── */
.btn-dark,
.btn-dark:not(:disabled):not(.disabled) {
  background: linear-gradient(45deg, var(--gold), var(--gold-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark:focus-visible {
  background: linear-gradient(45deg, var(--gold-hover), var(--gold-2));
  border-color: transparent;
  color: #fff;
}

.btn-success {
  background: linear-gradient(45deg, var(--gold), var(--gold-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.btn-success:hover {
  background: linear-gradient(45deg, var(--gold-hover), var(--gold-2));
  border-color: transparent;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-quiet);
  color: var(--muted);
  font-weight: 600;
}

.btn-secondary:hover {
  background: rgba(196, 146, 42, 0.12);
  border-color: var(--gold);
  color: #fff;
}

#beaver-yes,
#beaver-options .btn-dark,
#beaver-speech-bubble .btn-dark {
  min-width: 4.5rem;
}

#beaver-no {
  min-width: 4.5rem;
}

/* ── Forms / inputs ─────────────────────────────────────────────────────────── */
.form-control {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--light);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control::placeholder { color: var(--muted); }

.form-control:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 146, 42, 0.18);
  color: var(--light);
  outline: none;
}

/* ── Scroll-to-top button ───────────────────────────────────────────────────── */
#topBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background: var(--surface2);
  color: var(--light);
  cursor: pointer;
  padding: 12px 15px;
  border-radius: 8px;
  transition: background 0.2s;
}

#topBtn:hover { background: var(--primary); }

/* ── Carousel ───────────────────────────────────────────────────────────────── */
.carousel-item {
  text-align: center;
  font-size: 1.2rem;
  height: auto;
  line-height: 1.4;
  padding: 10px;
  color: var(--light);
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 80%;
  max-width: 520px;
  text-align: center;
  font-size: 1.25rem;
  color: var(--light);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close {
  color: var(--muted);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus { color: var(--primary); text-decoration: none; }

/* ── Screen dim overlay ─────────────────────────────────────────────────────── */
#screen-dim {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99;
  display: none;
}

/* ── Beaver mascot — tutorial ───────────────────────────────────────────────── */
#beaver-container,
#polish-beaver-container {
  position: fixed;
  z-index: 100;
  cursor: pointer;
}

#beaver-img,
#polish-beaver-img {
  width: 100px;
  height: auto;
  position: absolute;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

#beaver-speech-bubble,
#polish-beaver-speech-bubble {
  display: block;
  position: absolute;
  background: var(--surface);
  border: 1px solid rgba(196, 146, 42, 0.35);
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 1rem;
  max-width: 300px;
  text-align: center;
  z-index: 101;
  color: var(--light);
}

#close-speech-bubble,
#polish-close-speech-bubble {
  position: absolute;
  top: -10px; right: -10px;
  font-size: 16px;
  background: var(--primary);
  color: #fff;
  width: 22px; height: 22px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  line-height: 22px;
  font-weight: 700;
  transition: background 0.2s;
}

#close-speech-bubble:hover,
#polish-close-speech-bubble:hover { background: var(--gold-2); }

#beaver-text,
#polish-beaver-text { display: block; color: var(--light); }

#beaver-options {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
}

/* ── Polish beaver: running "facts seen" counter ────────────────────────────── */
#polish-beaver-counter {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--light);
  opacity: 0.75;
}

/* ── Exercise / articulator / twister text blocks ───────────────────────────── */
.articulator,
.exercise,
.twister,
.trivia,
.fact {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--light) !important;
  border-radius: var(--radius) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.articulator:hover,
.exercise:hover,
.twister:hover,
.trivia:hover,
.fact:hover {
  border-color: rgba(196, 146, 42, 0.4) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Bootstrap bg-light override inside dark theme */
.bg-light {
  background: var(--surface) !important;
}

.bg-light.bg-gradient {
  background: var(--surface) !important;
}

/* ── Highlight effect (beacon tutorial) ─────────────────────────────────────── */
.highlight {
  outline: 3px solid rgba(196, 146, 42, 0.85) !important;
  box-shadow: 0 0 20px 6px rgba(196, 146, 42, 0.4) !important;
  z-index: 1000;
  position: relative;
}

a.highlight {
  outline: 3px solid rgba(196, 146, 42, 0.85) !important;
  box-shadow: 0 0 20px 6px rgba(196, 146, 42, 0.4) !important;
}

#slide-arrow-container {
  display: none;
  position: absolute;
  right: 30px; top: 50%;
  transform: translateY(-50%);
  z-index: 999;
}

#slide-specific-arrow {
  font-size: 48px;
  text-shadow: 0 0 10px rgba(196, 146, 42, 0.8);
}

/* ── Video mirror containers ─────────────────────────────────────────────────── */
@media only screen and (max-width: 767px) {
  #video-container-articulators,
  #video-container-exercises,
  #video-container-twisters,
  #video-container-bonuses {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 30vh;
    position: relative;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }

  #video-preview-articulators,
  #video-preview-exercises,
  #video-preview-twisters,
  #video-preview-bonuses {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: -70vh; left: 0;
    object-fit: cover;
  }
}

/* ── Navbar adjustments for dark base ───────────────────────────────────────── */
.navbar {
  background: var(--panel) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
}

.navbar .ms-auto.d-flex {
  gap: 0.5rem;
}

.navbar-dark .navbar-nav .nav-link,
.navbar .nav-link {
  color: var(--light);
  font-weight: 300;
  transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar .nav-link:hover { color: var(--gold); }

/* LingwoŁamki icon — link to /tonguetwister/ */
.navbar-tt-home {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.navbar-tt-home:hover { opacity: 1; }

.tt-logo {
  border-radius: 6px;
  display: block;
}

/* Portfolio home brand — avatar + "Home" text */
.navbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--light) !important;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 300 !important;
  font-size: 1rem !important;
  text-decoration: none !important;
  transition: color 0.2s !important;
}

.navbar-brand:hover { color: var(--gold) !important; }

/* Avatar circle — hardcoded in navbar.html */
#navbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(196, 146, 42, 0.5);
  display: block !important;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.navbar-brand:hover #navbar-avatar { border-color: var(--gold); }

/* Bootstrap table dark override */
.table {
  color: var(--light);
  border-color: var(--border);
}

.table thead th {
  border-color: rgba(196, 146, 42, 0.3);
  color: var(--primary);
}

.table td, .table th {
  border-color: var(--border);
}

/* ── Alert / badge overrides ────────────────────────────────────────────────── */
.badge.bg-secondary  { background: var(--surface2) !important; color: var(--muted); }
.alert-info          { background: rgba(196, 146, 42, 0.1); border-color: rgba(196, 146, 42, 0.3); color: var(--light); }

/* ── Focus ring ─────────────────────────────────────────────────────────────── */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}