/* Archivo: css/pintado.css */

/* Estilo para resaltar las casillas del tablero */
.highlight-red {
    box-shadow: inset 0 0 0 3px red;
}

.highlight-blue {
    box-shadow: inset 0 0 0 3px blue;
}

.highlight-purple {
    box-shadow: inset 0 0 0 3px #39ff14;
}

/* Estilos para las flechas dibujadas */
.arrow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20; 
    overflow: visible;
    display: block;
}

.arrow-line {
    stroke-width: 3;
}

/* Definir marcador para la punta de flecha */
marker path {
    d: M0,0 L10,3.5 L0,7 Z;
    fill: currentColor;
}

/* Flechas rojas */
.arrow-red {
    stroke: red;
}

/* Flechas azules neón */
.arrow-blue {
    stroke: blue;
}

/* Flechas moradas neón */
.arrow-purple {
    stroke: #39ff14; 
}

/* Estilo para desactivar el arrastre en el tablero */
.no-drag {
    pointer-events: none;
}

/* Estilos para el textarea FEN */
#fenInput {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 6px 10px;
    border: 1.5px solid #C50039;
    border-radius: 6px;
    background-color: #181818;
    color: #fff;
    margin-top: 4px;
    margin-bottom: 2px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#fenInput:focus {
    outline: none;
    border-color: #39ff14;
    box-shadow: 0 0 6px rgba(57,255,20,0.15);
    background-color: #222;
}

#fenInput.valid {
    border-color: #4CAF50;
    background-color: #202d20;
    color: #b6ffb6;
}

#fenInput.invalid {
    border-color: #f44336;
    background-color: #2d2020;
    color: #ffb6b6;
}

/* Wrapper para input y flechas dentro */
.control-group-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group {
  position: relative;
}

.input-icon-row {
  display: block;
  position: relative;
}

.input-number-wrapper {
  position: relative;
  width: 68px;
  display: block;
}

#fullMoves {
  width: 100%;
  min-width: 40px;
  max-width: 100%;
  background: #222;
  color: #fff;
  border: 2px solid #C50039;
  border-radius: 7px;
  padding: 2px 20px 2px 8px; /* padding derecho para flechas */
  font-size: 1.05em;
  height: 32px;
  outline: none;
  transition: border 0.2s, background 0.2s;
  box-shadow: 0 1px 4px #0002;
  text-align: center;
  appearance: none;
  z-index: 1;
  box-sizing: border-box;
}
#fullMoves:focus {
  border: 2px solid #fff;
  background: #2a2a2a;
}
#fullMoves::-webkit-inner-spin-button,
#fullMoves::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#fullMoves[type=number] {
  -moz-appearance: textfield;
}

/* Flechas SVG dentro del input, pegadas al borde derecho pero con separación */
.custom-spinner-inside {
  position: absolute;
  right: 3px;
  top: 0;
  height: 100%;
  width: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}
.custom-spinner-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  width: 18px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 3px;
  pointer-events: auto;
}
.custom-spinner-btn svg {
  width: 12px;
  height: 9px;
  display: block;
}
.custom-spinner-btn svg polygon {
  fill: #C50039;
  transition: fill 0.15s;
}
.custom-spinner-btn:hover svg polygon,
.custom-spinner-btn:focus svg polygon {
  fill: #fff;
}
.custom-spinner-btn:active {
  background: #C5003915;
}

#screenshotIcon {
  position: absolute;
  right: -35px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  cursor: pointer;
  /* Rojo #C50039 usando filter */
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(7492%) hue-rotate(334deg) brightness(92%) contrast(108%);
  transition: filter 0.2s;
  z-index: 10;
}
#screenshotIcon:hover {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(120%) contrast(120%);
}

.jugada-screenshot-flex {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 8px;
  overflow: visible;
}
.jugada-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.jugada-section label {
  margin: 0;
  white-space: normal;
  font-size: 1em;
  line-height: 1.1;
}
.input-number-wrapper {
  margin: 0;
}
.vertical-divider {
  width: 2px;
  height: 56px;
  background: #C50039;
  border-radius: 2px;
  margin: 0 18px;
  box-shadow: none;
}
.screenshot-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  margin-top: 0;
}
.screenshot-title {
  color: #fff;
  font-size: 1em;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-align: center;
}
.screenshot-static {
  width: 32px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  cursor: pointer;
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(7492%) hue-rotate(334deg) brightness(92%) contrast(108%);
  transition: filter 0.2s;
}
.screenshot-static:hover {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(120%) contrast(120%);
}

/* Eliminar la versión flotante anterior si existe */
.screenshot-floating { display: none !important; }

.fen-config-wrapper {
  position: relative;
}

.jugada-screenshot-grid {
  display: grid;
  grid-template-columns: auto minmax(60px, 1fr);
  grid-template-rows: auto auto;
  gap: 0;
  align-items: center;
  margin-bottom: 8px;
}
.jugada-title {
  grid-column: 1;
  grid-row: 1;
  font-size: 1em;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  padding-right: 18px;
  text-align: left;
  line-height: 1.1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  height: 100%;
}
.screenshot-title {
  grid-column: 2;
  grid-row: 1;
  color: #fff;
  font-size: 1em;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.jugada-input {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: flex-start;
  padding-right: 18px;
}
.screenshot-svg-cell {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  overflow: visible;
}
.screenshot-static {
  width: 28px;
  height: 28px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(7492%) hue-rotate(334deg) brightness(92%) contrast(108%);
  transition: filter 0.2s;
}
.grid-border-right {
  border-right: 2px solid #C50039;
}

.editor-blocks {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 12px;
}

.editor-block {
  background: #232323;
  border-radius: 12px;
  padding: 16px 18px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 2px 8px #0002;
}

.editor-title {
  color: #fff;
  font-size: 1em;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.editor-divider {
  width: 80%;
  height: 3px;
  background: #C50039;
  border-radius: 2px;
  align-self: center;
  margin: 0 0 0 0;
}

.editor-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
  background: none;
}

.editor-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.editor-col-jugada {
  flex: 2 1 0;
  align-items: flex-start;
}

.editor-col-screenshot {
  flex: 1 1 0;
  min-width: 80px;
  align-items: center;
}

.editor-title {
  color: #fff;
  font-size: 1em;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
}

.editor-divider-vertical {
  width: 2px;
  height: 60px;
  background: #C50039;
  border-radius: 2px;
  margin: 0 12px;
}

.screenshot-icon-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.screenshot-static {
  width: 28px;
  height: 28px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(7492%) hue-rotate(334deg) brightness(92%) contrast(108%);
  transition: filter 0.2s;
}

/* Exportación */
.export-palette-section {
  margin-top: 18px;
  margin-bottom: 10px;
  /* Hereda fondo y padding de palette-section */
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.export-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  margin-top: 2px;
  border: none;
}

.export-label {
  font-family: 'Poppins', sans-serif;
  font-size: 1em;
  color: #fff;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.export-icon {
  width: 28px;
  height: 28px;
  max-width: 100%;
  display: block;
  margin: 0;
  cursor: pointer;
  /* Blanco por defecto */
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(120%) contrast(120%);
  transition: filter 0.2s;
}
.export-icon:hover {
  /* Rojo al hacer hover */
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(7492%) hue-rotate(334deg) brightness(92%) contrast(108%);
}

/* Título igual a Turno, Enroque, etc. */
.fen-label {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05em;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
  display: block;
}

.palette-section h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05em;
  font-weight: 600;
  color: #C50039;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
  background: none;
  border: none;
  padding: 0 0 6px 0;
  box-shadow: none;
  border-radius: 0;
  display: block;
  border-bottom: 2px solid #222;
}

.palette-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  margin-top: 2px;
}

.palette-action-label {
  font-family: 'Poppins', sans-serif;
  font-size: 1em;
  color: #fff;
  font-weight: 400;
  letter-spacing: 0.1px;
  flex: 1 1 auto;
}

.palette-action-icon {
  width: 28px;
  height: 28px;
  max-width: 100%;
  display: block;
  margin: 0;
  cursor: pointer;
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(7492%) hue-rotate(334deg) brightness(92%) contrast(108%);
  transition: filter 0.2s;
}
.palette-action-icon:hover {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(120%) contrast(120%);
}