/* =========================================
   BASE
========================================= */
.custom-button {
    font-family: 'Cormorant SC', serif;
    font-size: 14px;
    font-weight: 600;
    color: black;
}

/* =========================================
   HOME (DESKTOP)
   - Mantém o comportamento atual do web/PC
========================================= */
@media (min-width: 769px) {
  .home-buttons {
    position: fixed !important;
    left: 50px !important;
    top: 54% !important;
    transform: translateY(-50%) !important;
  }

  .custom-button {
    width: 160px !important;
    height: 80px !important;
  }

  .footer-actions button,
  .footer-actions .btn {
    width: 170px !important;
    height: 34px !important;
  }
}

/* =========================================
   MODAL (DESKTOP/TABLET - como estava)
   - Grande
   - Sem scroll interno
========================================= */
.modal-dialog {
    max-width: 92vw !important;
    width: 92vw !important;
    max-height: 94vh !important;
    margin: 3vh auto !important;
}

.modal-content {
    height: 93vh !important;
    max-height: 93vh !important;
    border-radius: 0 !important;
    background-image: url('/assets/atgpopup.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid rgba(128, 128, 128, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important; /* desktop: sem scroll */
}

.modal-body {
    background-image: url('/assets/atgpopup.png') !important;
    background-size: cover !important;
    background-position: center !important;
    padding: 0 !important;
    overflow: hidden !important; /* desktop: sem scroll */
}

/* Travar o fundo quando modal está aberto */
body.modal-open {
    overflow: hidden !important;
}

/* =========================================
   RADIOS (mantido)
========================================= */
#specific-metrics-checklist input[type="radio"],
#specific-radar-metrics input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(128, 128, 128, 0.5);
    background-color: transparent;
    cursor: pointer;
    position: relative;
}

#specific-metrics-checklist input[type="radio"]:checked,
#specific-radar-metrics input[type="radio"]:checked {
    border-color: white;
    background-color: #4ecdc4;
}

#specific-metrics-checklist input[type="radio"]:checked::after,
#specific-radar-metrics input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4ecdc4;
}

#comp-tech2-metric input[type="radio"],
#comp-phys2-metric input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(128, 128, 128, 0.5);
    background-color: transparent;
    cursor: pointer;
    position: relative;
}

#comp-tech2-metric input[type="radio"]:checked,
#comp-phys2-metric input[type="radio"]:checked {
    border-color: white;
    background-color: #4ecdc4;
}

#comp-tech2-metric input[type="radio"]:checked::after,
#comp-phys2-metric input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4ecdc4;
}

/* =========================================
   BOTAO REDONDO (mantido)
========================================= */
.switch-round-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7b7b, #ff6b6b);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow:
    0 6px 10px rgba(255,107,107,0.35),
    inset 0 2px 4px rgba(255,255,255,0.3),
    inset 0 -3px 6px rgba(0,0,0,0.2);
  transition: all 0.15s ease-in-out;
}

.switch-round-btn:hover {
  filter: brightness(1.08);
  box-shadow:
    0 8px 14px rgba(255,107,107,0.45),
    inset 0 2px 4px rgba(255,255,255,0.4),
    inset 0 -3px 6px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.switch-round-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 4px 8px rgba(255,107,107,0.3),
    inset 0 3px 5px rgba(0,0,0,0.25);
}

.switch-round-btn i {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

/* =========================================
   LINKLIKE (mantido)
========================================= */
.linklike-btn {
  background: none;
  border: none;
  padding: 0;
  color: #61dafb;
  text-decoration: underline;
  cursor: pointer;
}
.linklike-btn:hover { filter: brightness(1.1); }

.handle-label {
    background-color: transparent !important;
}

/* =========================================
   MODEBAR (mantido)
========================================= */
.modebar { background: transparent !important; }
.modebar-group { background: transparent !important; }
.modebar-btn { background: transparent !important; }
.modebar-btn rect { fill: transparent !important; }
.modebar-btn.active rect { fill: transparent !important; }
.modebar-btn:hover rect { fill: rgba(255, 255, 255, 0.08) !important; }

/* =========================================
   MOBILE (ate 768px)
   - HOME realmente responsivo
   - (mantem suas regras atuais de modal mobile mais abaixo)
========================================= */
@media (max-width: 768px) {

  /* HOME: deixa o layout respirar (sem centralizacao matematica) */
  .home-root {
    justify-content: flex-start !important;
    padding-bottom: 0 !important;
    /* altura mais correta em celulares modernos (quando suportado) */
    min-height: 100svh !important;
  }

  /* Fundo mobile (se existir) */
  .home-root {
    background-image: url('/assets/fundo_mobile.png') !important;
    background-size: cover !important;
    background-position: top left !important;
    background-repeat: no-repeat !important;
    padding-top: calc(10px + env(safe-area-inset-top)) !important;
  }

  /* Coluna de botoes: fluxo normal + espacos adaptativos */
  .home-buttons {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;

    align-items: center !important;
    gap: clamp(10px, 1.8vh, 16px) !important;

    /* distancias topo/base (meio-termo para varios aparelhos) */
    padding-top: clamp(70px, 12vh, 80px) !important;
    padding-bottom: clamp(120px, 18vh, 180px) !important;
  }

  /* Botoes: um pouco mais estreitos e com limites */
  .custom-button {
    width: clamp(190px, 58vw, 240px) !important; /* mais estreito que 85vw */
    height: clamp(64px, 9vh, 74px) !important;
    padding: 10px 10px !important;
    font-size: clamp(13px, 1.8vw, 14px) !important;
  }

  /* Rodape: empilhado e sempre legivel */
  .footer-actions {
    flex-direction: column !important;
    gap: 10px !important;
    bottom: clamp(14px, 2.8vh, 22px) !important;
  }

  .footer-actions button,
  .footer-actions .btn {
    width: clamp(200px, 65vw, 260px) !important;
    height: 38px !important;
  }

  /* Desce levemente a coluna de botões de escolha dos modais */
   /* REDUZ o piso que impede os botões de subir */
  .home-root {
    padding-top: clamp(6px, 4vh, 40px) !important;
  }

  /* Agora o margin-top funciona de verdade */
  .home-buttons {
    margin-top: clamp(0px, 5vh, 40px) !important;
  }

  .home-buttons {
    top: auto !important;
    position: relative !important;
  }

  /* Sobe o bloco de botões do rodapé */
  .footer-actions {
    bottom: 56px !important;  /* antes ~44px */
  }

  /* =========================================
     MODAL MOBILE (mantendo sua configuracao atual)
     - sem scroll vertical
     - scroll horizontal
  ========================================= */

  /* trava fundo */
  body.modal-open,
  body.modal-open #react-entry-point {
    overflow: hidden !important;
    height: 100% !important;
  }
  body.modal-open {
    overflow: hidden !important;
    height: 100% !important;
  }

  /* altura um pouco menor + folga maior */
  .modal-dialog {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 6vh auto !important;
    max-height: 88vh !important;
  }

  .modal-content {
    height: 88vh !important;
    max-height: 88vh !important;
    overflow: hidden !important;
  }

  .modal-body,
  .modal-dialog .modal-content .modal-body {
    overflow-y: hidden !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 88vh !important;
    white-space: nowrap !important;
  }

  .modal-body > * {
    display: inline-block !important;
    vertical-align: top !important;
    width: max-content !important;
    max-width: none !important;
    white-space: normal !important;
  }

  .modal-body .row,
  .modal-body .dbc-row,
  .modal-body .dash-row {
    flex-wrap: nowrap !important;
  }
}

/* =========================================
   DESKTOP LOCK (>= 769px)
   Garante que o "Powered by" fique centralizado no desktop
   (evita regressao visual)
========================================= */
@media (min-width: 769px) {
  .powered-by {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 10px !important;
    width: auto !important;
    text-align: center !important;
    z-index: 1000 !important;
  }
}

/* Destaque dos botões de ação principais (rodapé) */
.footer-actions button {
  background-color: #13543b !important;
  border: 1px solid #c0c0c0 !important;
  color: #ffffff !important;
}

/* Hover sutil (desktop) */
@media (hover: hover) {
  .footer-actions button:hover {
    filter: brightness(1.08);
  }
}



/* === MODAL 1 ONLY: RESPONSIVE STACK (mobile) === */
@media (max-width: 768px) {
  /* Mantém a HOME como está (não toca) e altera APENAS o Modal 1 */
  #modal-1 .modal-body,
  #modal-1 .modal-dialog .modal-content .modal-body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: normal !important;
  }

  /* Conteúdo interno do Modal 1 volta a ocupar a largura e pode empilhar */
  #modal-1 .modal-body > * {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Grid do Bootstrap/Dash pode quebrar linha (empilhar) */
  #modal-1 .modal-body .row,
  #modal-1 .modal-body .dbc-row,
  #modal-1 .modal-body .dash-row {
    flex-wrap: wrap !important;
  }

  /* Evita que graphs/tabelas estourem a largura no mobile */
  #modal-1 .dash-graph,
  #modal-1 .js-plotly-plot,
  #modal-1 .dash-table-container,
  #modal-1 .dash-spreadsheet-container {
    max-width: 100% !important;
  }

  /* Se algum bloco estiver forçando largura grande, corta e não cria scroll lateral */
  #modal-1-body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}


