/* Components: Botões, Cards, Menus */

/* Botões */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--color-link);
  color: #fff;
}

.btn-primary:hover {
  background-color: #0052a3;
  opacity: 1;
}

.btn-large {
  padding: var(--space-md) var(--space-lg);
  font-size: 1.1rem;
}

/* Cards de cores - Estilo igual aos cards de Cores Relacionadas */
.color-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
}

.color-card:hover {
  transform: none;
}

.color-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-card:hover .color-preview {
  box-shadow: none;
}

/* HEX dentro do preview (centralizado, aparece no hover) */
.color-card .color-preview .color-hex {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-family: var(--font-base);
  font-size: 1.2rem !important;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 1;
}

.color-card:hover .color-preview .color-hex {
  opacity: 1;
}

/* HEX abaixo do preview (também visível) */
.color-card .related-color-hex {
  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;
}

.color-overlay {
  display: none;
}

.color-preview {
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.color-preview:focus,
.color-preview:active {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.color-preview .copy-checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #fff;
  font-size: 2rem !important;
  font-weight: 700 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

.color-preview .copy-checkmark.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.color-preview:has(.copy-checkmark.show) .color-hex {
  opacity: 0 !important;
}

/* Botão de favorito no card */
.color-card-favorite-btn {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 3;
  padding: 0;
}

.color-card-favorite-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.color-card-favorite-btn svg {
  width: 16px;
  height: 16px;
  color: #fff;
  stroke: currentColor;
  fill: none;
  transition: fill 0.3s ease;
}

.color-card-favorite-btn.favorited svg {
  fill: #fff;
  stroke: #fff;
}

/* Mobile: Ajustes para cards ficarem iguais aos relacionados */
@media (max-width: 767px) {
  .color-card {
    aspect-ratio: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

  .color-card:focus,
  .color-card:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  .color-card .color-preview {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }
  
  .color-card .color-preview:focus,
  .color-card .color-preview:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  .color-card .color-hex {
    font-size: 0.7rem;
    margin-top: 6px;
    padding: 0 4px;
    word-break: break-all;
  }
  
  .color-card .color-preview .color-hex {
    font-size: 1rem !important;
  }
  
  .color-card .related-color-hex {
    font-size: 0.75rem;
  }
}

/* Filtros */
.color-filters {
  margin-bottom: var(--space-lg);
  padding: var(--space-md) 0;
  background-color: transparent;
  border-radius: var(--radius-md);
}

.filters-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}

.filters-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-sm);
}

.filters-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background-color: #f0f0f0;
  color: var(--color-text);
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  min-width: 100px;
  white-space: nowrap;
  font-size: 0.9rem;
}

.category-color-circle {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.filters-list a:hover .category-color-circle,
.filters-list a.active .category-color-circle {
  opacity: 0;
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.filters-list a:hover,
.filters-list a.active {
  gap: 0;
}

.filters-list a:hover,
.filters-list a.active {
  background-color: #2563EB;
  color: #fff;
  border-color: #2563EB;
}

/* Garantir que botões sem data-category-color (como "Todas") usem a cor do botão Buscar */
.filters-list a:not([data-category-color]).active {
  background-color: #2563EB !important;
  border-color: #2563EB !important;
  color: #fff !important;
}

/* Aplicar cor da categoria no hover e quando ativo */
.filters-list a[data-category-color]:hover {
  background-color: var(--category-color) !important;
  border-color: var(--category-color) !important;
}

.filters-list a[data-category-color].active {
  background-color: var(--category-color) !important;
  border-color: var(--category-color) !important;
}

/* Escurecer texto quando a cor da categoria for clara */
.filters-list a[data-category-color].light-category:hover,
.filters-list a[data-category-color].light-category.active {
  color: #000 !important;
}

.term-count {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Paginação */
.pagination {
  margin-top: var(--space-lg);
}

.pagination ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  gap: var(--space-sm);
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background-color: #f5f5f5;
  color: var(--color-text);
}

.pagination a:hover,
.pagination .current {
  background-color: var(--color-link);
  color: #fff;
}

/* Menu */
.main-navigation ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-md);
}

.main-navigation a {
  color: var(--color-text);
  font-weight: 500;
}

.main-navigation a:hover {
  color: var(--color-link);
}

/* Single color */
.color-single .color-preview {
  height: 400px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.color-info {
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.color-hex {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.color-rgb,
.color-hsl {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Harmonias */
.harmonies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.harmony-item {
  padding: var(--space-md);
  background-color: #f5f5f5;
  border-radius: var(--radius-md);
}

.harmony-colors {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.harmony-color {
  flex: 1;
  height: 80px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
}

/* CVD */
.cvd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.cvd-item {
  text-align: center;
}

.cvd-preview {
  height: 100px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  margin-top: var(--space-sm);
}

/* Conversões */
.conversions-list {
  list-style: none;
  padding: 0;
}

.conversions-list li {
  padding: var(--space-sm);
  border-bottom: 1px solid #e0e0e0;
}

.conversions-list li:last-child {
  border-bottom: none;
}

/* Botão Voltar ao Topo */
.back-to-top-btn {
	position: fixed;
	bottom: 30px;
	right: 30px;
	width: 48px;
	height: 48px;
	background: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 9999;
}

.back-to-top-btn.show {
	opacity: 1;
	visibility: visible;
}

.back-to-top-btn:hover {
	background: #2563EB;
}

.back-to-top-btn svg {
	width: 20px;
	height: 20px;
	stroke: #000;
	transition: stroke 0.3s ease;
}

.back-to-top-btn:hover svg {
	stroke: #fff;
}

/* Versão Mobile */
@media (max-width: 767px) {
	.back-to-top-btn {
		width: 40px;
		height: 40px;
		bottom: 15px;
		right: 15px;
		outline: none;
		-webkit-tap-highlight-color: transparent;
	}
	
	.back-to-top-btn:focus {
		outline: none;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	}
	
	.back-to-top-btn svg {
		width: 16px;
		height: 16px;
	}
}

/* About */
.about-content {
  margin-top: var(--space-sm);
}
