/* Pages: Estilos específicos de páginas */

/* Responsividade */
@media (max-width: 767px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .colors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  
  .main-navigation ul {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .color-single .color-preview {
    height: 300px;
  }
  
  .harmonies-grid,
  .cvd-grid {
    grid-template-columns: 1fr;
  }
}

/* Página de cores recentes */
.recent-colors {
  margin-top: var(--space-md);
}

.recent-colors h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* Navegação por Seções - Single Color */
.color-sections-nav {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  z-index: 50; /* Abaixo do header (100), acima dos botões Exportar (10) */
  padding: var(--space-sm) 0;
  margin: 0;
  isolation: isolate;
  box-shadow: none;
  transition: box-shadow 0.3s ease;
}

/* Quando o header está sticky, a nav fica colada logo abaixo, sem espaço entre eles */
body:has(.site-header.site-header--sticky) {
  --color-nav-sticky-top: 52px; /* altura do header em estado sticky; ajustar se houver gap */
}
body:has(.site-header.site-header--sticky) .color-sections-nav {
  top: var(--color-nav-sticky-top);
}

.color-sections-nav.is-sticky {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.color-sections-nav .container {
  position: relative; /* Evitar que o container fique sticky; só o nav é sticky */
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE e Edge */
}

.color-sections-nav .container::-webkit-scrollbar {
  display: none; /* Chrome, Safari e Opera */
}

.color-section-link {
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  position: relative;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: transparent;
  border-radius: 25px;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.color-section-link:focus {
  outline: none;
}

.color-section-link:focus-visible {
  outline: none;
}

.color-section-link:hover {
  background: #e0e0e0;
  color: var(--color-text);
}

.color-section-link.active {
  background: #e7eefc;
  color: #3160C4;
}

.color-section-link.active::after {
  display: none;
}

.color-sections-content {
  padding-top: var(--space-md);
  padding-bottom: var(--space-xl);
}

.color-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  /* Ao rolar até a seção, o topo fica abaixo da nav sticky (header + nav) para os botões Exportar não sobreporem */
  scroll-margin-top: 110px;
}

.color-section:first-child {
  padding-top: 12px;
}

.color-section:last-child {
  border-bottom: none;
}

.tab-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
  margin-top: 0;
  color: var(--color-text);
}

/* Grid 2 colunas para "Sobre" */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
}

.about-item {
  background: #f5f5f5;
  padding: var(--space-lg);
  border-radius: 12px;
  margin-bottom: 12px;
}

.about-item-full {
  grid-column: 1 / -1;
}

.about-item h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  margin-top: 0;
  color: var(--color-text);
  font-weight: 600;
}

.about-content {
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* Notificação */
.chromatheme-notification {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.chromatheme-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Mensagem quando não há dados */
.no-data {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Conversão - Grid 2 colunas */
.conversion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.conversion-table {
  width: 100%;
  border-collapse: collapse;
}

.conversion-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.conversion-row:hover {
  background-color: var(--color-bg-secondary);
}

.conversion-row th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  color: var(--color-text);
  width: 30%;
}

.conversion-row td {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-base);
  font-weight: 400;
  font-size: 1rem;
  color: var(--color-text-secondary);
  text-align: right;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs);
}

.copy-icon {
  opacity: 0;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  order: -1;
}

.conversion-row:hover .copy-icon {
  opacity: 1;
}

.copy-icon svg {
  display: block;
}

/* Responsive - Seções */
@media (max-width: 767px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  /* Aumentar padding lateral nas seções de cores no mobile */
  .color-sections-nav .container,
  .color-technical-description .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  /* Como o container de color-sections-content tem display: contents, 
     aplicamos o padding diretamente nas seções */
  .color-sections-content .color-section {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  .color-sections-nav .container {
    gap: 0;
  }
  
  .color-section-link {
    font-size: 0.875rem;
    padding: var(--space-sm);
  }
  
  .tab-title {
    font-size: 1.5rem;
  }
  
  .conversion-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  /* Unificar as tabelas no mobile - fazer parecer uma única tabela */
  .conversion-grid .conversion-table {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
  }
  
  .conversion-grid .conversion-table:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  
  .conversion-grid .conversion-table:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 0;
  }
  
  /* Garantir que a última linha da primeira tabela tenha borda para conectar com a segunda */
  .conversion-grid .conversion-table:first-child tr:last-child th,
  .conversion-grid .conversion-table:first-child tr:last-child td {
    border-bottom: 1px solid #e0e0e0;
  }
  
  /* Remover borda superior do cabeçalho da segunda tabela para unificar visualmente */
  .conversion-grid .conversion-table:last-child thead tr:first-child th,
  .conversion-grid .conversion-table:last-child tbody tr:first-child th {
    border-top: none;
  }
  
  .color-section {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* Página Nomes das Cores */
.color-names-page .color-names-section {
  margin-bottom: var(--space-xl);
}
.color-names-page .color-names-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-md);
  color: var(--color-text);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-border, #e0e0e0);
}
.color-names-page .color-names-grid {
  margin-bottom: 0;
}
.color-names-page .color-card-name-label,
.color-names-page .color-card--name .color-name {
  display: block;
  text-align: center;
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-base);
  text-decoration: none;
  line-height: 1.3;
}
.color-names-page .color-names-sentinel {
  height: 1px;
  visibility: hidden;
  margin: 0;
  padding: 0;
}
.color-names-page .color-names-load-more-status {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-muted, #666);
}
.color-names-page .color-names-load-more-status.is-error {
  color: #c00;
}
