/**
 * PHM Tech — PHM Open Source (CSS Oficial & Otimizado)
 * Padrão Microsoft Fluent · Navegação por Abas Principais & Busca Rápida
 * Prof. Paulo Henrique Maciel · PHM Tech
 */

/* ==========================================================================
   1. SEÇÕES PRINCIPAIS & CONTROLE DE VISUALIZAÇÃO POR ABAS
   ========================================================================== */

.os-main-app {
  display: block;
  width: 100%;
}

/* Seção Hero Superior (Fundo Padrão) */
.os-section-hero {
  background: var(--bg);
  padding: 2.5rem 0 2rem 0;
  border-bottom: 1px solid var(--line);
}

/* Seções de Conteúdo Exclusivo */
.os-main-tab-view {
  display: none;
  width: 100%;
}

.os-main-tab-view.active {
  display: block;
}

/* Seção Laboratório de SO (Superfície Alternada) */
.os-section-lab {
  background: var(--surface-soft);
  padding: 2.5rem 0 4rem 0;
  min-height: 550px;
}

/* Seção Algoritmos (Superfície Alternada) */
.os-section-algorithms {
  background: var(--surface-soft);
  padding: 2.5rem 0 4.5rem 0;
  min-height: 550px;
}

/* ==========================================================================
   2. HERO PRINCIPAL & NAVEGAÇÃO DE ALTO NÍVEL
   ========================================================================== */

.os-master-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.os-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.22);
  color: var(--teal);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

[data-theme="dark"] .os-hero-badge {
  color: var(--teal-light);
  background: rgba(13, 148, 136, 0.14);
  border-color: rgba(45, 212, 191, 0.3);
}

.os-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.os-hero-highlight {
  color: var(--teal);
}

[data-theme="dark"] .os-hero-highlight {
  color: var(--teal-light);
}

.os-hero-lead {
  font-size: 1.02rem;
  color: var(--text-soft);
  max-width: 760px;
  margin: 0 auto 1.75rem auto;
  line-height: 1.6;
}

/* Barra de Abas Principais (Modo de Estudo) */
.os-mode-switcher-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.os-mode-btn {
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--navy);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.os-mode-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.os-mode-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

[data-theme="dark"] .os-mode-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

/* ==========================================================================
   3. SEÇÃO DO LABORATÓRIO DE SO (COM SUB-ABAS DE BANCADAS)
   ========================================================================== */

.os-section-header {
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.os-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.badge-green {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}

.badge-blue {
  background: rgba(8, 145, 178, 0.1);
  border: 1px solid rgba(8, 145, 178, 0.3);
  color: #0891b2;
}

.os-section-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}

.os-section-desc {
  color: var(--text-soft);
  font-size: 0.92rem;
  max-width: 820px;
  line-height: 1.5;
  margin: 0.35rem 0 0 0;
}

/* Sub-abas de Bancadas de SO */
.os-workbench-tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.os-workbench-tab-btn {
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--navy);
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all var(--transition);
}

.os-workbench-tab-btn:hover {
  border-color: #059669;
  color: #059669;
}

.os-workbench-tab-btn.active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.os-workbench-view {
  display: none;
}

.os-workbench-view.active {
  display: block;
}

/* Card da Bancada Ativa */
.os-lab-workbench {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 6px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.os-workbench-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--surface-soft);
  flex-wrap: wrap;
}

.os-workbench-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.os-workbench-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.os-workbench-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 0.15rem 0;
}

.os-workbench-subtitle {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0;
}

.os-workbench-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.os-workbench-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 992px) {
  .os-workbench-body {
    grid-template-columns: 1fr;
  }
}

.os-workbench-interactive {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.os-workbench-theory {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theory-section-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theory-text {
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0;
}

.theory-formula-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.78rem;
  color: var(--navy);
  line-height: 1.5;
}

.theory-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.55;
}

/* Simulador UI Controls */
.sim-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.3rem;
  display: block;
}

.sim-select,
.sim-input {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--navy);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
}

.sim-select:focus,
.sim-input:focus {
  border-color: #0891b2;
}

.sim-form-group {
  display: flex;
  gap: 0.85rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.sim-proc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.sim-proc-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  text-align: center;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sim-proc-item strong {
  font-family: var(--font-heading);
  color: var(--navy);
}

.sim-proc-item span {
  font-size: 0.7rem;
  color: var(--text-soft);
}

.sim-proc-p1 { border-top: 3px solid #0284c7; }
.sim-proc-p2 { border-top: 3px solid #059669; }
.sim-proc-p3 { border-top: 3px solid #d97706; }
.sim-proc-p4 { border-top: 3px solid #9333ea; }

.sim-algo-dynamic-insight {
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--navy);
  line-height: 1.45;
}

.sim-log-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

.sim-log-header {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.sim-log-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.76rem;
  color: var(--text-soft);
  max-height: 110px;
  overflow-y: auto;
  line-height: 1.45;
}

/* Gráfico de Gantt */
#gantt-chart-container {
  display: flex;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  height: 44px;
  background: var(--surface-soft);
}

.gantt-block {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
  position: relative;
  transition: opacity var(--transition);
  border-right: 1px solid rgba(255,255,255,0.25);
}

.gantt-block:hover {
  opacity: 0.9;
}

/* Console de 8 Bits */
.bits-hardware-console {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bits-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--navy);
}

.bits-switches-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.45rem;
}

.bit-switch-cell {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.2rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition);
  user-select: none;
}

.bit-switch-cell:hover {
  border-color: #d97706;
}

.bit-switch-cell.on {
  background: rgba(217, 119, 6, 0.12);
  border-color: #d97706;
}

.bit-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
  transition: all var(--transition);
}

.bit-switch-cell.on .bit-led {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b, 0 0 4px #d97706;
}

.bit-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--navy);
}

.bit-weight {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-soft);
}

.bits-converters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.bit-conv-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
}

.bit-conv-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
}

.bit-conv-num {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--navy);
}

/* ==========================================================================
   4. SEÇÃO DOS 27 ALGORITMOS (COM BUSCA INSTANTÂNEA & CARDS COMPACTOS)
   ========================================================================== */

/* Barra de Filtros & Busca Instantânea */
.os-algo-toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.os-algo-search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.os-algo-search-input {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
}

.os-algo-search-input:focus {
  border-color: #0891b2;
}

.os-algo-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

/* Sub-abas de Categorias de Algoritmos */
.os-subtabs-nav {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.os-subtab-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--navy);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all var(--transition);
}

.os-subtab-btn:hover {
  border-color: #0891b2;
  color: #0891b2;
}

.os-subtab-btn.active {
  background: #0891b2;
  border-color: #0891b2;
  color: #ffffff;
}

/* Guia Notação Big-O Compacto */
.bigo-explainer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.bigo-explainer-title {
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--navy);
}

.bigo-pill-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.bigo-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.bigo-pill-c1 { background: rgba(16, 185, 129, 0.1); color: #059669; border-color: rgba(16, 185, 129, 0.3); }
.bigo-pill-logn { background: rgba(6, 182, 212, 0.1); color: #0891b2; border-color: rgba(6, 182, 212, 0.3); }
.bigo-pill-n { background: rgba(245, 158, 11, 0.1); color: #d97706; border-color: rgba(245, 158, 11, 0.3); }
.bigo-pill-nlogn { background: rgba(59, 130, 246, 0.1); color: #2563eb; border-color: rgba(59, 130, 246, 0.3); }
.bigo-pill-n2 { background: rgba(244, 63, 94, 0.1); color: #e11d48; border-color: rgba(244, 63, 94, 0.3); }

/* Grid de Cards de Algoritmos Compactos */
.os-algo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.os-algo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition);
}

.os-algo-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-accent, #0891b2);
  box-shadow: var(--shadow-md);
}

.algo-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.algo-module-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.algo-complexity-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.algo-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  margin: 0;
}

.algo-objective-box {
  background: var(--surface-soft);
  border-left: 3px solid var(--card-accent, #0891b2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.55rem 0.75rem;
}

.algo-objective-text {
  font-size: 0.76rem;
  color: var(--text-soft);
  line-height: 1.45;
  margin: 0;
}

.algo-tags-row {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.algo-tag-pill {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-soft);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.os-algo-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.btn-algo-explore {
  background: var(--teal);
  color: #ffffff;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition);
}

.btn-algo-explore:hover {
  opacity: 0.92;
}

.btn-algo-download {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--navy);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-algo-download:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ==========================================================================
   5. MODAL DE CÓDIGO FONTE (ACADÊMICO)
   ========================================================================== */

.algo-modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 6px);
  width: 92%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.algo-modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-soft);
}

.algo-modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 0.15rem 0;
}

.algo-modal-meta {
  font-size: 0.76rem;
  color: var(--text-soft);
  display: flex;
  gap: 0.45rem;
}

.algo-modal-guide-banner {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 1.5rem;
  font-size: 0.76rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: var(--text-soft);
}

.algo-modal-body {
  padding: 0;
  flex: 1;
  overflow-y: auto;
  background: #0f172a;
}

.algo-code-pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.84rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre;
  overflow-x: auto;
}

.algo-modal-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-soft);
  gap: 1rem;
}

/* ==========================================================================
   6. CATÁLOGO CENTRAL DE PROJETOS & PÁGINAS INDIVIDUAIS
   ========================================================================== */

/* Barra de Navegação Superior para Páginas Individuais */
.os-page-nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  margin-bottom: 1.5rem;
}

.os-page-nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.os-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.os-breadcrumb-link {
  color: var(--text-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease;
}

.os-breadcrumb-link:hover {
  color: #0891b2;
}

.os-breadcrumb-sep {
  opacity: 0.4;
  font-size: 0.75rem;
}

.os-breadcrumb-current {
  color: var(--navy);
  font-weight: 700;
}

.os-btn-back-hub {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm, 4px);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.os-btn-back-hub:hover {
  background: var(--bg-hover, rgba(8, 145, 178, 0.08));
  border-color: #0891b2;
  color: #0891b2;
}

/* Seção de Catálogo de Projetos */
.os-catalog-section {
  padding: 3rem 0 4.5rem 0;
  background: var(--bg);
}

.os-catalog-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem auto;
}

.os-catalog-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.os-catalog-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0;
}

/* Grid Responsivo de Cards de Projetos (4 Projetos - 2x2 no Desktop) */
.os-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

@media (max-width: 768px) {
  .os-projects-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Card Individual de Projeto */
.os-project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 6px);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.os-project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent-color, #0891b2);
  opacity: 0.85;
  transition: height 0.2s ease;
}

.os-project-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent-color, #0891b2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .os-project-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.os-project-card:hover::before {
  height: 6px;
}

/* Cores de Destaque por Projeto */
.os-project-card.card-pc {
  --card-accent-color: #0284c7;
}
.os-project-card.card-dos {
  --card-accent-color: #16a34a;
}
.os-project-card.card-lab {
  --card-accent-color: #ea580c;
}
.os-project-card.card-algos {
  --card-accent-color: #8b5cf6;
}

/* Topo do Card */
.os-project-top {
  margin-bottom: 1.25rem;
}

.os-project-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.os-project-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--icon-bg, rgba(8, 145, 178, 0.1));
  color: var(--card-accent-color, #0891b2);
  border: 1px solid var(--icon-border, rgba(8, 145, 178, 0.2));
}

.card-pc .os-project-icon-box {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.25);
}
.card-dos .os-project-icon-box {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.25);
}
.card-lab .os-project-icon-box {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.25);
}
.card-algos .os-project-icon-box {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.25);
}

.os-project-status-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  background: var(--surface-soft);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.os-project-status-badge.available {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .os-project-status-badge.available {
  color: #4ade80;
}

.os-project-title {
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.os-project-desc {
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
}

/* Tags de Recursos do Projeto */
.os-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.os-project-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--navy);
  border: 1px solid var(--line);
}

/* Botão de Ação do Card */
.os-project-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: #ffffff;
  background: var(--card-accent-color, #0d9488);
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
  cursor: pointer;
}

.os-project-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: #ffffff;
}

/* Seção de Pilares da Plataforma */
.os-platform-pillars {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.os-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 860px) {
  .os-pillars-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.os-pillar-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.os-pillar-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm, 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}

.os-pillar-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 0.25rem 0;
}

.os-pillar-desc {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0;
}

@media (max-width: 640px) {
  .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-actions > *,
  .btn-header-action {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

/* P1-10 — contraste WCAG AA em superfícies claras */
:root:not([data-theme="dark"]) .os-hero-badge { color: #0f766e !important; }
:root:not([data-theme="dark"]) .os-project-status-badge.available { color: #065f46 !important; }
:root:not([data-theme="dark"]) .os-project-card:nth-of-type(1) .os-project-btn { background: #0f766e !important; }
:root:not([data-theme="dark"]) .os-project-card:nth-of-type(2) .os-project-btn { background: #047857 !important; }
:root:not([data-theme="dark"]) .os-project-card:nth-of-type(3) .os-project-btn { background: #b45309 !important; }
:root:not([data-theme="dark"]) .os-project-card:nth-of-type(4) .os-project-btn { background: #0d9488 !important; }
:root:not([data-theme="dark"]) .brand-accent-gold { color: #7a5a0a !important; }
:root:not([data-theme="dark"]) .footer-brand-sep { color: #64748b !important; }
[data-theme="dark"] .card-pc .os-project-btn { background: #0f766e !important; }
[data-theme="dark"] .card-dos .os-project-btn { background: #059669 !important; }
[data-theme="dark"] .card-lab .os-project-btn { background: #b45309 !important; }
[data-theme="dark"] .card-algos .os-project-btn { background: #0d9488 !important; }

/* ==========================================================================
   CABEÇALHO CANÔNICO DO ECOSSISTEMA PHM TECH — BOTÕES GHOST & NAVEGAÇÃO
   ========================================================================== */
.phm-ecosystem-header .phm-ecosystem-header__inner,
.phm-ecosystem-header .nav-wrap {
  justify-content: flex-start !important;
}

.phm-ecosystem-header .phm-projects-menu > summary,
.phm-ecosystem-header .phm-hub-back {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-soft, #475569) !important;
  transition: all 0.15s ease;
}

.phm-ecosystem-header .phm-projects-menu > summary::-webkit-details-marker {
  display: none !important;
}

.phm-ecosystem-header .phm-projects-menu > summary span,
.phm-ecosystem-header .phm-projects-menu > summary svg:last-child,
.phm-ecosystem-header .phm-hub-back span {
  display: none !important;
}

.phm-ecosystem-header .phm-projects-menu > summary svg:first-child,
.phm-ecosystem-header .phm-hub-back svg {
  margin: 0 !important;
}

.phm-ecosystem-header .phm-projects-menu > summary:hover,
.phm-ecosystem-header .phm-projects-menu[open] > summary,
.phm-ecosystem-header .phm-hub-back:hover {
  border-color: var(--line, #e2e8f0) !important;
  background: var(--surface-soft, #f1f5f9) !important;
  color: var(--teal, #0d9488) !important;
}

[data-theme="dark"] .phm-ecosystem-header .phm-projects-menu > summary,
[data-theme="dark"] .phm-ecosystem-header .phm-hub-back {
  color: #94a3b8 !important;
}

[data-theme="dark"] .phm-ecosystem-header .phm-projects-menu > summary:hover,
[data-theme="dark"] .phm-ecosystem-header .phm-projects-menu[open] > summary,
[data-theme="dark"] .phm-ecosystem-header .phm-hub-back:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #2dd4bf !important;
}

[data-theme="sepia"] .phm-ecosystem-header .phm-projects-menu > summary,
[data-theme="sepia"] .phm-ecosystem-header .phm-hub-back {
  color: #715842 !important;
}

[data-theme="sepia"] .phm-ecosystem-header .phm-projects-menu > summary:hover,
[data-theme="sepia"] .phm-ecosystem-header .phm-projects-menu[open] > summary,
[data-theme="sepia"] .phm-ecosystem-header .phm-hub-back:hover {
  background: rgba(67, 52, 34, 0.08) !important;
  border-color: rgba(67, 52, 34, 0.15) !important;
  color: #78350f !important;
}

.phm-ecosystem-header .menu-toggle {
  display: none !important;
}

@media (max-width: 900px) {
  .phm-ecosystem-header .menu-toggle {
    display: inline-flex !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-soft, #475569) !important;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .phm-ecosystem-header .menu-toggle:hover {
    border-color: var(--line, #e2e8f0) !important;
    background: var(--surface-soft, #f1f5f9) !important;
    color: var(--teal, #0d9488) !important;
  }
  [data-theme="dark"] .phm-ecosystem-header .menu-toggle {
    color: #94a3b8 !important;
  }
  [data-theme="dark"] .phm-ecosystem-header .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #2dd4bf !important;
  }
  [data-theme="sepia"] .phm-ecosystem-header .menu-toggle {
    color: #715842 !important;
  }
  [data-theme="sepia"] .phm-ecosystem-header .menu-toggle:hover {
    background: rgba(67, 52, 34, 0.08) !important;
    border-color: rgba(67, 52, 34, 0.15) !important;
    color: #78350f !important;
  }
  .phm-ecosystem-header .header-editorial-nav {
    display: none !important;
  }
  .phm-ecosystem-header .header-editorial-nav.open {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface, #0f172a);
    border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
    padding: 1rem 1.25rem;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 999;
  }
  .phm-ecosystem-header .header-editorial-nav.open a {
    padding: 0.65rem 0.85rem !important;
    font-size: 0.85rem !important;
    border-radius: 4px !important;
  }
  [data-theme="light"] .phm-ecosystem-header .header-editorial-nav.open {
    background: #ffffff;
    border-bottom-color: var(--line, #e2e8f0);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }
  [data-theme="sepia"] .phm-ecosystem-header .header-editorial-nav.open {
    background: #f4ecdc;
    border-bottom-color: var(--line, #e2e8f0);
    box-shadow: 0 10px 25px rgba(67, 52, 34, 0.12);
  }
}

body.app-body {
  overflow-x: hidden;
}

.phm-ecosystem-header {
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  .phm-ecosystem-header .phm-ecosystem-header__inner {
    padding-inline: 0.35rem !important;
    gap: 0.2rem !important;
  }
  .phm-ecosystem-header .nav-left-cluster {
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .phm-ecosystem-header .app-logo-wordmark {
    height: 20px !important;
    max-width: 85px !important;
    width: auto !important;
  }
  .phm-ecosystem-header .nav-cluster-divider {
    display: none !important;
  }
  .phm-ecosystem-header .phm-ecosystem-header__actions {
    gap: 0.15rem !important;
    flex-shrink: 0 !important;
  }
  .phm-ecosystem-header .nav-pref-trigger,
  .phm-ecosystem-header .phm-projects-menu > summary,
  .phm-ecosystem-header .phm-hub-back,
  .phm-ecosystem-header .menu-toggle {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
    border-radius: 4px !important;
    justify-content: center !important;
  }
}

/* Salvaguarda de Acessibilidade: Skip Link fora do fluxo visual quando não focado */
.phm-skip-link {
  position: absolute !important;
  top: -9999px !important;
  left: 1rem !important;
  z-index: 999999 !important;
  padding: 0.5rem 1rem !important;
  background: #0b1329 !important;
  color: #2dd4bf !important;
  border: 1px solid #0891b2 !important;
  border-radius: 4px !important;
  font-family: var(--font-body, system-ui, sans-serif) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.phm-skip-link:focus,
.phm-skip-link:focus-visible {
  top: 1rem !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  outline: 2px solid #2dd4bf !important;
}

