/* ============================================================================
   FORJA3D — WEB APP PWA STYLES (CATÁLOGO, BUSCADOR PT↔EN, CALCULADORA, KANBAN)
   ============================================================================ */

body.app-body {
  background: var(--bg-soft);
  min-height: 100vh;
  padding-bottom: 84px;
}

@media (min-width: 900px) {
  body.app-body { padding-bottom: 32px; }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-nav-desktop {
  display: none;
  gap: 6px;
}

@media (min-width: 900px) {
  .app-nav-desktop { display: flex; }
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover { background: var(--brand-soft); color: var(--brand); }
.tab-btn.active { background: var(--ink); color: #fff; }

/* Bottom Nav Mobile (experiência de App nativo PWA) */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  box-shadow: 0 -8px 24px -10px rgba(23, 19, 44, 0.15);
}

@media (min-width: 900px) {
  .app-bottom-nav { display: none; }
}

.bnav-btn {
  border: 0;
  background: transparent;
  padding: 7px 4px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.bnav-btn span.ico { font-size: 18px; line-height: 1; }
.bnav-btn.active { background: var(--brand-soft); color: var(--brand-2); }

/* Área Principal */
.app-main {
  padding: 24px 0 40px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeTab 0.2s ease; }
@keyframes fadeTab { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.panel-header h1 { font-size: clamp(24px, 4vw, 32px); }
.panel-header p { font-size: 14.5px; color: var(--ink-2); margin-top: 4px; }

/* Barra de busca + STL Dropzone */
.app-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

@media (min-width: 780px) {
  .app-toolbar { grid-template-columns: 1fr auto; align-items: center; }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}

.search-input-wrap:focus-within { border-color: var(--brand); }

.search-input-wrap input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

.stl-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  border: 0;
  box-shadow: var(--shadow-brand);
}

/* Grid da Biblioteca no App */
.app-models-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .app-models-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .app-models-grid { grid-template-columns: repeat(3, 1fr); }
}

.model-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, border-color 0.16s;
}

.model-card:hover { transform: translateY(-3px); border-color: var(--brand); }

.model-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.model-card h3 { font-size: 17px; }
.model-card p { font-size: 13px; color: var(--ink-2); flex: 1; }

.model-specs-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--ink-2);
}

.model-specs-mini span {
  background: var(--bg-soft);
  padding: 4px 8px;
  border-radius: 8px;
}

.model-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.mbtn {
  padding: 9px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.mbtn:hover { border-color: var(--brand); color: var(--brand); }
.mbtn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.mbtn.green { background: var(--green-soft); border-color: rgba(16, 185, 129, 0.4); color: #065f46; }

/* Super-Buscador PT-BR <-> EN */
.search-hero-box {
  background: linear-gradient(145deg, #17132c, #2d1b7a);
  color: #fff;
  border-radius: 24px;
  padding: 26px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
}

.search-translated-bar {
  margin-top: 14px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.search-translated-bar code {
  font-family: var(--font-mono);
  color: #6ee7b7;
  font-weight: 700;
  font-size: 14px;
}

.repo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) { .repo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .repo-grid { grid-template-columns: repeat(3, 1fr); } }

.repo-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.repo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.repo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Calculadora de Lucro Shopee/ML */
.calc-layout {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .calc-layout { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}

.card-white {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 5px;
}

.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}

.calc-summary {
  background: linear-gradient(160deg, #17132c, #241757);
  color: #fff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.calc-big-profit {
  text-align: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(16, 185, 129, 0.16);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  margin-bottom: 16px;
}

.calc-big-profit small { display: block; font-size: 12px; color: #6ee7b7; text-transform: uppercase; font-weight: 800; }
.calc-big-profit b { display: block; font-family: var(--font-display); font-size: 42px; color: #34d399; line-height: 1.05; margin: 4px 0; }

.calc-breakdown {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.calc-breakdown div {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.goal-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(91, 61, 245, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.35);
  font-size: 13.5px;
}

/* Kanban de Fila de Impressão */
.kanban-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kstat {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}

.kstat b { display: block; font-family: var(--font-display); font-size: 22px; color: var(--brand); }
.kstat span { font-size: 12px; color: var(--ink-2); font-weight: 600; }

.kanban-add-form {
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 18px;
}

@media (min-width: 760px) {
  .kanban-add-form { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
}

.kanban-board {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 820px) {
  .kanban-board { grid-template-columns: repeat(4, 1fr); }
}

.kanban-col {
  background: #efedf8;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.kanban-count {
  background: #fff;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--brand);
}

.kanban-item {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-item h4 { font-size: 14px; }
.kanban-item small { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }

.kanban-item-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.kbtn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.kbtn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.kbtn.del:hover { background: var(--rose); border-color: var(--rose); }

/* Modal Visualizador 3D do App */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(11, 9, 22, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 16px;
}

.app-modal-backdrop.open { display: grid; }

.app-viewer-modal {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 26px;
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-lg);
  display: grid;
}

@media (min-width: 780px) {
  .app-viewer-modal { grid-template-columns: 1.3fr 0.7fr; }
}

.app-viewer-canvas-wrap {
  position: relative;
  min-height: 340px;
  background: #0b0916;
}

.app-viewer-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  min-height: 340px;
  cursor: grab;
}

/* ============================================================================
   THINGIVERSE ACERVO INFINITO (+2,5M STLs) & 24 COLEÇÕES
   ============================================================================ */
.tv-search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.tv-select {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}

.tv-live-section {
  margin: 22px 0 28px;
}

.tv-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tv-results-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.tv-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s;
}

.tv-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tv-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  background: #f1f5f9;
  display: block;
}

.tv-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tv-card-body h3 {
  font-size: 15px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tv-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.tv-setup-box {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f5f3ff 0%, #ecfdf5 100%);
  border: 1.5px dashed var(--brand);
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tv-collections-section {
  margin-top: 26px;
}

.tv-collections-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.tv-col-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s;
}

.tv-col-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.tv-col-card h3 {
  font-size: 15.5px;
  line-height: 1.3;
}

.tv-col-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.tv-promo-banner {
  margin-top: 24px;
  background: linear-gradient(135deg, #16122c 0%, #2b1f63 100%);
  color: #fff;
  border-radius: 22px;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.tv-promo-banner p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
}

/* ============================================================================
   ESTÚDIO DE CRIAÇÃO 3D COM IA (HI3D.AI + MAKERLAB + MESHY + TRIPO)
   ============================================================================ */
.ai-studio-box {
  margin-top: 34px;
  background: linear-gradient(135deg, #120f29 0%, #24195e 60%, #0f2922 100%);
  border: 1.5px solid rgba(167, 139, 250, 0.35);
  border-radius: 26px;
  padding: 28px 24px;
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.ai-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.ai-form-grid input[type="text"] {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.ai-prompt-output {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
}
