body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Lens Modal Styles */
.lens-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.lens-modal.show {
  opacity: 1;
}

.lens-modal-content {
  background: white;
  width: 90%;
  height: 90%;
  max-width: 800px;
  max-height: 600px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.lens-modal.show .lens-modal-content {
  transform: scale(1);
}

.lens-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.lens-modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.lens-modal-close {
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #666;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.lens-modal-close:hover {
  background-color: #e9ecef;
}

.lens-modal-nav {
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  color: #666;
}

.nav-button {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
}

.nav-button:hover {
  color: #0056b3;
}

.nav-separator {
  margin: 0 8px;
}

.nav-current {
  font-weight: bold;
  color: #333;
}

.lens-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px; /* Reduzido de 20px para 10px */
}

.no-data {
  text-align: center;
  color: #666;
  font-style: italic;
  margin-top: 50px;
}

/* Lists View */
.lists-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

/* Promo Box */
.box-promo {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  grid-column: 1 / -1; /* Span full width */
  order: -1; /* Appear first */
  display: none; /* Hidden by default */
  pointer-events: auto; /* Ensure clickability */
  z-index: 1000; /* High z-index to ensure visibility */
  height: 120px; /* Altura fixa reduzida */
  margin-bottom: 0; /* Remove o gap entre o banner e as outras boxes */
}

.box-promo.show {
  display: block;
}

.box-promo:hover {
  border-color: #007bff;
  background: #e7f3ff;
  transform: translateY(-2px);
}

.box-promo img {
  width: 100%;
  height: 100%; /* Ocupa toda a altura do container */
  display: block;
  border-radius: 8px;
  object-fit: cover; /* Mantém proporção da imagem */
}

.list-item {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.list-item.has-cover {
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
  color: white;
  padding-right: 120px; /* Espaço para a capa à direita */
}



.list-item:hover {
  border-color: #007bff;
  background: #e7f3ff;
  transform: translateY(-2px);
}

.list-item.has-cover:hover {
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
  padding-right: 120px; /* Manter espaço para a capa */
  transform: translateY(-2px);
}



.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.list-title {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  flex: 1;
}

.list-count {
  color: #666;
  font-size: 14px;
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: bold;
}

.list-description {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
}

/* Lenses View */
.lenses-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px; /* Reduzido de 15px para 10px */
}

.lens-item {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.lens-item.has-cover {
  background-size: contain !important;
  background-position: right center !important;
  background-repeat: no-repeat !important;
  color: white !important;
  padding-right: 120px !important; /* Espaço para a capa à direita */
}



.lens-item:hover {
  border-color: #007bff;
  background: #e7f3ff;
  transform: translateY(-2px);
}

.lens-item.has-cover:hover {
  background-size: contain !important;
  background-position: right center !important;
  background-repeat: no-repeat !important;
  padding-right: 120px !important; /* Manter espaço para a capa */
  transform: translateY(-2px);
}



.lens-item.selected {
  border-color: #28a745;
  background: #d4edda;
}

.lens-item.has-cover.selected {
  border-color: #28a745;
}



.lens-name {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.lens-description {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
}

.lens-id {
  color: #999;
  font-size: 12px;
  font-family: monospace;
  display: none;
}

/* Lens Info Display */
.lens-info-display {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #1e1e1e;
  padding: 10px 21px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  font-size: 18px;
  font-family: Arial, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  z-index: 1001;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 200px;
  max-width: 80vw;
}

.lens-info-display:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.lens-info-display:active {
  transform: translateX(-50%) scale(0.98);
}

.lens-info-title { display: none; }
.lens-info-subtitle { display: none; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .lens-modal-content {
    width: 95%;
    height: 95%;
    margin: 0;
  }
  
  .lists-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .lenses-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .lens-modal-title {
    font-size: 20px;
  }
  
  .lens-modal-header {
    padding: 15px;
  }
  
  .lens-modal-body {
    padding: 8px; /* Reduzido de 15px para 8px */
  }
  
  .lens-info-display {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    padding: 8px 12px;
    max-width: 200px;
    min-width: 150px;
  }
  
  .box-promo {
    margin-bottom: 0; /* Remove o gap entre o banner e as outras boxes */
    height: 80px; /* Altura fixa reduzida para mobile */
  }
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1;
}
#capture-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 0;
}

.poweredbysnap-logo {
  width: auto; /* Set to auto to avoid stretching */
  position: absolute; /* Position relative to the viewport */
  bottom: 20px; /* Position at bottom with small margin */
  left: 20px; /* Position at left with small margin */
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Align content within the element to the left */
  z-index: 900;
}

.poweredbysnap-logo > img {
  width: 90px; /* 50% smaller than original 180px */
}

#controls { display: contents; }

/* UI Cam Box container (Figma frame + functional buttons) */
#ui-cam-box {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 70px 70px;
  align-items: center;
  justify-items: center;
  column-gap: 300px; /* Changed from 40px to 80px */
  z-index: 999;
  pointer-events: none;
}

/* Timer Display */
#timer-display {
  position: absolute;
  left: 50%;
  top: -50px;
  transform: translateX(-50%);
  color: white;
  font-size: 36px;
  font-weight: bold;
  font-family: 'Bebas Neue', sans-serif;
  z-index: 1000;
  pointer-events: none;
  display: none;
  text-align: center;
}

/* removed bg image hook */

/* (removed old decorative-only #ui-cam-box styles) */

#outline {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  height: 70px;
  width: 70px;
  border: none;
  z-index: 900;
  transition: background-color 0.2s ease;
  pointer-events: none;
}

#record-button {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  height: 70px;
  width: 70px;
  background-image: url(assets/RecordButton.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  border-radius: 50%;
  border: none;
  z-index: 1000;
  transition: background-color 0.2s ease;
  pointer-events: auto;
}

#record-button.pressed {
  background-color: green; /* Change to green when pressed */
  content: "Recording..."; /* Optionally add text */
}

#action-buttons {
  position: absolute;
  bottom: 9%; /* Adjust the distance from the bottom of the screen */
  left: 50%; /* Center horizontally */
  transform: translate(-50%); /* Offset by half the width and height */
  display: flex; /* Enables flex layout */
  justify-content: center; /* Aligns buttons horizontally */
  align-items: center; /* Aligns buttons vertically */
  z-index: 1000; /* Ensure visibility above other elements */
  flex-wrap: wrap; /* Allows wrapping if container width is too small */
}

#back-button-container {
  position: absolute;
  top: 2%;
  left: 3%;
  z-index: 1000;
}

#back-button {
  transform: none;
  background-color: transparent;
  height: 50px;
  width: 50px;
  color: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  padding: 0%;
  transition: transform 0.15s ease-in-out;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
#back-button img {
  /* Add this if your button uses an image */
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

#back-button:active {
  transform: translate(2px, 2px);
}

#share-button {
  height: 62.5px;
  width: 62.5px;
  background-color: transparent;
  transform: translate(-25%, 0);
  color: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  padding: 0%;
  transition: transform 0.15s ease-in-out;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#share-button img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

#share-button:active {
  transform: translate(calc(-25% + 2px), 2px);
}

#download-button {
  height: 62.5px;
  width: 62.5px;
  background-color: transparent;
  transform: translate(25%, 0);
  color: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  padding: 0%;
  transition: transform 0.15s ease-in-out;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#download-button img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

#download-button:active {
  transform: translate(calc(25% + 2px), 2px);
}

#switch-cam {
  position: absolute;
  top: 3%;
  right: 5%;
  z-index: 950;
}

#switch-button {
  height: 52.5px; /* 50% larger than 35px */
  width: 52.5px; /* 50% larger than 35px */
  background-image: url(assets/SwitchButton.png); /* Green background */
  background-size: contain; /* Ensure the image covers the button */
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* Preent tiling */
  background-color: transparent;
  border: none;
  user-select: none; /* Disable text selection */
  outline: none;
  transition: transform 0.2s ease; /* Smooth hover animation */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#switch-button:active {
  transform: translate(5%, 5%); /* Only scale without affecting translation */
}

/* Resolution Control Button */
#resolution-control {
  position: absolute;
  top: 12%; /* Posicionado abaixo do botão de câmera */
  right: 5%; /* Mesma posição horizontal do botão de câmera */
  z-index: 950;
}

#resolution-button {
  height: 52.5px;
  width: 52.5px;
  background-color: white; /* Fundo branco */
  color: black; /* Texto preto */
  border: 2px solid #ccc; /* Borda cinza */
  border-radius: 50%; /* Formato circular */
  font-family: Arial, sans-serif; /* Fonte Arial */
  font-size: 11px; /* Tamanho ajustado para caber no círculo */
  font-weight: bold; /* Texto em negrito */
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

#resolution-button:hover {
  background-color: #f0f0f0; /* Cinza claro no hover */
  transform: scale(1.05);
}

#resolution-button:active {
  transform: scale(0.95);
}

/* Gallery Control Button */
#gallery-control {
  position: absolute;
  top: 22%; /* Posicionado abaixo do botão de resolução */
  right: 5%; /* Mesma posição horizontal do botão de resolução */
  z-index: 950;
}

#gallery-button {
  height: 52.5px;
  width: 52.5px;
  background-image: url(assets/gallery-btn.png);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ensure no text content */
  color: transparent !important;
  font-size: 0 !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
}

/* Remove any pseudo-elements that might add content */
#gallery-button::before,
#gallery-button::after {
  display: none !important;
  content: none !important;
}

#gallery-button:hover {
  transform: scale(1.05);
}

#gallery-button:active {
  transform: scale(0.95);
}

/* Hide resolution button on desktop */
.desktop #resolution-control {
  display: none;
}

/* Ensure banner is clickable on desktop */
.desktop .box-promo {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 1001 !important;
}

.desktop .box-promo img {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 900;
  display: none; /* Hidden by default */
}

#loading-icon {
  height: 200px;
  width: 200px;
  animation: spin 2s linear infinite; /* Apply the spin animation */
}

/* Keyframes for the rotation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Desktop-specific styles */
.desktop #outline {
  height: 70px;
  width: 70px;
}

.desktop #record-button {
  height: 70px;
  width: 70px;
}

.desktop #share-button {
  height: 35px;
  width: 35px;
}

.desktop #download-button {
  height: 35px;
  width: 35px;
}

.desktop #back-button {
  height: 25px;
  width: 25px;
}

/* Hide switch button on desktop */
.desktop #switch-cam {
  display: none;
}

/* Capture Button Styles (inside cam box) */
#capture-button {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  height: 70px;
  width: 70px;
  background-color: #ffffff;
  background-image: url(assets/cam-picto.png);
  background-size: 60% 60%;
  background-position: center;
  background-repeat: no-repeat;
  border: 3px solid #ffffff;
  outline: 1.5px solid rgba(0,0,0,0.5);
  outline-offset: -1px;
  color: transparent;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

#capture-button:hover {
  transform: scale(1.03);
}

#capture-button:active {
  transform: scale(0.96);
}

/* Photo Preview Modal Styles */
#photo-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.photo-preview-content {
  background: white;
  border-radius: 15px;
  padding: 20px;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp 0.3s ease;
}

#captured-photo {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.photo-preview-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.photo-button {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

#share-photo-button {
  background-color: #007bff;
  color: white;
}

#share-photo-button:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

#close-photo-button {
  background-color: #dc3545;
  color: white;
}

#close-photo-button:hover {
  background-color: #c82333;
  transform: scale(1.05);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  #ui-cam-box {
    column-gap: 200px; 
    bottom: 60px;
  }
  
  #timer-display {
    left: 50%;
    top: -50px;
    transform: translateX(-50%);
    font-size: 32px;
    text-align: center;
  }
  
  .photo-preview-content {
    padding: 15px;
    margin: 10px;
  }
  
  .photo-button {
    padding: 10px 20px;
    font-size: 14px;
    min-width: 100px;
  }
}

/* Animation for messages */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Privacy Policy Modal Styles */
#privacy-policy-modal {
  font-family: 'Inter', Arial, sans-serif;
}

#privacy-policy-modal a {
  color: #621eff;
  text-decoration: underline;
  transition: color 0.2s ease;
}

#privacy-policy-modal a:hover {
  color: #4a0fd8;
}

#privacy-policy-modal ul {
  margin: 10px 0;
  padding-left: 20px;
}

#privacy-policy-modal li {
  margin-bottom: 8px;
}

#privacy-policy-modal h3 {
  color: #621eff;
  margin: 30px 0 15px 0;
  font-weight: 600;
}

#privacy-policy-modal p {
  margin-bottom: 15px;
  line-height: 1.6;
}

/* Mobile responsive for privacy modal */
@media (max-width: 768px) {
  #privacy-policy-modal {
    /* Padding is now handled by inline styles with clamp() */
  }
  
  /* All font sizes are now handled by inline styles with clamp() */
}

