/* Chess Container */
.chess-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
}

.chess-game {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Board Wrapper */
.chess-board-wrapper {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
}

#chess-board {
  width: 100% !important;
}

/* Click-to-move highlights */
.highlight-selected {
  background-color: rgba(255, 255, 0, 0.4) !important;
  box-shadow: inset 0 0 3px 3px rgba(255, 255, 0, 0.5);
}

.highlight-valid-move {
  position: relative;
}

.highlight-valid-move::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background-color: rgba(0, 128, 0, 0.4);
  border-radius: 50%;
  pointer-events: none;
}

/* Sidebar */
.chess-sidebar {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Game Controls */
.game-controls {
  background: var(--card-background, #f5f5f5);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-controls h3,
.game-controls h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary, #333);
}

.control-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-primary {
  background: #4CAF50;
  color: white;
}

.btn-primary:hover {
  background: #45a049;
}

.btn-secondary {
  background: #2196F3;
  color: white;
}

.btn-secondary:hover {
  background: #0b7dda;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Controls */
.game-mode-selector,
.difficulty-selector,
.side-selector {
  margin-bottom: 1rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
  color: #333;
}

/* Game Status */
.game-status {
  background: var(--card-background, #f5f5f5);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-status h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary, #333);
}

#game-status-text {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary, #666);
}

#turn-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary, #666);
}

/* Move History */
.move-history {
  background: var(--card-background, #f5f5f5);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
}

.move-history h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary, #333);
}

#move-list {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary, #666);
}

.move-pair {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.move-number {
  font-weight: bold;
  min-width: 30px;
  color: var(--text-primary, #333);
}

.move {
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  transition: background 0.2s;
}

.move:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .chess-game {
    flex-direction: column;
  }

  .chess-sidebar {
    flex: 1;
    width: 100%;
  }

  .chess-board-wrapper {
    max-width: 100%;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .game-controls,
  .game-status,
  .move-history {
    background: #2a2a2a;
  }

  .game-controls h3,
  .game-controls h4,
  .game-status h3,
  .move-history h3,
  .move-number {
    color: #e0e0e0;
  }

  #game-status-text,
  #turn-indicator,
  #move-list {
    color: #b0b0b0;
  }

  .form-control {
    background: #333;
    color: #e0e0e0;
    border-color: #555;
  }
}
