/* ===================================
   THATCHESS COLOR SELECTOR - ELEGANT TOGGLE
   Estilo minimalista con animaciones suaves
   =================================== */

.tc-color-toggle-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--tc-gray-950);
  border: 1px solid var(--tc-gray-700);
  padding: 0.25rem;
  gap: 0.25rem;
  isolation: isolate;
}

/* Slider animado */
.tc-color-slider {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 0.125rem);
  height: calc(100% - 0.5rem);
  background: var(--tc-gray-900);
  border: 1px solid var(--tc-gray-600);
  box-shadow: 
    0 0 0 1px rgba(100, 116, 139, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

/* Mueve el slider cuando Black está activo */
.tc-color-toggle-container:has(.tc-color-option[data-color="black"].active) .tc-color-slider {
  transform: translateX(calc(100% + 0.25rem));
}

/* Opciones de color */
.tc-color-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* Ícono del peón */
.tc-color-icon {
  font-size: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tc-color-icon i {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Peón blanco */
.tc-color-option[data-color="white"] .tc-color-icon i {
  color: var(--tc-white-pure);
  opacity: 0.5;
}

.tc-color-option[data-color="white"].active .tc-color-icon i {
  opacity: 1;
}

/* Peón negro - gris cuando inactivo, blanco cuando activo */
.tc-color-option[data-color="black"] .tc-color-icon i {
  color: var(--tc-gray-600);
  opacity: 0.5;
}

.tc-color-option[data-color="black"].active .tc-color-icon i {
  color: var(--tc-white-pure);
  opacity: 1;
}

/* Label */
.tc-color-label {
  font-family: var(--tc-font-mono);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tc-gray-500);
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tc-color-option.active .tc-color-label {
  color: var(--tc-white-pure);
}

/* Hover */
.tc-color-option:not(.active):hover .tc-color-icon i {
  opacity: 0.8;
  transform: scale(1.05);
}

/* Active state con escala */
.tc-color-option.active .tc-color-icon {
  transform: scale(1.1);
}

/* Textura grain en el track */
.tc-color-toggle-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    );
  pointer-events: none;
  opacity: 0.3;
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  .tc-color-icon {
    font-size: 2rem;
  }
  
  .tc-color-label {
    font-size: 0.5625rem;
  }

  .tc-color-option {
    padding: 0.6rem 0.4rem;
  }
}

/* ===================================
   LEVEL SELECTOR - EDITORIAL HORIZONTAL
   =================================== */

.tc-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tc-level-display {
  font-family: var(--tc-font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tc-white-pure);
}

.tc-level-selector {
  display: flex;
  flex-direction: row;
  gap: 0;
  background: var(--tc-gray-950);
  border: 1px solid var(--tc-gray-700);
}

.tc-level-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0;
  background: transparent;
  border: none;
  border-right: 1px solid var(--tc-gray-800);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--tc-font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tc-gray-500);
  position: relative;
}

.tc-level-option:last-of-type {
  border-right: none;
}

.tc-level-option:hover {
  background: var(--tc-gray-900);
  color: var(--tc-gray-300);
}

.tc-level-option.active {
  background: var(--tc-gray-900);
  color: var(--tc-white-pure);
}

/* Indicador activo - línea inferior */
.tc-level-option.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--tc-white-pure);
}
