.header-sections {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  background: linear-gradient(to bottom, #fff685, #feed00);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-left {
  flex: 2.5;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo {
  height: 70px;
  width: auto;
}

.logo-flip {
  position: relative;
  width: 70px;
  height: 70px;
  perspective: 1000px;
}

.logo-flip .logo {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: transform 0.9s ease;
}

.logo-flip .front {
  transform: rotateY(0deg);
  z-index: 2;
}

.logo-flip .back {
  transform: rotateY(180deg);
}

.logo-flip:hover .front {
  transform: rotateY(90deg);
  z-index: 1;
}

.logo-flip:hover .back {
  transform: rotateY(0deg);
  z-index: 2;
}

.name-logo {
  height: 30px;
  width: auto;
}

.header-middle {
  flex: 6.8;
  text-align: center;
}

.header-middle a {
  color: black;
  text-decoration: none;
  padding: 1rem;
  font-weight: bold;
}

.header-middle a:hover {
  color: #000000;
}

/* Animácia podčiarknutia pre konkrétne položky */
.header-middle a.lang[data-sk="História"],
.header-middle a.lang[data-sk="Rozpis"],
.header-middle a.lang[data-sk="Fotky"],
.header-middle a.lang[data-sk="Hráči"],
.header-middle a.lang[data-sk="Strelci"] {
  position: relative;
  overflow: hidden;
}

.header-middle a.lang[data-sk="História"]::after,
.header-middle a.lang[data-sk="Rozpis"]::after,
.header-middle a.lang[data-sk="Fotky"]::after,
.header-middle a.lang[data-sk="Hráči"]::after,
.header-middle a.lang[data-sk="Strelci"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.5rem;
  width: 100%;
  height: 2px;
  background-color: black;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-in-out;
}

.header-middle a.lang[data-sk="História"]:hover::after,
.header-middle a.lang[data-sk="Rozpis"]:hover::after,
.header-middle a.lang[data-sk="Fotky"]:hover::after,
.header-middle a.lang[data-sk="Hráči"]:hover::after,
.header-middle a.lang[data-sk="Strelci"]:hover::after {
  transform: scaleX(1);
}

/* Dark mód verzia podčiarknutia */
body.dark .header-middle a.lang[data-sk="História"]::after,
body.dark .header-middle a.lang[data-sk="Rozpis"]::after,
body.dark .header-middle a.lang[data-sk="Fotky"]::after,
body.dark .header-middle a.lang[data-sk="Hráči"]::after,
body.dark .header-middle a.lang[data-sk="Strelci"]::after {
  background-color: #ffee00;
}

/* ▼▼▼ Dropdown menu (vylepšené) ▼▼▼ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 180px;
  border-radius: 0.5rem;
  z-index: 999;
  overflow: hidden;

  /* Rozbaľovací efekt */
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 0.6s ease,
    opacity 0.3s ease;
}

.dropdown-menu a {
  padding: 0.75rem 1rem;
  display: block;
  text-decoration: none;
  color: black;
  font-weight: normal;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.dropdown-menu a:hover {
  background-color: rgba(0, 0, 0, 0.25);
}

.dropdown:hover .dropdown-menu {
  max-height: 500px; /* alebo podľa potreby */
  opacity: 1;
  pointer-events: auto;
}

/* DARK MODE */
body.dark .dropdown-menu {
  backdrop-filter: blur(12px);
  background-color: rgba(88, 88, 88, 0.6); /* jemne priesvitná čierna */
  box-shadow: 0 4px 12px rgba(255, 255, 0, 0.2);
}

body.dark .dropdown-menu a {
  color: #ffee00;
}

body.dark .dropdown-menu a:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.dropdown-toggle .arrow {
  transition: transform 0.3s ease;
  font-size: 0.75rem;
}

/* Rotácia šípky pri hovernutí dropdownu */
.dropdown:hover .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

.header-right {
  flex: 0.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.toggle-container {
  display: flex;
  gap: 1rem;
}

.toggle-checkbox {
  display: none;
}

.toggle-container label {
  position: relative;
  display: inline-block;
  width: 41.5px;
  height: 25px;
}

.toggle-container label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 41.5px;
  height: 25px;
  background-color: #000000;
  border-radius: 26px;
  transition: background-color 0.3s;
}

.toggle-container label::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 1.5px;
  width: 18px;
  height: 19px;
  background-color: rgb(255, 255, 255);
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-container input:checked + label::after {
  transform: translateX(20px);
}

/* Pre dark mód */
body.dark .toggle-container input:checked + label::before {
  background-color: #ffee00;
}

body.dark .toggle-container label::before {
  background-color: #ffee00;
}

/* Skryť checkboxy */
.toggle-checkbox {
  display: none;
}

/* Spoločný štýl prepínača */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 28px;
  background-color: #ccc;
  border-radius: 28px;
  cursor: pointer;
  overflow: hidden;
  font-size: 0.7rem;
  text-align: center;
  transition: background-color 0.3s;
}

.switch-label {
  position: absolute;
  width: 50%;
  height: 100%;
  line-height: 28px;
  font-weight: bold;
  font-size: 0.65rem;
  color: #000000;
  z-index: 2;
}

.switch-label.left {
  left: 0;
}

/* ---------- Denný režim ---------- */

.lang-switch .switch-label {
  height: 20px;
  line-height: 26px;
  color: black;
}

#lang-toggle:checked + .lang-switch .switch-label.right {
  color: rgb(0, 0, 0);
}

#lang-toggle:not(:checked) + .lang-switch .switch-label.left {
  color: rgb(0, 0, 0);
}

/* ---------- Tmavý režim ---------- */

body.dark .lang-switch .switch-label {
  color: gray;
}

body.dark #lang-toggle:checked + .lang-switch .switch-label.right {
  color: rgb(255, 255, 255);
}

body.dark #lang-toggle:not(:checked) + .lang-switch .switch-label.left {
  color: rgb(255, 255, 255);
}

/* Štýl ikon v denný režim */
.theme-switch .fa-sun {
  color: orange;
}

.theme-switch .fa-moon {
  color: white;
}

/* Štýl ikon v nočný režim */
body.dark .theme-switch .fa-sun {
  color: #777; /* sivá */
}

body.dark .theme-switch .fa-moon {
  color: #0092e7; /* tmavomodrá */
}

/* Čierny kruh v tmavom režime */
body.dark .toggle-container label::after {
  background-color: #000000 !important;
}

/* Veľkosť slnka a mesiaca */
.theme-switch i {
  font-size: 0.75rem;
}

body.dark .theme-switch i {
  font-size: 0.75rem;
}

body.dark .header-sections {
  background: linear-gradient(to bottom, #222, #333);
  box-shadow: 0 4px 8px rgba(243, 219, 0, 0.4);
}

body.dark .header-middle a {
  color: #ffee00;
}

body.dark .header-middle a:hover {
  color: #ffeb3b; /* napr. žltá pri hovernutí v dark móde */
}

.light-img {
  display: inline;
}

.dark-img {
  display: none;
}

body.dark .light-img {
  display: none;
}

body.dark .dark-img {
  display: inline;
}

/* Skryj hamburger na veľkých obrazovkách */
/* === SPIN HAMBURGER ŠTÝL === */
.hamburger {
  display: none;
  padding: 15px 15px;

  cursor: pointer;
  transition-property: opacity, filter;
  transition-duration: 0.15s;
  transition-timing-function: linear;
  font: inherit;
  color: inherit;
  text-transform: none;
  background-color: transparent;
  border: 0;
  margin: 0;
  overflow: visible;
  z-index: 1001;
}

.hamburger-box {
  width: 24px;
  height: 18px;
  display: inline-block;
  position: relative;
}

.hamburger-inner {
  display: block;
  top: 50%;
  margin-top: -1.5px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 24px;
  height: 3px;
  background-color: black;
  border-radius: 4px;
  position: absolute;
  transition-duration: 0.3s;
  transition-property: transform;
  transition-timing-function: ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
}

.hamburger-inner::before {
  top: -8px;
}

.hamburger-inner::after {
  bottom: -8px;
}

.hamburger--spin.is-active .hamburger-inner {
  transform: rotate(45deg);
}

.hamburger--spin.is-active .hamburger-inner::before {
  transform: rotate(90deg);
  top: 0;
  opacity: 1;
}

.hamburger--spin.is-active .hamburger-inner::after {
  transform: rotate(90deg);
  bottom: 0;
}

body.dark .hamburger-inner,
body.dark .hamburger-inner::before,
body.dark .hamburger-inner::after {
  background-color: #ffee00;
}
/* Mobilné menu */
.mobile-menu {
  flex-direction: column;
  gap: 1rem;
  background-color: rgba(248, 226, 55, 0.65); /* jemne žltkastý a priesvitný */
  backdrop-filter: blur(10px); /* rozmaže pozadie pod menu */
  padding: 1rem;
  position: fixed;
  top: 85px;
  right: 1rem; /* zarovná menu k hamburgeru na pravej strane */
  left: auto;
  width: max-content; /* prispôsobí šírku obsahu */
  min-width: 200px;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 999;
}

body.dark .mobile-menu {
  background-color: rgba(40, 40, 40, 0.85); /* tmavé priesvitné pozadie */
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 8px rgba(255, 255, 0, 0.4); /* jemne žltý tieň */
}

.mobile-menu.active {
  position: fixed;
}

.mobile-links a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: bold;
  color: black;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.dark .mobile-links a {
  color: #ffee00;
}

body.dark .mobile-links a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Pri zúžení obrazovky */
@media (max-width: 1220px) {
  .header-middle,
  .header-right {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu.active {
    display: flex;
  }
}

.mobile-dropdown {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.mobile-dropdown > button {
  background: none;
  border: none;
  font-weight: bold;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  text-align: left;
  color: black;
  cursor: pointer;
}

body.dark .mobile-dropdown > button {
  color: #ffee00;
}

.mobile-submenu {
  display: none;
  flex-direction: column;
  margin-left: 1rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(0, 0, 0, 0.2);
}

body.dark .mobile-submenu {
  border-left: 2px solid rgba(255, 255, 0, 0.3);
}

.mobile-submenu a {
  padding: 0.25rem 0;
}

.mobile-dropdown.open .mobile-submenu {
  display: flex;
}

.mobile-dropdown button .arrow {
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
  font-size: 0.75rem;
}

.mobile-dropdown.open button .arrow {
  transform: rotate(180deg); /* otočí šípku nahor */
}

/* ---------- Tmavý režim pre mobilný jazykový toggle ---------- */
body.dark #lang-toggle-mobile:checked + .lang-switch .switch-label.right {
  color: rgb(255, 255, 255);
}

body.dark #lang-toggle-mobile:not(:checked) + .lang-switch .switch-label.left {
  color: rgb(255, 255, 255);
}

/* === Smooth slide/fade for mobile menu (Six) === */
.mobile-menu {
  /* keep existing props... */
  /* animation states */
  opacity: 0;
  transform: translateY(-10px);
  max-height: 0;
  overflow: clip;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    max-height 0.5s ease;
}

/* Active (opened) state */
.mobile-menu.active {
  opacity: 1;
  transform: translateY(0);
  max-height: 80vh; /* enough room for items */
  pointer-events: auto;
}

/* Only render the mobile menu area on small screens */
@media (max-width: 1200px) {
  .mobile-menu {
    display: flex;
  }
  .mobile-menu.active {
    position: fixed;
  } /* keep user's positioning */
}

/* Hide it entirely on large screens */
@media (min-width: 1201px) {
  .mobile-menu {
    display: none;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu {
    transition: none;
  }
}

/* ===== UNDERLINE EFFECT – HEADER MENU (AUTO, FIXED) ===== */

.header-middle > a.lang {
  position: relative;
  overflow: hidden;
}

.header-middle > a.lang::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.5rem;
  width: 100%;
  height: 2px;
  background-color: black;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-in-out;
}

.header-middle > a.lang:hover::after {
  transform: scaleX(1);
}

/* DARK MODE */
body.dark .header-middle > a.lang::after {
  background-color: #ffee00;
}
