@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

:root {
  --bs-white: #fff;
  --bs-gray-100: #f8f9fa;
  --bs-gray-200: #e9ecef;
  --bs-gray-500: #7a7a7a;
  --bs-gray-800: #3f3f3f;
  --bs-dark: hsl(0, 0%, 15%);
  --bs-black: rgb(12, 12, 12);
}

/* RESET BÁSICO (compatível Bootstrap) */
* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 1rem; /* Bootstrap padrão */
}

/* =========================
   LAYOUT GERAL
   ========================= */

section {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#stage {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#pano-config-api,
.marzipano-canvas {
  background: rgb(51, 51, 51);
  flex: 1;
  height: 100%;
  position: relative;
}

/* =========================
   CONTAINER UI
   ========================= */

.ui-container {
  position: relative;
  top: 0;
  right: 0;
  width: clamp(100px, 20vw, 300px);
  height: 100vh;
  padding: 1rem;
  background-color: var(--bs-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* só os elementos internos recebem clique */
.ui-container * {
  pointer-events: auto;
}

/* =========================
   MENU PRINCIPAL
   ========================= */

#menu-elements {
  padding: 5px;
}

.menu-item {
  --thumb-size: clamp(48px, 6vw, 80px);

  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.4rem, 1vw, 0.75rem);
  padding: clamp(0.4rem, 1vw, 0.75rem);
  margin-bottom: 0.75rem;
  border: 1px solid var(--bs-gray-200);
  border-radius: 0.375rem;
  background-color: var(--bs-white);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.menu-item:hover {
  background-color: var(--bs-gray-100);
  border-color: var(--bs-gray-800);
}

.menu-item-thumbnail {
  width: var(--thumb-size);
  height: var(--thumb-size);
  object-fit: cover;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.menu-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-dark);
}

.menu-item-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bs-gray-500);
}

.menu-item-arrow {
  font-size: 1.25rem;
  color: var(--bs-gray-500);
}

/* =========================
   SUBMENU
   ========================= */

.submenu-panel {
  position: absolute;
  inset: 0;
  background-color: var(--bs-white);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.submenu-panel.active {
  transform: translateX(0);
}

.submenu-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--bs-gray-200);
}

.submenu-back {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.submenu-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.submenu-body {
  padding: 1rem;
  height: calc(100% - 64px);
  overflow-y: auto;
}

.submenu-main-preview {
  text-align: center;
}

.submenu-main-preview img {
  width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
}

.submenu-main-label {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.875rem;
}

/* =========================
   TILES
   ========================= */

.tile-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0;
}

.tile {
  width: 35%;
  padding: 0.375rem;
  cursor: pointer;
  text-align: center;
}

.tile img {
  padding: 0.25rem;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.tile img:hover {
  border-color: var(--bs-gray-800);
}

.tile.active img {
  border-color: var(--bs-dark);
}

.tile-label {
  font-size: 0.875rem;
  color: var(--bs-gray-800);
}

/* =========================
   BOTÃO
   ========================= */

#save-2render {
  padding: 0.5rem;
  margin: 0.75rem 0.25rem;
  border: none;
  border-radius: 0.375rem;
  background-color: var(--bs-black);
  color: var(--bs-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  font-family: Poppins, sans-serif;
}

#save-2render:hover {
  background-color: var(--bs-dark);
}

.client-logo {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  pointer-events: none; /* evita interferência */
}

.client-logo p {
  margin: 0; /* remove margem padrão do <p> */
  font-size: 1.25rem;
  line-height: 1;
}

/* =========================
   RESPONSIVO (Bootstrap)
   ========================= */

@media (max-width: 1366px) {
  .tile {
    width: 30%;
  }

  #save-2render {
    padding: 0.5rem;
    margin: 0.75rem 0.25rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 992px) {
  .tile {
    width: 25%;
  }

  #menu-elements {
    overflow: auto;
  }
}

@media (max-width: 768px) {
  .ui-container {
    width: 100vw;
    height: 20vh;
    bottom: 0;
    top: auto;
  }

  .submenu-main-preview {
    display: none;
  }

  #menu-elements {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem;
    overflow-x: auto;
  }

  .menu-item {
    width: 100px;
    flex-direction: column;
    border: none;
    margin: 0;
    padding: 0.5rem;
  }

  .menu-item-subtitle,
  .menu-item-arrow {
    display: none;
  }

  .menu-item-title {
    font-size: 0.875rem;
    font-weight: 400;
  }

  .tile-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
    padding: 1rem 0;
  }

  .tile {
    width: 75px;
    height: 75px;
    padding: 0.25rem;
  }

  .tile img {
    width: 100%;
    height: 100%;
  }

  .tile-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 576px) {
  #menu-elements {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .tile {
    gap: 0.5rem;
  }

  .tile-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 1.75rem;
    padding: 1rem 0;
    padding: 0.375rem;
    border: 1px black;
  }

  .tile-label {
    font-size: 0.75rem;
  }
}

/* ======================================================
 * SELETOR DE CENAS - ATUALIZADO
 * ====================================================== */

.scene-selector {
  position: fixed;
  margin: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bs-white);
  border-radius: 0.375rem;
  padding: 0;
  z-index: 1000;
  width: 600px;
  height: 400px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.scene-selector-header {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--bs-black);
}

.scene-selector-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

.scene-selector-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.scene-selector-close:hover {
  opacity: 1;
}

.scene-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 0fr));
  gap: 16px;
  justify-content: center;
  align-content: center;
  height: 100%;
  margin: 0 60px 0 60px;
}

.scene-button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
  width: 80px;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 14px;
  font-family: Poppins, sans-serif;
  text-align: center;
}

.scene-button:last-child {
  margin-bottom: 0;
}

.scene-button:hover {
  background: var(--bs-gray-200);
}

.scene-button.active {
  color: var(--bs-white);
  background: var(--bs-black);
}

/* Scene Toggle Button */
.scene-toggle-btn {
  padding: 0.5rem;
  margin: 0.75rem 0.25rem;
  border: none;
  border-radius: 0.375rem;
  background-color: rgb(12, 12, 12);
  color: var(--bs-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  font-family: Poppins, sans-serif;
}

.scene-toggle-btn:hover {
  background-color: var(--bs-dark);
}

/* ======================================================
 * RENDER 2D MODAL
 * ====================================================== */

.render-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.render-modal-content {
  background: var(--bs-white);
  border-radius: 0.375rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 400px;
}

.render-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgb(0, 0, 0);
}

.render-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: Poppins, sans-serif;
}

.render-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.render-modal-close:hover {
  opacity: 1;
}

.render-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  overflow-y: auto;
}

.render-preview-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 0.375rem;
}

.render-download-btn {
  padding: 12px 30px;
  background: var(--bs-black);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: Poppins, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  transition: background 0.2s;
}

.render-download-btn:hover {
  background: var(--bs-dark);
}

.render-loading {
  padding: 60px 40px;
  color: #fff;
  font-size: 16px;
  text-align: center;
}

.render-loading::after {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 20px auto 0;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.render-error {
  padding: 60px 40px;
  color: #dc3545;
  font-size: 16px;
  text-align: center;
}

/* Layout em grid para detalhes do render */

.render-modal-body-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 2rem;
  padding: 2rem;
  overflow-y: auto;
}

.render-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Especificações técnicas do render */

.specifications-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.spec-icon {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid var(--bs-gray-200);
}

/* Formulário de contato */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-form input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--bs-gray-200);
  border-radius: 0.375rem;
  font-family: Poppins, sans-serif;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.contact-form input:focus {
  outline: none;
  border-color: var(--bs-black);
}

/* Estilização do botão de envio do formulário */

.contact-form button {
  padding: 0.6rem;
  border: none;
  border-radius: 0.375rem;
  background-color: var(--bs-black);
  color: var(--bs-white);
  font-family: Poppins, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contact-form button:hover {
  background-color: var(--bs-dark);
}

/* Botões de compartilhamento */

.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.share-buttons button {
  padding: 0.6rem;
  border: 1px solid var(--bs-gray-200);
  border-radius: 0.375rem;
  background: var(--bs-white);
  color: var(--bs-dark);
  font-family: Poppins, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.share-buttons button:hover {
  background: var(--bs-gray-100);
  border-color: var(--bs-black);
}

/* qr code */

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--bs-gray-200);
  border-radius: 0.375rem;
  background: var(--bs-white);
}

/* ======================================================
 * RESPONSIVO - MODAIS
 * ====================================================== */

@media (max-width: 1024px) {
  .render-modal-body-grid {
    grid-template-columns: 1fr;
  }

  .render-preview-image {
    max-height: 40vh;
  }
}

@media (max-width: 768px) {
  .scene-selector {
    min-width: 280px;
    width: 90vw;
  }

  .render-modal-content {
    min-width: auto;
    width: 95vw;
    max-height: 85vh;
  }

  .render-preview-image {
    max-height: 50vh;
  }

  .scene-toggle-btn {
    font-size: 12px;
  }
}
