/* ==========================================================================
   LAYOUT ESCURO MODERNO — DESIGN RESPONSIVO MOBILE / TABLET / DESKTOP
   Fiel às imagens de referência: GCP-ACE Associate Cloud Engineer
   ========================================================================== */

/* Container Principal e Reset Base */
:root {
  --hub-bg: #101114;
  --hub-surface: #222328;
  --hub-surface-hover: #2C2D34;
  --hub-border: #38393F;
  --hub-green: #22C55E;
  --hub-green-vibrant: #22C55E;
  --hub-green-dark: #16A34A;
  --hub-orange: #F97316;
  --hub-orange-dark: #EA580C;
  --hub-blue: #2563EB;
  --hub-blue-light: #3B82F6;
  --hub-magenta: #E11D48;
  --hub-teal: #14B8A6;
  --hub-purple: #8B5CF6;
  --hub-white: #FFFFFF;
  --hub-text-dark: #101114;
  --hub-radius-card: 18px;
  --hub-radius-tile: 14px;
  --hub-radius-pill: 9999px;
  --hub-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

/* Enquadramento Responsivo */
#app {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--hub-bg);
  color: var(--hub-white);
  box-sizing: border-box;
}

body {
  background-color: #101114 !important;
  color: #FFFFFF !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ==========================================================================
   OCULTAR BARRA ANTIGA DE ABAS NO TOPO DOS CARDS (PONTO 2)
   ========================================================================== */
.tabs-wrap,
nav.tabs-wrap {
  display: none !important;
}

/* ==========================================================================
   1. CABEÇALHO COMPACTO (APP BAR)
   ========================================================================== */
.app-header-v2 {
  background: #18191D !important;
  border-bottom: 1px solid var(--hub-border) !important;
  padding: 12px 16px !important;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-brand-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.app-logo-v2 {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.app-title-block-v2 {
  display: flex;
  flex-direction: column;
}

.app-title-v2 {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.15;
}

.gcp-ace-title-v2 {
  color: #22C55E !important;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.3px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.btn-info-circle {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: #FFFFFF;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.15s, border-color 0.15s;
}

.btn-info-circle:hover {
  transform: scale(1.1);
  border-color: #FFFFFF;
  color: #22C55E;
}

.app-subtitle-v2 {
  color: #9A9AA0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

/* Ações do Topo */
.header-actions-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hdr-action-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  border: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FFFFFF;
  transition: all 0.15s ease;
  padding: 0;
}

.hdr-btn-calendar {
  background: var(--hub-blue) !important;
  border-color: #1D4ED8 !important;
}

.hdr-btn-calendar:hover {
  background: #1D4ED8 !important;
  transform: translateY(-1px);
}

.hdr-btn-search,
.hdr-btn-settings {
  background: #222328 !important;
  border-color: #38393F !important;
}

.hdr-btn-search:hover,
.hdr-btn-settings:hover {
  background: #2C2D34 !important;
  border-color: #6E6E74 !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   2. BADGE EM PÍLULA BRANCA COM TEXTO ESCURO (IDENTIDADE DAS FOTOS)
   ========================================================================== */
.hub-badge-pill {
  background: #FFFFFF !important;
  color: #101114 !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  line-height: 1 !important;
  padding: 5px 12px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  letter-spacing: -0.1px !important;
  border: none !important;
}

/* ==========================================================================
   3. HERO GRID — DOIS CARDS COM CORES VIVAS GARANTIDAS (PONTO 1)
   ========================================================================== */
.hub-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 14px 0 16px;
}

.hub-hero-card {
  position: relative;
  min-height: 148px;
  border-radius: var(--hub-radius-card) !important;
  padding: 16px;
  border: none !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.hub-hero-card:active {
  transform: scale(0.98);
}

/* Card Verde: Guia de Estudo */
html button.hub-hero-card.card-study,
html .hub-hero-card.card-study,
button.card-study,
.card-study {
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%) !important;
  background-color: #22C55E !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.45) !important;
  color: #FFFFFF !important;
}

button.hub-hero-card.card-study:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.6) !important;
}

/* Card Laranja: FlashCards */
html button.hub-hero-card.card-flash,
html .hub-hero-card.card-flash,
button.card-flash,
.card-flash {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%) !important;
  background-color: #F97316 !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.45) !important;
  color: #FFFFFF !important;
}

button.hub-hero-card.card-flash:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.6) !important;
}

.card-corner-icon {
  position: absolute;
  top: 14px;
  left: 14px;
  color: #FFFFFF !important;
  opacity: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-corner-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  color: #FFFFFF !important;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-labels-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: auto;
}

/* ==========================================================================
   4. PÍLULAS DE ACESSO RÁPIDO (CHIPS EM 2 LINHAS)
   ========================================================================== */
.hub-pills-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.hub-pills-row {
  display: grid;
  gap: 8px;
}

.hub-pills-row.row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.hub-pills-row.row-2 {
  grid-template-columns: repeat(2, 1fr);
}

.hub-pill-btn {
  background: #222328 !important;
  border: 1px solid var(--hub-border) !important;
  border-radius: var(--hub-radius-tile) !important;
  padding: 10px 12px !important;
  color: #FFFFFF !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}

.hub-pill-btn:hover {
  background: var(--hub-surface-hover) !important;
  border-color: #6E6E74 !important;
  transform: translateY(-1px);
}

.hub-pill-btn .pill-icon {
  font-size: 15px;
  line-height: 1;
}

.hub-pill-btn .pill-badge-inline {
  padding: 4px 10px !important;
  font-size: 10.5px !important;
}

/* ==========================================================================
   5. SEÇÃO PRÁTICA (HUB DE FERRAMENTAS COM ÍCONES COLORIDOS)
   ========================================================================== */
.hub-section-block {
  margin-bottom: 20px;
}

.hub-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hub-sec-bar {
  color: var(--hub-green);
  font-weight: 900;
  font-size: 18px;
}

.hub-sec-expand {
  color: var(--hub-green);
  font-size: 16px;
  font-weight: 800;
}

.hub-sec-title {
  color: #FFFFFF;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.hub-quiz-count {
  background: rgba(34, 197, 94, 0.2);
  color: var(--hub-green);
  border: 1px solid var(--hub-green);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

/* Grid de Prática Mobile (3 no topo + 2 embaixo) */
.hub-practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.practice-tile {
  background: #222328 !important;
  border: 1px solid var(--hub-border) !important;
  border-radius: var(--hub-radius-tile) !important;
  padding: 10px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 48px;
}

.practice-tile:hover {
  background: var(--hub-surface-hover) !important;
  border-color: #6E6E74 !important;
  transform: translateY(-1px);
}

/* Caixas coloridas de ícone */
.tile-icon-box {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.tile-icon-box.box-green {
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid var(--hub-green);
}

.tile-icon-box.box-magenta {
  background: rgba(225, 29, 72, 0.22);
  border: 1px solid var(--hub-magenta);
}

.tile-icon-box.box-teal {
  background: rgba(20, 184, 166, 0.22);
  border: 1px solid var(--hub-teal);
}

.tile-icon-box.box-blue {
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid var(--hub-blue);
}

.practice-tile .tile-badge {
  padding: 4px 8px !important;
  font-size: 10.5px !important;
}

/* ==========================================================================
   6. BANNER EM LARGURA TOTAL: BACKUP E RESTAURAÇÃO (PONTO 1)
   ========================================================================== */
html button.hub-backup-banner,
html .hub-backup-banner,
button.hub-backup-banner,
.hub-backup-banner {
  width: 100%;
  min-height: 56px;
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%) !important;
  background-color: #22C55E !important;
  border: none !important;
  border-radius: var(--hub-radius-card) !important;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 18px 0 22px;
  padding: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.hub-backup-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.55) !important;
}

.hub-backup-banner:active {
  transform: scale(0.98);
}

.hub-backup-banner .banner-badge {
  font-size: 12px !important;
  padding: 6px 18px !important;
}

/* ==========================================================================
   7. LISTA DE QUIZ SETS (PRACTICE SETS)
   ========================================================================== */
.hub-quiz-sets-list {
  display: grid;
  gap: 10px;
}

.hub-quiz-card {
  background: #222328 !important;
  border: 1px solid var(--hub-border) !important;
  border-radius: var(--hub-radius-tile) !important;
  padding: 14px 16px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: #FFFFFF;
}

.hub-quiz-card:hover {
  background: var(--hub-surface-hover) !important;
  border-color: var(--hub-green) !important;
  transform: translateX(2px);
}

.hub-quiz-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-quiz-num-badge {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.2);
  border: 1.5px solid var(--hub-green);
  color: var(--hub-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.hub-quiz-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-quiz-title {
  font-weight: 800;
  font-size: 14px;
  color: #FFFFFF;
}

.hub-quiz-subtitle {
  font-size: 11.5px;
  color: #9A9AA0;
}

.hub-quiz-action-icon {
  color: var(--hub-green);
  font-size: 16px;
  opacity: 0.8;
}

/* ==========================================================================
   8. MODAIS AUXILIARES
   ========================================================================== */
.hub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.2s;
}

.hub-modal-overlay.hidden {
  display: none !important;
}

.hub-modal-card {
  background: #1E1F24 !important;
  border: 1px solid var(--hub-border) !important;
  border-radius: var(--hub-radius-card) !important;
  padding: 22px 20px !important;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  color: #FFFFFF !important;
}

.hub-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hub-border);
  padding-bottom: 10px;
}

.hub-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.hub-modal-close {
  background: transparent;
  border: none;
  color: #B8B8BE;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.hub-modal-close:hover {
  color: #FFFFFF;
}

/* ==========================================================================
   9. ADAPTAÇÕES RESPONSIVAS (TABLET E DESKTOP)
   ========================================================================== */
@media (min-width: 641px) {
  .hub-practice-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .hub-quiz-sets-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 881px) {
  .hub-practice-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .hub-quiz-sets-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .hub-hero-card {
    min-height: 155px;
  }
}

/* Botão de Retorno ao Início */
.hub-back-to-home {
  display: none;
  align-items: center;
  gap: 8px;
  background: #222328;
  border: 1px solid var(--hub-green);
  color: var(--hub-green);
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin: 10px 0;
  transition: all 0.15s ease;
}

.hub-back-to-home:hover {
  background: rgba(34, 197, 94, 0.15);
}

.hub-back-to-home.visible {
  display: inline-flex;
}

/* ==========================================================================
   SUPORTE ADICIONAL AO MODO CLARO (QUANDO SELECIONADO EM CONFIGURAÇÕES)
   ========================================================================== */
html[data-theme="light"] {
  --hub-bg: #F4F7FB;
  --hub-surface: #FFFFFF;
  --hub-surface-hover: #EDF4FB;
  --hub-border: #D9E3EE;
  --hub-text-dark: #172437;
}

html[data-theme="light"] body {
  background-color: #F4F7FB !important;
  color: #172437 !important;
}

html[data-theme="light"] #app {
  background: #F4F7FB !important;
  color: #172437 !important;
}

html[data-theme="light"] .app-header-v2 {
  background: #FFFFFF !important;
  border-bottom: 1px solid #D9E3EE !important;
}

html[data-theme="light"] .app-subtitle-v2 {
  color: #4D6075 !important;
}

html[data-theme="light"] .hdr-btn-search,
html[data-theme="light"] .hdr-btn-settings {
  background: #F1F5F9 !important;
  color: #172437 !important;
  border-color: #CBD5E1 !important;
}

html[data-theme="light"] .hub-pill-btn,
html[data-theme="light"] .practice-tile,
html[data-theme="light"] .hub-quiz-card {
  background: #FFFFFF !important;
  border-color: #D9E3EE !important;
  color: #172437 !important;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.06) !important;
}

html[data-theme="light"] .hub-quiz-title,
html[data-theme="light"] .hub-sec-title {
  color: #172437 !important;
}

html[data-theme="light"] .hub-modal-card {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #172437 !important;
}

html[data-theme="light"] .hub-modal-title {
  color: #172437 !important;
}

/* ==========================================================================
   OCULTAÇÃO DE SEÇÕES LEGADAS REDUNDANTES NO INÍCIO (TAB 1)
   ========================================================================== */
#tab1 > section.main-dashboard,
#tab1 > #secao-plano:not(.active),
#tab1 > #relatorio-avancado:not(.active),
#notifSectionInicio,
#backupSectionInicio {
  display: none !important;
}
