/* Estils generals del cos de la pàgina */
body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  /* Degradat groc ataronjat més intens */
  background: linear-gradient(115deg, #ffd600 0%, #ffb300 50%, #ff7043 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* Contenidor principal per al logotip i els botons */
.circular-menu-container {
  position: relative;
  width: 500px; /* Mida del contenidor principal */
  height: 500px;
}

/* Estils del contenidor del logotip central */
.logo-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centrar el logotip */
  width: 550px;
  height: 550px;
  border-radius: 50%; /* Fer-lo rodó */
  background-color: #ffffff; /* Color de fons del logotip */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-logo {
  width: 80%;
  height: 80%;
  object-fit: contain; /* Assegurar que el logotip s'ajusta bé */
  border-radius: 50%; /* Arrodoneix la imatge */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Estils del contenidor dels botons */
.buttons-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Estils per a cada botó del menú */
.menu-button {
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 800; /* Molt gruixuda */
  font-size: 24px; /* Més grossa */
  letter-spacing: 1px;
  font-size: 22px;
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #ffd600;
  color: #333;
  border: 2px solid #222;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Posicionament dels 4 botons al voltant del cercle */
.buttons-container .menu-button:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}
.buttons-container .menu-button:nth-child(2) {
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
}
.buttons-container .menu-button:nth-child(3) {
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
}
.buttons-container .menu-button:nth-child(4) {
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
}

.menu-button:hover {
  background-color: #6efaff;
  transform: scale(1.1);
}

/* Estils per a les seccions de contingut */
.content-section {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  max-width: 800px;
  padding: 2em;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  z-index: 10;
}

.content-section.visible {
  opacity: 1;
  visibility: visible;
}

.hidden {
  display: none;
}

.main-content {
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.18, 1);
  will-change: transform;
}

.main-content.shift-left {
  transform: translateX(-22vw);
}

.section-description {
  position: absolute;
  top: 0;
  right: 0;
  width: 40vw;
  height: 100vh;
  background: linear-gradient(
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0.45)
    ),
    url("../images/sections-background.jpg") center/cover no-repeat;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 1.25rem; /* Més gran */
  font-weight: 300; /* Més fina */
  line-height: 1.2; /* Més espaiat i net */
  letter-spacing: 0.01em;
  color: #222;
  overflow-y: auto;
}

.section-description.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-button {
  margin-top: 32px;
  padding: 10px 28px;
  font-size: 18px;
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 700;
  background: #ffd600;
  color: #333;
  border: 2px solid #222;
  border-radius: 0px;
  cursor: pointer;
  transition: background 0.2s;
}
.back-button:hover {
  background: #6efaff;
}

.app-link {
  display: block;
  margin: 32px auto 0 auto; /* Centrat horitzontalment i separació superior */
  padding: 12px 28px;
  font-size: 18px;
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 700;
  background: #ffd600;
  color: #222;
  border: 2px solid #222;
  border-radius: 24px;
  text-decoration: none;
  transition: background 0.2s;
}
.app-link:hover {
  background: #6efaff;
  color: #222;
}

/* Menú hamburguesa (estat base, es mostra a mòbil) */
.burger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.burger-menu span {
  width: 25px;
  height: 3px;
  background: #333;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Ocultar elements mòbils per defecte en desktop */
.mobile-header,
.mobile-menu {
  display: none;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  padding: 12px;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.5px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.footer p {
  margin: 0;
}

/* Ajustar el contingut principal per evitar que el footer el tapi */
body {
  padding-bottom: 50px;
}

/* Media Queries per a responsive design */
@media (max-width: 768px) {
  body {
    padding: 0;
    min-height: 100svh;
    overflow-x: hidden;
    padding-bottom: 50px;
  }

  /* Header mòbil amb logo i hamburguesa */
  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: linear-gradient(115deg, #ffd600 0%, #ffb300 50%, #fdfeff 100%);
    z-index: 1002;
    border-bottom: 4px solid #222;
  }

  .mobile-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
  }

  .mobile-title {
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 1px;
    color: #222;
    user-select: none;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  /* Burger dins el header */
  .burger-menu {
    display: flex;
    position: static;
    background: #ffd600;
    box-shadow: none;
    padding: 8px;
  }

  /* Menú desplegable mòbil */
  .mobile-menu {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    transform: translateY(-100%);
    transition: transform 0.25s ease;
    z-index: 1001;
    padding: 8px 12px 16px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    max-height: calc(100svh - 56px);
    overflow-y: auto;
  }

  .mobile-menu.active {
    transform: translateY(0);
  }

  .mobile-menu a {
    display: block;
    padding: 14px 8px;
    margin: 2px 0;
    text-decoration: none;
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #222;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .mobile-menu a:hover {
    background: rgba(255, 165, 0, 0.22); /* taronja clar */
  }

  .mobile-menu a:active {
    background: rgba(0, 0, 0, 0.06);
  }

  /* Ocultar completament el contenidor circular i botons en mòbil */
  .circular-menu-container {
    display: none;
  }

  /* Mostrar el logotip centrat en mòbil */
  .main-content {
    margin-top: 56px; /* evitar que el header fix el tapi */
  }

  .circular-menu-container {
    display: flex; /* sobreescriu el display:none anterior */
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: calc(100svh - 56px);
  }

  /* Amagar els botons en mòbil i només mostrar el logotip */
  .buttons-container {
    display: none;
  }

  /* Restablir posició del contenidor del logotip per centrat amb flex */
  .logo-container {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: min(70vw, 320px);
    height: min(70vw, 320px);
  }

  /* Secció de descripció per a mòbils a sobre de tot */
  .section-description {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100svh;
    padding: 20px;
    font-size: 1rem;
    overflow-y: auto;
    z-index: 2000;
    background-size: 115% auto;
    background-attachment: fixed;
  }

  /* Animació no necessària en mòbil per al contingut principal */
  .main-content.shift-left {
    transform: none;
  }

  /* Botons interns de la fitxa */
  .back-button,
  .app-link {
    width: 100%;
    max-width: 320px;
    margin: 20px auto;
    text-align: center;
    display: block;
  }

  /* Fer que el botó d'accés no ocupi el 100% en mòbil */
  .section-description .app-link {
    width: auto;
    max-width: none;
    display: inline-block;
    font-weight: 800;
  }

  /* Espai extra a dalt per al botó de tancar */
  .section-description {
    padding-top: 64px;
  }

  /* Substituir el botó "Tornar" per una 'X' flotant a la cantonada superior dreta en mòbil */
  .section-description .back-button {
    position: absolute;
    top: 12px;
    top: calc(env(safe-area-inset-top) + 12px);
    right: 40px;
    right: calc(env(safe-area-inset-right) + 40px);
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #222;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0; /* amaga el text "Tornar" */
    z-index: 2100;
  }

  .section-description .back-button::before {
    content: "×";
    font-size: 28px;
    line-height: 1;
    color: #222;
  }

  .section-description .back-button:hover {
    background: #f2f2f2;
  }

  /* Tipografia més fina i evitar retall a la dreta en mòbil */
  .section-description {
    padding-left: calc(env(safe-area-inset-left) + 20px);
    padding-right: calc(env(safe-area-inset-right) + 20px);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .section-description p,
  .section-description li,
  .section-description a {
    font-weight: 300;
  }

  .footer {
    padding: 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .mobile-logo {
    height: 28px;
  }

  .mobile-menu a {
    font-size: 15px;
    padding: 12px 8px;
  }

  .section-description {
    padding: 16px;
    font-size: 0.95rem;
  }

  .back-button,
  .app-link {
    padding: 12px 20px;
    font-size: 16px;
  }
}

/* Estats especials per a mòbils */
body.menu-open {
  overflow: hidden;
}

/* Animació d'entrada per als botons del menú mòbil */
@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.buttons-container.active .menu-button {
  animation: slideInFromLeft 0.3s ease forwards;
}

.buttons-container.active .menu-button:nth-child(1) {
  animation-delay: 0.1s;
}
.buttons-container.active .menu-button:nth-child(2) {
  animation-delay: 0.2s;
}
.buttons-container.active .menu-button:nth-child(3) {
  animation-delay: 0.3s;
}
.buttons-container.active .menu-button:nth-child(4) {
  animation-delay: 0.4s;
}

