/* 5 Queens with Colors Puzzle Styles */

/* Color Variables */
:root {
  --color-red: #e74c3c;
  --color-blue: #3498db;
  --color-green: #2ecc71;
  --color-yellow: #f1c40f;
  --color-purple: #9b59b6;
  --color-orange: #e67e22;
  --color-cyan: #1abc9c;
  --color-gray: #95a5a6;
}

/* Board Container */
.board-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Colored Chess Board */
.queens-colored-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: #333;
  border: 3px solid #333;
  border-radius: 8px;
  width: 400px;
  height: 400px;
  position: relative;
}

.queens-colored-square {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2rem;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
  user-select: none;
}

/* Color Backgrounds */
.queens-colored-square.color-red { background-color: var(--color-red); }
.queens-colored-square.color-blue { background-color: var(--color-blue); }
.queens-colored-square.color-green { background-color: var(--color-green); }
.queens-colored-square.color-yellow { background-color: var(--color-yellow); }
.queens-colored-square.color-purple { background-color: var(--color-purple); }
.queens-colored-square.color-orange { background-color: var(--color-orange); }
.queens-colored-square.color-cyan { background-color: var(--color-cyan); }
.queens-colored-square.color-gray { background-color: var(--color-gray); }

/* Queen Piece */
.queens-colored-square.has-queen {
  color: #000;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  font-weight: bold;
}

.queens-colored-square.has-queen::before {
  content: '♛';
  position: absolute;
  font-size: 2.2rem;
  z-index: 2;
}

/* State Indicators */
.queens-colored-square.cell-safe {
  outline: 3px solid rgba(0, 150, 0, 0.8);
  box-shadow: 0 0 8px rgba(0, 150, 0, 0.5);
  animation: pulse-safe 2s infinite;
}

.queens-colored-square.cell-conflict {
  outline: 3px solid rgba(200, 0, 0, 0.8);
  box-shadow: 0 0 8px rgba(200, 0, 0, 0.5);
  animation: pulse-conflict 1s infinite;
}

/* Wrong position styling - red outline for queens in wrong positions */
.queens-colored-square.wrong-position {
  outline: 4px solid #ff0000;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.8);
  animation: wrongPositionPulse 2s infinite;
}

@keyframes wrongPositionPulse {
  0%, 100% {
    outline: 4px solid #ff0000;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.8);
  }
  50% {
    outline: 4px solid #ff6666;
    box-shadow: 0 0 20px rgba(255, 102, 102, 0.9);
  }
}

.queens-colored-square.cell-warning {
  outline: 3px solid rgba(180, 120, 0, 0.9);
  box-shadow: 0 0 8px rgba(180, 120, 0, 0.5);
  animation: pulse-warning 1.5s infinite;
}

/* Hint Highlighting */
.queens-colored-square.hint-suggestion {
  outline: 4px solid rgba(0, 255, 255, 0.9);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.7);
  animation: pulse-hint-suggestion 1s infinite;
  z-index: 10;
}

.queens-colored-square.hint-mistake {
  outline: 4px solid rgba(255, 69, 0, 0.95);
  box-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
  animation: pulse-hint-mistake 0.8s infinite;
  z-index: 10;
}

/* Hover Effects */
.queens-colored-square:hover {
  transform: scale(1.05);
  border-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

/* Color Legend */
.color-legend-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.color-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  font-size: 0.85rem;
}

.color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #333;
}

.color-swatch.color-red { background-color: var(--color-red); }
.color-swatch.color-blue { background-color: var(--color-blue); }
.color-swatch.color-green { background-color: var(--color-green); }
.color-swatch.color-yellow { background-color: var(--color-yellow); }
.color-swatch.color-purple { background-color: var(--color-purple); }
.color-swatch.color-orange { background-color: var(--color-orange); }
.color-swatch.color-cyan { background-color: var(--color-cyan); }
.color-swatch.color-gray { background-color: var(--color-gray); }

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
}

.status-ready { background: #e3f2fd; color: #1976d2; }
.status-perfect { background: #e8f5e8; color: #2e7d32; }
.status-partial { background: #fff3e0; color: #f57c00; }
.status-conflict { background: #ffebee; color: #d32f2f; }
.status-invalid { background: #f3e5f5; color: #7b1fa2; }

/* Game Progress Stats */
.progress-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

.stat-label {
  color: #666;
  font-weight: 500;
}

/* Validation Results */
.validation-results {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.validation-results.show {
  display: block;
}

.validation-summary {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: bold;
}

.validation-summary.perfect {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.validation-summary.conflict {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.validation-summary.partial {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.conflict-list {
  margin-top: 0.5rem;
}

.conflict-item {
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: #fff;
  border-left: 4px solid #dc3545;
  border-radius: 4px;
  font-size: 0.85rem;
}

.suggestions-list {
  margin-top: 0.5rem;
}

.suggestion-item {
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: #fff;
  border-left: 4px solid #28a745;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.suggestion-item:hover {
  background: #f8f9fa;
}

/* Input Section */
.input-section {
  margin-top: 1rem;
}

.input-section h4 {
  margin-bottom: 0.5rem;
  color: #333;
}

.input-section textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  resize: vertical;
}

.input-section textarea:focus {
  outline: none;
  border-color: #007bff;
}

/* Animations */
@keyframes pulse-safe {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 150, 0, 0.5); }
  50% { box-shadow: 0 0 16px rgba(0, 150, 0, 0.8); }
}

@keyframes pulse-conflict {
  0%, 100% { box-shadow: 0 0 8px rgba(200, 0, 0, 0.5); }
  50% { box-shadow: 0 0 16px rgba(200, 0, 0, 0.8); }
}

@keyframes pulse-warning {
  0%, 100% { box-shadow: 0 0 8px rgba(180, 120, 0, 0.5); }
  50% { box-shadow: 0 0 16px rgba(180, 120, 0, 0.8); }
}

@keyframes pulse-hint-suggestion {
  0%, 100% {
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 24px rgba(0, 255, 255, 1);
    transform: scale(1.05);
  }
}

@keyframes pulse-hint-mistake {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 32px rgba(255, 69, 0, 1);
    transform: scale(1.08);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .queens-colored-board {
    width: 300px;
    height: 300px;
  }
  
  .queens-colored-square {
    font-size: 1.5rem;
  }
  
  .queens-colored-square.has-queen::before {
    font-size: 1.7rem;
  }
  
  .board-container {
    flex-direction: column;
  }
  
  .color-legend-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .game-area {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Hints Section */
.hints-section {
  margin-top: 1rem;
  padding: 1rem;
  background: #e3f2fd;
  border-radius: 8px;
  border-left: 4px solid #2196f3;
}

.hints-section h4 {
  margin: 0 0 0.5rem 0;
  color: #1976d2;
}

.hint-message {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.4;
}

/* Timer Styling */
#queensTimer {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  background: #f0f0f0;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 2px solid #ddd;
}

/* Dark Mode Support */
body.dark-mode .validation-results {
  background: #2d3748;
  color: #e2e8f0;
}

body.dark-mode .conflict-item {
  background: #2d3748;
  color: #e2e8f0;
}

body.dark-mode .suggestion-item {
  background: #2d3748;
  color: #e2e8f0;
}

body.dark-mode .suggestion-item:hover {
  background: #4a5568;
}

body.dark-mode .hints-section {
  background: #2d3748;
  border-left-color: #63b3ed;
}

body.dark-mode .hints-section h4 {
  color: #63b3ed;
}

body.dark-mode .hint-message {
  color: #e2e8f0;
}

body.dark-mode #queensTimer {
  background: #4a5568;
  color: #e2e8f0;
  border-color: #2d3748;
}

body.dark-mode .progress-stat {
  border-color: #4a5568;
}

body.dark-mode .stat-label {
  color: #a0aec0;
}
