/* biblioteca/css/biblioteca.css - VERSÃO MOBILE CORRIGIDA */

/* === CORES DO TORAT CHAIM === */
:root {
  --azul-profundo: #0A2463;
  --azul-escuro: #1A365D;
  --ouro: #C9B037;
  --dourado-claro: #E6D5A1;
  --branco-puro: #ffffff;
  --cinza-claro: #f8f9fa;
  --cinza-medio: #e2e8f0;
  --cinza-escuro: #64748b;
  --sombra-suave: 0 4px 12px rgba(0,0,0,0.08);
  --sombra-media: 0 8px 25px rgba(0,0,0,0.15);
  --zoom: 1;
}

/* === RESET E BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: calc(1em * var(--zoom));
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--cinza-claro);
  color: #1e293b;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === HEADER CORRIGIDO === */
.site-header {
  background: linear-gradient(135deg, var(--azul-profundo) 0%, var(--azul-escuro) 100%);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--sombra-media);
  border-bottom: 3px solid var(--ouro);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: white;
  flex-shrink: 0;
}

.logo img {
  height: 50px;
  width: auto;
  border-radius: 8px;
}

.logo-text {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--dourado-claro);
}

/* Menu Mobile - CORRIGIDO */
.menu-toggle {
  display: none;
  background: var(--ouro);
  border: none;
  color: var(--azul-profundo);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1002;
}

.menu-toggle:hover {
  background: var(--dourado-claro);
  transform: translateY(-2px);
}

/* Botão específico para biblioteca */
#biblioteca-toggle {
  display: none;
  background: var(--azul-profundo);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1002;
  margin-left: 0.5rem;
}

#biblioteca-toggle:hover {
  background: var(--azul-escuro);
  transform: translateY(-2px);
}

/* Busca */
.header-actions {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  max-width: 400px;
  margin: 0 2rem;
}

#global-search {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 25px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

#global-search::placeholder { 
  color: rgba(255,255,255,0.7); 
}

#global-search:focus { 
  background: white; 
  color: var(--azul-profundo); 
  outline: none;
  border-color: var(--ouro);
  box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.3);
}

#search-btn {
  background: var(--ouro);
  color: var(--azul-profundo);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#search-btn:hover {
  background: var(--dourado-claro);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 176, 55, 0.4);
}

/* Navegação Principal */
.main-nav {
  display: flex;
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.main-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--dourado-claro);
}

.main-nav a.active {
  background: var(--ouro);
  color: var(--azul-profundo);
  font-weight: 600;
}

/* === LAYOUT PRINCIPAL CORRIGIDO === */
.main {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 140px);
  margin-top: 100px;
  gap: 0;
  position: relative;
}

/* Explorer Sidebar */
.explorer {
  background: white;
  padding: 1.5rem;
  border-right: 1px solid var(--cinza-medio);
  box-shadow: var(--sombra-suave);
  overflow-y: auto;
  position: sticky;
  top: 100px;
  height: calc(100vh - 140px);
  z-index: 90;
  transition: transform 0.3s ease;
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ouro);
}

.explorer-header h2 {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.5rem;
  color: var(--azul-profundo);
  margin: 0;
  font-weight: 700;
}

#collapse-all {
  background: transparent;
  border: 1px solid var(--azul-profundo);
  color: var(--azul-profundo);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#collapse-all:hover {
  background: var(--azul-profundo);
  color: white;
  transform: translateY(-1px);
}

/* === ÁRVORE MELHORADA === */
#tree-container {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.tree-item {
  position: relative;
  margin-bottom: 2px;
}

.tree-line {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.tree-line:hover { 
  background: rgba(201, 176, 55, 0.1); 
  border-color: rgba(201, 176, 55, 0.3);
}

.tree-item.selected > .tree-line {
  background: rgba(201, 176, 55, 0.15) !important;
  border-color: var(--ouro);
  font-weight: 600;
  color: var(--azul-profundo);
}

.caret {
  width: 18px;
  height: 18px;
  fill: var(--cinza-escuro);
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.tree-item:not(.collapsed) > .tree-line > .caret { 
  transform: rotate(0deg); 
}

.folder-icon { 
  width: 18px; 
  height: 18px; 
  fill: var(--ouro); 
  flex-shrink: 0;
}

.folder-icon.file { 
  fill: var(--cinza-escuro); 
}

.tree-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: inherit;
}

.tree-item ul {
  padding-left: 28px;
  margin: 4px 0;
  position: relative;
}

.tree-item ul::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--cinza-medio);
  border-radius: 1px;
}

.tree-item.collapsed > ul { 
  display: none; 
}

/* === CONTEÚDO PRINCIPAL === */
.content {
  padding: 2rem;
  background: var(--cinza-claro);
  min-height: calc(100vh - 140px);
  overflow-y: auto;
}

#breadcrumbs {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--sombra-suave);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--cinza-escuro);
  border-left: 4px solid var(--ouro);
}

#breadcrumbs a {
  color: var(--azul-profundo);
  text-decoration: none;
  transition: color 0.3s ease;
}

#breadcrumbs a:hover {
  color: var(--ouro);
}

#text-viewer {
  background: white;
  padding: 2.5rem;
  border-radius: 15px;
  box-shadow: var(--sombra-media);
  line-height: 1.8;
  min-height: 60vh;
  border: 1px solid var(--cinza-medio);
}

#text-viewer:not(.hidden) {
  display: block;
}

#empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--cinza-escuro);
  background: white;
  border-radius: 15px;
  box-shadow: var(--sombra-suave);
  margin-top: 2rem;
}

.empty-icon { 
  font-size: 4rem; 
  margin-bottom: 1.5rem; 
  color: var(--ouro);
  opacity: 0.7;
}

#empty-state h3 { 
  font-family: 'El Messiri', sans-serif; 
  font-size: 1.8rem; 
  color: var(--azul-profundo); 
  margin-bottom: 1rem;
}

#empty-state p {
  font-size: 1.1rem;
  color: var(--cinza-escuro);
}

/* === VIEWER STYLES === */
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--cinza-medio);
  flex-wrap: wrap;
  gap: 1rem;
}

.viewer-header h1 {
  font-family: 'El Messiri', sans-serif;
  color: var(--azul-profundo);
  font-size: 1.8rem;
  margin: 0;
}

.viewer-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.viewer-controls button {
  background: var(--cinza-medio);
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.viewer-controls button:hover {
  background: var(--ouro);
  color: var(--azul-profundo);
}

#lang-preset {
  padding: 0.5rem 1rem;
  border: 1px solid var(--cinza-medio);
  border-radius: 6px;
  background: white;
  color: var(--azul-profundo);
}

.parallel-stacked-container {
  width: 100%;
}

.parallel-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chapter-title {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.5em;
  color: var(--azul-profundo);
  text-align: center;
  margin: 2rem 0 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(10, 36, 99, 0.1) 0%, rgba(201, 176, 55, 0.1) 100%);
  border-radius: 12px;
  border-left: 4px solid var(--ouro);
}

.verse-block {
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
  padding: 1rem;
  border-radius: 8px;
}

.verse-block:hover {
  background: rgba(201, 176, 55, 0.05);
}

.verse-he {
  font-family: 'David Libre', serif;
  font-size: 1.2em;
  line-height: 1.8;
  text-align: right;
  direction: rtl;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(201, 176, 55, 0.2);
  margin-bottom: 0.5rem;
}

.verse-en, .verse-pt {
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  line-height: 1.6;
  padding: 0.5rem 0;
}

.verse-number {
  background: var(--ouro);
  color: var(--azul-profundo);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
  margin: 0 8px;
}

/* === FOOTER ATUALIZADO === */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  background: white;
  border-top: 3px solid var(--ouro);
  font-size: 0.9rem;
  color: var(--cinza-escuro);
  margin-top: auto;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.bencao {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.2rem;
  color: var(--azul-profundo);
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.redes-sociais {
  margin: 1rem 0;
}

.redes-sociais a {
  color: var(--azul-profundo);
  margin: 0 0.8rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.redes-sociais a:hover {
  color: var(--ouro);
}

.site-footer a {
  color: var(--azul-profundo);
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: var(--ouro);
}

/* === WHATSAPP FAB === */
.whatsapp-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--sombra-media);
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
  font-weight: bold;
}

.whatsapp-fab:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 8px 25px rgba(37,211,102,0.6);
}

/* === OVERLAY MOBILE === */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 899;
  backdrop-filter: blur(4px);
}

.overlay.active { 
  display: block; 
}

/* === UPDATE BANNER === */
.update-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ouro);
  color: var(--azul-profundo);
  padding: 1rem 1.5rem;
  text-align: center;
  z-index: 1001;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
  font-weight: 600;
}

.update-banner.hidden {
  display: none;
}

#update-btn {
  background: var(--azul-profundo);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  margin-left: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#update-btn:hover {
  background: var(--azul-escuro);
  transform: translateY(-2px);
}

/* === MODAL DE IDIOMAS === */
.lang-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--sombra-media);
}

.modal-card h3 {
  color: var(--azul-profundo);
  margin-bottom: 0.5rem;
  font-family: 'El Messiri', sans-serif;
}

.modal-card h4 {
  color: var(--cinza-escuro);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.lang-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 2px solid var(--cinza-medio);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-option:hover {
  border-color: var(--ouro);
  background: rgba(201, 176, 55, 0.05);
}

.lang-option input {
  margin: 0;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#modal-cancel {
  background: var(--cinza-medio);
  color: var(--cinza-escuro);
}

#modal-cancel:hover {
  background: var(--cinza-escuro);
  color: white;
}

#modal-load {
  background: var(--ouro);
  color: var(--azul-profundo);
}

#modal-load:hover {
  background: var(--dourado-claro);
  transform: translateY(-2px);
}

/* === ESTILOS PARA NOTAS DE RODAPÉ === */
.footnote-marker {
  color: var(--ouro);
  font-weight: bold;
  cursor: pointer;
  margin: 0 2px;
}

.footnote {
  display: inline-block;
  background: rgba(201, 176, 55, 0.1);
  border-left: 3px solid var(--ouro);
  padding: 0.5rem 0.8rem;
  margin: 0.5rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.9em;
  color: var(--cinza-escuro);
}

.footnote b {
  color: var(--azul-profundo);
  font-weight: 600;
}

/* Reading mode */
.reading-mode #text-viewer {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: #fefefe;
  box-shadow: 0 0 50px rgba(0,0,0,0.1);
}

.reading-mode .verse-he {
  font-size: calc(1.3em * var(--zoom));
}

.reading-mode .verse-en, 
.reading-mode .verse-pt {
  font-size: calc(1.1em * var(--zoom));
}

.loader {
  text-align: center;
  padding: 3rem;
  color: var(--cinza-escuro);
  font-size: 1.1rem;
}

.error {
  color: #dc2626;
  padding: 1rem;
  background: #fef2f2;
  border-radius: 8px;
  border-left: 4px solid #dc2626;
}

/* === RESPONSIVIDADE COMPLETA - MOBILE CORRIGIDO === */

/* Tablet (1024px) */
@media (max-width: 1024px) {
  .header-container {
    padding: 0.8rem 1rem;
  }
  
  .main {
    grid-template-columns: 300px 1fr;
    margin-top: 90px;
  }
  
  .explorer {
    width: 300px;
    padding: 1rem;
  }
  
  .content {
    padding: 1.5rem;
  }
  
  .header-actions {
    max-width: 300px;
    margin: 0 1rem;
  }
}

/* Mobile Large (768px) - CORREÇÃO PRINCIPAL DO MENU BIBLIOTECA */
@media (max-width: 768px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }
  
  .header-container {
    padding: 0.8rem 1rem;
    gap: 0.8rem;
    position: relative;
  }
  
  .logo img {
    height: 40px;
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  /* MOSTRAR OS DOIS BOTÕES NO MOBILE */
  .menu-toggle {
    display: block;
    order: 2;
    background: var(--ouro);
    color: var(--azul-profundo);
  }
  
  #biblioteca-toggle {
    display: block;
    order: 3;
    background: var(--azul-profundo);
    color: white;
  }
  
  .header-actions {
    display: none;
  }
  
  /* Menu Principal - Mobile */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--azul-profundo);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  .main-nav.active {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .main-nav a {
    display: block;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.2rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Layout Principal Mobile */
  .main {
    grid-template-columns: 1fr;
    margin-top: 80px;
    min-height: calc(100vh - 120px);
  }
  
  /* Explorer Mobile - AGORA FUNCIONA */
  .explorer {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: calc(100vh - 80px);
    z-index: 900;
    transition: left 0.3s ease;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    overflow-y: auto;
  }
  
  .explorer.open {
    left: 0;
  }
  
  .explorer-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 1rem 0;
    margin: -1rem -1rem 1rem -1rem;
    padding: 1rem;
  }
  
  #tree-container {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
  }
  
  .content {
    margin-left: 0;
    padding: 1rem;
    min-height: calc(100vh - 120px);
  }
  
  #text-viewer {
    padding: 1.5rem;
  }
  
  .viewer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .viewer-controls {
    width: 100%;
    justify-content: center;
  }
  
  .whatsapp-fab {
    bottom: 1rem;
    right: 1rem;
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
  }
}

/* Mobile Small (480px) */
@media (max-width: 480px) {
  .header-container {
    padding: 0.6rem 0.8rem;
  }
  
  .logo {
    gap: 0.5rem;
  }
  
  .logo img {
    height: 35px;
  }
  
  .logo-text {
    font-size: 0.9rem;
  }
  
  .menu-toggle, #biblioteca-toggle {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }
  
  .main {
    margin-top: 70px;
    min-height: calc(100vh - 110px);
  }
  
  .explorer {
    top: 70px;
    height: calc(100vh - 70px);
    width: 90%;
  }
  
  .content {
    padding: 0.8rem;
  }
  
  #text-viewer {
    padding: 1rem;
    border-radius: 12px;
  }
  
  #empty-state {
    padding: 2rem 1rem;
  }
  
  .empty-icon {
    font-size: 3rem;
  }
  
  #empty-state h3 {
    font-size: 1.5rem;
  }
  
  .site-footer {
    padding: 1.5rem 1rem;
  }
  
  .bencao {
    font-size: 1.1rem;
  }
  
  .modal-card {
    padding: 1.5rem;
    margin: 1rem;
  }
}

/* Kindle & Tablets Pequenos (600px - 768px) */
@media (max-width: 768px) and (min-width: 601px) {
  .explorer {
    width: 70%;
    max-width: 280px;
  }
  
  .content {
    padding: 1.2rem;
  }
}

/* Orientação Landscape em Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header {
    position: relative;
  }
  
  .main {
    margin-top: 0;
    min-height: 100vh;
  }
  
  .explorer {
    top: 0;
    height: 100vh;
  }
  
  .content {
    min-height: 100vh;
  }
  
  .main-nav.active {
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
  .tree-line {
    padding: 12px 16px;
    min-height: 44px;
  }
  
  .main-nav a {
    padding: 14px 16px;
    min-height: 44px;
  }
  
  #search-btn, #collapse-all {
    min-height: 44px;
    padding: 12px 20px;
  }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* === ACESSIBILIDADE === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
  :root {
    --cinza-claro: #0f172a;
    --branco-puro: #1e293b;
    --cinza-medio: #334155;
    --cinza-escuro: #94a3b8;
  }
  
  body, .explorer, #text-viewer, .site-footer { 
    background: #0f172a; 
    color: #e2e8f0; 
  }
  
  .explorer, #text-viewer, #breadcrumbs, #empty-state {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
  }
  
  .tree-line:hover { 
    background: #334155; 
  }
  
  .tree-item.selected > .tree-line {
    background: rgba(201, 176, 55, 0.2) !important;
  }
  
  #global-search {
    background: rgba(255,255,255,0.1);
    color: white;
  }
  
  #global-search:focus {
    background: #334155;
    color: white;
  }
}

/* === UTILITÁRIOS === */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ouro);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}