/* ===============================
   VARIABILI GLOBALI 
   =============================== */
:root {
  --font-family-main: 'Helvetica Neue', Arial, sans-serif;
  --navbar-height: 60px;
  --color-dark: #1b1f24;
  --color-light: #eaeaea;
  --text-color: var(--color-dark);
  --footer-bg: #eaeaea30;
  --btn-bg: #1b1f24;
  --btn-fg: #eaeaea;
  --gray: #777777;
}

[data-theme="dark"] {
  --bg: #1b1f24;
  --fg: #eaeaea;
  --footer-bg: #1b1f2430;
  --btn-bg: #eaeaea;
  --btn-fg: #1b1f24;
  --gray: #aaaaaa;
}

/* ===============================
   RESET E IMPOSTAZIONI DI BASE
   =============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch; /* smooth scroll compatibilità */
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-family-main);
  display: flex;
  flex-direction: column;
}

/* ===============================
   CONTENUTO PRINCIPALE
   =============================== */
main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* ===============================
   FOOTER - STILI COMUNI
   =============================== */
footer {
  background-color: var(--footer-bg);
  border-top: 2px solid #CCCCCC30;
  border-left: 0;
  border-right: 0;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(50px);
 -webkit-backdrop-filter: blur(50px);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: calc(100vh / 10.618);
  border-radius: 0;
  z-index: 1000;
  overflow: hidden;
  box-sizing: border-box;
  will-change: height, width, border-radius, transform;
  transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===============================
   FOOTER STATI 
   =============================== */
footer.normal {
  position: fixed;
  transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              border-width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

footer.settings,
footer.categories {
  pointer-events: auto;
}

footer.settings {
    height: 100vh; /* fallback */
  height: calc(var(--vh, 1vh) * 100);
  width: 100vw;
  border-radius: 0;
  transition: height 0.5s cubic-bezier(0.9, 0, 0, 1);
}

footer.categories {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  border: 2px solid #CCCCCC30;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: max(calc(100vw / 21.618), 16px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 2 * clamp(0.5em, 5vw, 1em));
  height: calc(100vh / 10.618);
  border-radius: 20px;
  transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              border-width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===============================
   FOOTER CONTENUTI
   =============================== */
footer .normal-content,
footer .settings-content,
footer .categories-content {
  opacity: 0;
  filter: blur(10px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.1, 1),
              filter 0.5s cubic-bezier(0.4, 0, 0.1, 1),
              visibility 0s linear 0.5s;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

footer.visible-normal .normal-content,
footer.visible-settings .settings-content,
footer.visible-categories .categories-content {
  opacity: 1;
  filter: blur(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

/* Layout specifici */
footer .normal-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100vh / 10.618);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

footer .settings-content {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: 5em; /* uguale all'altezza di .normal-content */
}

footer .categories-content {
	display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 2em;
}

footer.no-transition * {
  transition: none !important;
}

/* ===============================
   ICONE E LOGO
   =============================== */
.logo {
  height: 2em;
  width: auto;
  display: block;
}

.icon {
  width: 1.6em;
  height: auto;
  display: block;
}

.icon-lang {
  width: 2em;
  height: auto;
  display: block;
}

#category-icons {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
}

#category-icons [data-cat] img {
  opacity: 0.5;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#category-icons [data-cat].active img {
  transform: scale(1.5);
  opacity: 1;
}

footer.visible-settings .settings-content,
footer.visible-settings .normal-content {
  opacity: 1;
  filter: blur(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}


#language-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

#language-list button {
  all: unset;
  border-radius: 0;
  font-size: 1em;
  width: 13.618em;
  height: 3em;
  font-weight: bold;
  margin: 0.1em 0;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform 0.3s ease, background-color 0.3s ease;
  opacity: 0;
  transform: translateY(500px) scale(0.8);
  will-change: transform;
}

#language-list button.visible {
  animation: buttonInertia 0.6s ease-out forwards;
}

@keyframes buttonInertia {
  0% {
    transform: translateY(500px) scale(0.8);
    opacity: 0;
  }
  80% {
    transform: translateY(5px) scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

