/* style.css - Stili in stile minimale iOS */

/* Colore principale (blu InQuadro) */
:root {
  --primary-color: #9a1c1c;
  --primary-color-hover: #9a1c1c;
}

/* Base: nessun scroll */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #fff;
  color: #333;
  text-align: center;
}

/* Swiper container */
.swiper-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Ogni slide occupa l'intera viewport */
.swiper-slide {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Centra il contenuto (eccetto Detail Screen) */
.swiper-slide:not(#detailScreen):not(#cameraScreen):not(#listScreen) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#cameraScreen,
#listScreen {
  justify-content: center;
  align-items: center;
/*  top: 1rem;*/
  padding-top: 2rem;
  background: #9a1c1c;;
}

/* Overlay per orientamento */
#orientationOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#orientationOverlay img {
  width: 6rem;
  height: 6rem;
  margin-bottom: 1rem;
}

/* Splash Screen */
#splashScreen #logo {
  width: 7rem;
  height: 7rem;
  margin-bottom: 1rem;
  border-radius: 1.25rem;
  object-fit: contain;
}

#loadingBar {
  width: 80%;
  height: 0.2rem;
  background-color: #e5e5e5;
  border-radius: 0.25rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

#loadingProgress {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

#poweredBy {
  margin-top: 4rem;
}

#poweredBy p {
  margin: 0;
  font-size: 0.9rem;
}

#poweredLogo {
  height: 2.2rem;
  margin-top: 0.5rem;
}

/* Language Selection Screen */
#languageScreen h2 {
  position: relative;
  top: -100px;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: white;
  z-index: 9999;
}



#languageContainer {
  position: relative;
  top: -100px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.lang-icon {
  width: 4.5rem;
  height: 4.5rem;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  transition: border-color 0.3s ease;
}

.lang-icon:focus,
.lang-icon:hover {
  border-color: var(--primary-color);
  outline: none;
}

/* Mode Selection Screen */
.istruzioni-container {
  text-align: center;
  /*margin-bottom: 1rem;*/
  position: relative;
  /*top: -100px;*/
}

.title_istruzioni {

  font-size: 1.5rem;
  margin: 0;
  color: white;
  z-index: 9999;
}

#languageButton {
  padding: 0;
}

.istruzioni-container, .mode-select-container {
  top: -50px;
}

.mode-select-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
/*  top: -100px;*/
  color: white;
  width: 100%;
}

.mode-container {
  display: flex;
  gap: 1rem;
  width: 80%;
  justify-content: space-around;
}

.mode-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex:1;
}

.mode-button:hover {
  transform: scale(1.05);
}

.mode-button img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

/* Camera Screen */
#headerCamera,
#headerList,
#footerCamera,
#footerList {
  display: none;
}

#headerCamera {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 100;
}

#headerMap {
  position: absolute;
  top:10px;
  right: 10px;
  z-index: 9999;
}

#footerMap {
  position: absolute;
  bottom:75px;
  left: 10px;
  z-index: 9999;
}

#listToggleButtonText {text-transform: capitalize;}

#mapScreen #bottomInstruction {
  display: none;
}

#videoContainer {
  position: relative;
/* width: 90%;
  max-width: 640px;
  border: 0.125rem solid #ddd;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 1 / 1;*/
  margin: 2rem auto 0.5rem;
}


span#instructionMessage {
  font-size: 1.4rem;
  color: white;
  padding: 0 1rem;
  line-height: 1.7rem;
}

#mapContainer, #map {
/*  position: absolute;
  top: 0;
  left: 0;
    height: 100%;

  flex: 1;
  width: 100%;

  overflow: hidden;*/
  flex: 1;
  width: 100%;
  height: 100vh; /* oppure 100%, se sei dentro un wrapper */
  overflow: hidden;
  position: relative;
}


/*
#videoElement {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#instructionMessage {
  font-size: 1.1rem;
  margin: 0.5rem 0 1rem;
}*/

/* Overlay per il puntatore della camera */
/*#cameraPointer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.8;
}*/

/* Debug Panel */
#debugPanel {
  width: 90%;
  max-width: 640px;
  margin: 0.5rem auto;
  background-color: #f2f2f7;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  text-align: left;
  overflow-y: auto;
  max-height: 10rem;
}

/* Progress Bar */
#progressContainer {
  width: 90%;
  max-width: 640px;
  margin: 0.5rem auto 1rem;
  background-color: #e5e5ea;
  border-radius: 0.625rem;
  overflow: hidden;
}

#progressBar {
  width: 0%;
  height: 1.25rem;
  background-color: #34c759;
  color: #fff;
  text-align: center;
  line-height: 1.25rem;
  font-size: 0.875rem;
  transition: width 0.3s ease, background-color 0.3s ease;
}


/* Footer della Camera Screen */
#footerCamera {
  position: fixed;
  bottom: 8.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 640px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 1000;
}

#footerCamera .icon-button {
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #000;
  transition: background-color 0.2s ease;
}

#footerCamera .icon-button:hover {
  background-color: var(--primary-color-hover);
}

#footerCamera .icon-button img {
  width: 2.5rem;
  height: 2.5rem;
}

#footerCamera p {
  font-size: 0.9rem;
  margin: 0;
}

/* Footer List Screen */
#footerList {
  position: fixed;
  bottom: 8.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 640px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 1000;
}

#footerList .icon-button, #footerMap .icon-button {
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #000;
  transition: background-color 0.2s ease;
}

#footerList .icon-button:hover, #footerMap .icon-button:hover {
  background-color: var(--primary-color-hover);
}

#footerList .icon-button img, #footerMap .icon-button img {
  width: 2.5rem;
  height: 2.5rem;
}

#footerList p, #footerMap p {
  font-size: 0.9rem;
  margin: 0;
}

/* List Screen */
#headerList {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 100;
}

#listScreen h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}


/* Il contenitore della lista viene posizionato tra header e footer e reso scrollabile */
#listContainer {
  position: absolute;
  top: 4.5rem;
  bottom: 13.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 640px;
  overflow-y: auto;
  padding: 0.5rem;
}

.list-item {
  padding: 0.75rem;
  margin-bottom: 0.25rem;
  background-color: #f2f2f7;
  border-radius: 0.5rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.list-item:hover {
  background-color: #e0e0e0;
}

.list-item-thumb {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  background-color: #e5e5ea;
  border-radius: 0.25rem;
  overflow: hidden;
}

.list-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item-content {
  flex-grow: 1;
}

/* Detail Screen */
#detailScreen {
  display: block;
  width: 90%;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1rem 2rem;
  overflow-y: auto;
  height: 100vh;
  box-sizing: border-box;
  text-align: left;
  position: relative;
}

#detailContent h2 {
  margin-top: 0;
}

#detailContent img.thumb {
  width: 100%;
  height: 300px;
  object-fit: contain; /* Mantiene le proporzioni */
  display: block;
  margin: 1rem auto; /* Centra l'immagine orizzontalmente */
  border-radius: 0.5rem;
}

#detailContent audio {
  width: 100%;
  margin: 1rem 0;
}

.close-button {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: #fff;
  /* Changed background color */
  border: 1px solid #444;
  /* Added border */
  border-radius: 0.5rem;
  font-size: 1.5rem;
  color: #444;
  /* Changed text color */
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  z-index: 1100;
  transition: background-color 0.2s ease;
}

.close-button:hover {
  background-color: #f5f5f5;
  /* Changed hover color */
}

#matchOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vw;
  aspect-ratio: 1 / 1;
  background-color: rgba(0, 128, 0, 0.9);
  color: #fff;
  padding: 0; /* rimuoviamo padding per evitare di alterare il rapporto */
  border-radius: 0.75rem;
  font-size: 1.375rem;
  z-index: 1000;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  display: none;

  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none; /* per sicurezza */
}

#matchOverlay.show {
  opacity: 1;
  pointer-events: auto;
}



#matchOverlay img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* oppure 'contain' se vuoi vederla tutta */
  opacity: 0.9;

}

/* Media Queries */
@media (max-width: 480px) {
  html {
    font-size: 18px;
  }

  .big-button {
    font-size: 1.3rem;
    padding: 1.2rem 2.5rem;
  }

  #splashScreen #logo {
    width: 8rem;
    height: 8rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  html {
    font-size: 18px;
  }

  .big-button {
    font-size: 1.3rem;
    padding: 1rem 2.5rem;
  }
}

@media (min-width: 769px) {
  html {
    font-size: 16px;
  }
}

.toggle-button, #modeButton {
  padding: 0.50rem 1rem;
  font-size: 1rem;
  background-color: #fff;
  border: 1px solid #444;
  border-radius: 0.5rem;
  color: #444;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

 #modeButton {
  /*width:50px;
  height: 50px;*/
  /*padding: 10px;
  margin: 5px;*/
}

#languageButton img {
  max-width: 100%;
}

.toggle-button:hover {
  background-color: #f5f5f5;
}

.toggle-button img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}

#listScreen .toggle-button img {
  width: 2rem;
}

#cameraFeedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
}

#cameraFeedbackIcon {
  font-size: 3.6rem;
  padding: 4px 40px 15px;
}

span.author {
  color: black;
}