/**
 * Speak & Trade • UI Updates & Mobile Refinements (ui_updates.css)
 * Acabamento Visual Uniforme • Ícones Vetoriais SVG • Botão Conversar com Glow
 * Player In-App 9:16 Shorts • Zero Custo
 * dp idiomas • Fluência que Conecta
 */

/* 1. Topo Executivo Limpo (Sem "2.0", Sem Botão Global de Velocidade, Sem Encavalar) */
.app-header-v2 {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 20, 41, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 235, 255, 0.12);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.header-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.header-text-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.header-brand-sub {
  font-size: 0.68rem;
  color: #0799B8;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Botão Meu Repertório em Rubi */
.btn-meu-repertorio {
  background: #D91B26 !important;
  color: #FFFFFF !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(217, 27, 38, 0.3);
}

.btn-meu-repertorio:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-menu-drawer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-menu-drawer:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* 2. Barra Inferior Oficial & Botão Central de IA com Glow Âmbar */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(11, 20, 41, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px 14px 12px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #94A3B8;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: #0799B8;
}

/* Botão Central 'Conversar' com Glow Estilo Speak & Travel */
.bottom-nav-ai-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: -20px;
  text-decoration: none;
  cursor: pointer;
}

.ai-travel-btn-glow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #111A2E;
  border: 2px solid #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transition: all 0.25s ease;
}

.bottom-nav-ai-center:hover .ai-travel-btn-glow {
  box-shadow: 0 0 26px rgba(245, 158, 11, 0.7);
  transform: translateY(-2px);
  border-color: #FBBF24;
}

.ai-travel-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #F59E0B;
  letter-spacing: 0.02em;
}

/* 3. Ícones Vetoriais Executivos (Nano Banana Factory Standard) */
.icon-flag-3d {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.icon-flag-3d:hover {
  transform: scale(1.1);
}

.icon-exec {
  display: inline-block;
  vertical-align: middle;
}

.icon-dash {
  display: inline-block;
  vertical-align: middle;
}

.icon-metric {
  display: inline-block;
  vertical-align: middle;
}

/* 4. Padronização Absoluta de Botões nos Cards (Acabamento Homogêneo) */
.phrase-card-v2 {
  background: #111A2E !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.phrase-card-v2 .step-btn {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #CBD5E1 !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  padding: 10px 12px !important;
  transition: all 0.15s ease !important;
}

.phrase-card-v2 .step-btn:hover {
  background: rgba(51, 65, 85, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.phrase-card-v2 .step-btn.btn-listen {
  color: #38BDF8 !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.phrase-card-v2 .step-btn.btn-speed {
  color: #FBBF24 !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

.phrase-card-v2 .step-completed {
  background: rgba(7, 153, 184, 0.18) !important;
  border-color: #0799B8 !important;
  color: #38BDF8 !important;
}

/* 5. Moldura In-App 9:16 Shorts de Smartphone (Zero Custo) */
.inapp-shorts-frame {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9/16;
  background: #000000;
  border-radius: 28px;
  border: 2px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   6. ACESSIBILIDADE WCAG AA & PADDING SEGURO INFERIOR (QA FIX #12 & #13)
   ========================================================================= */
main#main-content {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

.view-container {
  padding-bottom: 2rem !important;
}

/* Alto contraste para badges e microcopy em fundo escuro */
.text-slate-400 {
  color: #CBD5E1 !important; /* Elevado de #94A3B8 para #CBD5E1 para contraste >= 4.5:1 */
}

.text-slate-500 {
  color: #94A3B8 !important;
}

.bg-white\/5 {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.bg-surface-card {
  background-color: #15223E !important;
}


/* =========================================================================
   7. GLOBAL SCROLL UNLOCK & TOUCH MOMENTUM (DESKTOP EDGE/CHROME & MOBILE)
   ========================================================================= */
html, body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  -webkit-overflow-scrolling: touch !important;
}

#main-content {
  overflow: visible !important;
  min-height: calc(100vh - 120px) !important;
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 16px)) !important;
}

.view-container {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  padding-bottom: 3.5rem !important;
}

/* =========================================================================
   8. PORTAL EMBLEMS & ACTION ICONS: 100% CIRCULAR CLIPPED (NO WHITE SQUARES)
   ========================================================================= */
.portal-emblem,
.portal-emblem img,
.action-card-icon,
.action-card-icon img {
  border-radius: 50% !important;
  -webkit-border-radius: 50% !important;
  overflow: hidden !important;
  clip-path: circle(50% at 50% 50%) !important;
  -webkit-clip-path: circle(50% at 50% 50%) !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* =========================================================================
   9. GLOSSÁRIO EXECUTIVO: CHIPS DE CATEGORIA, TOGGLE & CARTÕES UNIFORMES
   ========================================================================= */
.glossary-categories-grid-modal {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

.cat-grid-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 16px !important;
  border-radius: 12px !important;
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #CBD5E1 !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  user-select: none !important;
}

.cat-grid-chip:hover {
  background: rgba(51, 65, 85, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px) !important;
}

.cat-grid-chip.active {
  background: #D97706 !important;
  border-color: #F59E0B !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45) !important;
}

.glossary-view-toggle {
  display: inline-flex !important;
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 3px !important;
  gap: 4px !important;
}

.view-btn {
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #94A3B8 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.view-btn:hover {
  color: #FFFFFF !important;
}

.view-btn.active {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
}

.btn-pt-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 12px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94A3B8 !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-pt-toggle:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #FBBF24 !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

/* DESTAQUE NÍTIDO DE ABA ATIVA NA BARRA INFERIOR (BUG #3 FIX) */
.bottom-nav-item.active {
  color: #38BDF8 !important;
  font-weight: 800 !important;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}

.bottom-nav-item.active span:first-child {
  transform: scale(1.2) !important;
  display: inline-block !important;
  transition: transform 0.2s ease !important;
}

/* MARGEM INFERIOR EXPANDIDA CONTRA SOBREPOSIÇÃO (BUG #12 FIX) */
main#main-content {
  padding-bottom: calc(8rem + env(safe-area-inset-bottom, 32px)) !important;
}

.view-container {
  padding-bottom: calc(6rem + env(safe-area-inset-bottom, 24px)) !important;
}
