/* Clean Chess Game Styles - Standardized and Optimized */

/* CSS Variables - Light Theme (Default) */
:root {
  --primary-color: #3A5F88;
  --secondary-color: #E2C495;
  --accent-color: #8B6B4C;
  --success-color: #4CAF50;
  --warning-color: #FF9800;
  --error-color: #F44336;
  --light-square: #F0D9B5;
  --dark-square: #B58863;
  --highlight-color: rgba(255, 255, 0, 0.5);
  --possible-move: rgba(0, 128, 0, 0.3);
  --check-highlight: rgba(255, 0, 0, 0.4);
  --board-border: #6d4c30;
  --text-primary: #333333;
  --text-secondary: #666666;
  --background-light: #f9f8f6;
  --background-main: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --border-color: #e0e0e0;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --primary-color: #5A7FA8;
  --secondary-color: #A6905B;
  --accent-color: #AB8B6C;
  --success-color: #66BB6A;
  --warning-color: #FFA726;
  --error-color: #EF5350;
  --light-square: #D4C4A8;
  --dark-square: #8B6B47;
  --highlight-color: rgba(255, 255, 0, 0.4);
  --possible-move: rgba(76, 175, 80, 0.4);
  --check-highlight: rgba(239, 83, 80, 0.5);
  --board-border: #5d4c30;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --background-light: #2d2d30;
  --background-main: #1e1e1e;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --border-color: #404040;
}

/* Smooth theme transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Reset and Base Styles */
.chess-app * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.chess-app {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-primary);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Game Container */
.game-container {
  background-color: var(--background-main);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--shadow-color);
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--border-color);
}

/* Header */
.game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--accent-color);
  position: relative;
}

/* Header Layout - Three sections */
.header-left {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* LEARNature-ly Logo */
.logo-link {
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.logo-learnature {
  height: 80px;
  width: auto;
  border-radius: 50%;
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: box-shadow 0.3s ease;
}

.logo-learnature:hover {
  box-shadow: 0 4px 12px var(--shadow-color);
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
  .header-left {
    position: static;
    margin-bottom: 10px;
    justify-content: center;
  }
  
  .game-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .logo-learnature {
    height: 50px;
  }
  
  .header-center {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .logo-learnature {
    height: 40px;
  }
  
  .game-title {
    font-size: 1.5rem;
  }
}

.game-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 16px;
  text-align: center;
}

.by-text {
  font-size: 0.6em;
  color: #666;
  font-weight: normal;
  opacity: 0.8;
  margin-left: 8px;
}

/* Mode Selector */
.mode-selector {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.mode-btn {
  background-color: #ffffff;
  color: #1a3c5e;
  border: 2px solid var(--accent-color);
  border-radius: 6px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.mode-btn:hover {
  background-color: var(--secondary-color);
  color: #000000;
  transform: scale(1.05);
}

.mode-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: #ffffff;
}

/* Coming Soon buttons */
.mode-btn.coming-soon {
  background-color: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
  cursor: not-allowed;
  opacity: 0.7;
  position: relative;
}

.mode-btn.coming-soon:hover {
  transform: none;
  background-color: #f8f9fa;
  color: #6c757d;
}

.coming-soon-badge {
  background-color: #007bff;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
  font-weight: 500;
  position: relative;
  top: -1px;
}

/* Coming Soon Notification */
.coming-soon-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #007bff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: slideInNotification 0.3s ease-out;
}

.notification-content {
  padding: 25px;
  text-align: center;
  max-width: 400px;
}

.notification-content h4 {
  color: #007bff;
  margin: 0 0 15px 0;
  font-size: 1.3rem;
}

.notification-content p {
  margin: 10px 0;
  color: #333;
  line-height: 1.5;
}

.notification-content p:last-child {
  font-size: 0.9rem;
  color: #666;
  margin-top: 15px;
}

@keyframes slideInNotification {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Game Main Content */
.game-main {
  position: relative;
}

.game-mode {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hidden {
  display: none !important;
}

/* Chess Board Styles */
.chess-board-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 480px;
  height: 480px;
  border: 2px solid var(--board-border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.chess-square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.light-square {
  background-color: var(--light-square);
}

.dark-square {
  background-color: var(--dark-square);
}

/* Piece Styling */
.chess-piece {
  font-size: 2.5rem;
  line-height: 1;
  pointer-events: none;
  position: relative;
  z-index: 2;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Square States */
.chess-square:hover {
  filter: brightness(1.1);
}

.selected-square {
  background-color: var(--highlight-color) !important;
  box-shadow: inset 0 0 8px rgba(255, 255, 0, 0.8);
}

.possible-move::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background-color: var(--possible-move);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

.possible-move.has-piece::after {
  width: 80%;
  height: 80%;
  border: 3px solid rgba(0, 128, 0, 0.6);
  background-color: transparent;
}

/* Castling suggestions */
.castling-suggestion {
  background-color: rgba(138, 43, 226, 0.3) !important;
  border: 2px solid rgba(138, 43, 226, 0.8);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
  animation: pulse-castling 1.5s ease-in-out infinite;
}

@keyframes pulse-castling {
  0%, 100% { box-shadow: 0 0 10px rgba(138, 43, 226, 0.5); }
  50% { box-shadow: 0 0 20px rgba(138, 43, 226, 0.8); }
}

.castling-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
  z-index: 10;
  pointer-events: none;
  animation: bounce-castle 2s ease-in-out infinite;
}

@keyframes bounce-castle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.check-square {
  background-color: var(--check-highlight) !important;
  animation: check-pulse 1s ease-in-out infinite alternate;
}

@keyframes check-pulse {
  from { background-color: var(--check-highlight); }
  to { background-color: rgba(255, 0, 0, 0.7); }
}

.last-move-square {
  background-color: rgba(255, 255, 0, 0.3) !important;
}

.last-move-pulse {
  animation: pulse 0.5s ease-in-out 4;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Chess Coordinates */
.chess-coordinate {
  position: absolute;
  font-family: inherit;
  font-size: 10px;
  font-weight: bold;
  user-select: none;
  pointer-events: none;
  z-index: 1;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
  opacity: 0.8;
}

.chess-coordinate-file {
  bottom: 2px;
  right: 2px;
}

.chess-coordinate-rank {
  top: 2px;
  left: 2px;
}

/* Control Elements */
.mode-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.control-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.control-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
  transform: scale(0.95);
}

/* AI Character Selection Styles */
.ai-selection-container {
  background: linear-gradient(135deg, #f8f9ff, #e8eef9);
  border: 2px solid #4a90e2;
  border-radius: 12px;
  padding: 15px;
  margin: 10px 0;
}

.current-ai-display {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ai-avatar {
  font-size: 32px;
  background: rgba(74, 144, 226, 0.1);
  border-radius: 50%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.ai-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-name {
  font-weight: bold;
  font-size: 16px;
  color: #2c3e50;
}

.ai-difficulty {
  font-size: 14px;
  color: #7f8c8d;
}

/* Controls */
.audio-controls, .animation-controls, .theme-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#audio-toggle, #animation-toggle, #theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.3s ease, opacity 0.3s ease;
  color: var(--text-primary);
}

#audio-toggle:hover, #animation-toggle:hover, #theme-toggle:hover {
  background-color: var(--accent-color);
  color: var(--background-main);
}

#audio-toggle.disabled, #animation-toggle.disabled {
  opacity: 0.5;
}

#animation-toggle.disabled {
  filter: grayscale(100%);
}

/* Dark mode specific styling */
[data-theme="dark"] body {
  background-color: var(--background-light);
  color: var(--text-primary);
}

/* Enhanced chess piece visibility in dark mode */
[data-theme="dark"] .chess-piece {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 
               0 0 2px rgba(255, 255, 255, 0.3);
  filter: brightness(1.1) contrast(1.1);
}

/* Improved contrast for coordinates in dark mode */
[data-theme="dark"] .chess-coordinate {
  font-weight: 700;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8),
               1px 1px 0 rgba(255, 255, 255, 0.1);
}

/* Theme toggle animation */
#theme-toggle {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
}

/* Smooth theme transition for all elements */
.chess-app, .chess-app * {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

#volume-slider {
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #ddd 0%, #ddd 100%);
  outline: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Player Info */
.player-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 480px;
  padding: 8px;
  margin: 8px 0;
}

.player-name {
  font-weight: bold;
  color: var(--text-primary);
  text-align: center;
  width: 100%;
  font-size: 1.1rem;
}

.captured-pieces {
  font-size: 1.25rem;
  letter-spacing: -0.1em;
}

/* Game Status */
.game-status {
  text-align: center;
  padding: 8px;
  font-weight: 500;
  min-height: 40px;
}

/* Modals */
.modal, .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--background-main);
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 8px 32px var(--shadow-color);
  text-align: center;
  max-width: 90%;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.modal-content h2 {
  margin-bottom: 16px;
  color: var(--primary-color);
}

.promotion-options {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.promotion-piece {
  font-size: 3rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.promotion-piece:hover {
  background-color: var(--secondary-color);
}

/* Confirmation Modal Styles */
.confirmation-modal {
  max-width: 450px;
  width: 90%;
}

.confirmation-modal h3 {
  color: var(--primary-color);
  margin-bottom: 16px;
  font-size: 1.4em;
}

.confirmation-modal p {
  margin-bottom: 24px;
  line-height: 1.5;
  color: var(--text-primary);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-buttons .btn-primary,
.modal-buttons .btn-secondary {
  min-width: 140px;
  padding: 10px 16px;
  font-size: 0.9em;
}

@media (max-width: 480px) {
  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-buttons .btn-primary,
  .modal-buttons .btn-secondary {
    width: 100%;
  }
}

/* Responsive Design */
@media (max-width: 767px) {
  .game-title {
    font-size: 1.5rem;
  }
  
  .mode-selector {
    width: 100%;
    justify-content: center;
  }
  
  .chess-board {
    width: 320px;
    height: 320px;
    border-width: 1px;
  }
  
  .chess-piece {
    font-size: 1.8rem;
  }
  
  .chess-coordinate {
    font-size: 8px;
  }
  
  .mode-controls {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .chess-board {
    width: 280px;
    height: 280px;
  }
  
  .chess-piece {
    font-size: 1.5rem;
  }
  
  .chess-coordinate {
    font-size: 7px;
  }
  
  .chess-coordinate-file {
    bottom: 1px;
    right: 1px;
  }
  
  .chess-coordinate-rank {
    top: 1px;
    left: 1px;
  }
}

/* Accessibility */
.chess-square:focus {
  outline: 2px solid #4A90E2;
  outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
  .chess-square,
  .chess-piece,
  .control-btn,
  .mode-btn {
    transition: none;
  }
  
  .check-square {
    animation: none;
    background-color: rgba(255, 0, 0, 0.6) !important;
  }
  
  .last-move-pulse {
    animation: none;
  }
}

@media (prefers-contrast: high) {
  .light-square {
    background-color: #FFFFFF;
  }
  
  .dark-square {
    background-color: #000000;
  }
  
  .chess-piece {
    font-weight: bold;
  }
  
  .chess-coordinate {
    font-weight: 900;
    text-shadow: 1px 1px 0 white, -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white;
  }
}

/* ===== RULES MODE STYLES ===== */

/* Rules Navigation */
.rules-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.rules-nav-btn {
  background-color: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--accent-color);
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
}

.rules-nav-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
}

.rules-nav-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Rules Content */
.rules-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

.rules-section {
  margin-bottom: 32px;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.rules-section h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 16px;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 8px;
}

.rules-section h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin: 24px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rules-section h4 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin: 20px 0 12px 0;
  font-weight: 600;
}

.rules-section h5 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 12px 0 8px 0;
  font-weight: 600;
}

.rules-section p {
  line-height: 1.6;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.rules-section ul, .rules-section ol {
  margin: 16px 0;
  padding-left: 24px;
}

.rules-section li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Special Content Styles */
.important-note {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 2px solid #f39c12;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  font-weight: 600;
  text-align: center;
}

.interaction-tip {
  background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
  border: 2px solid #4caf50;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  text-align: center;
}

.interaction-tip p {
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.piece-section {
  border-left: 4px solid var(--accent-color);
}

.piece-rules {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.piece-rules li {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 0;
  list-style: none;
  transition: transform 0.2s ease;
}

.piece-rules li:hover {
  transform: translateX(4px);
  background: rgba(76, 175, 80, 0.1);
}

.important-rule {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border: 2px solid #f44336;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.important-rule p {
  margin-bottom: 12px;
  font-weight: 600;
}

.strategy-note {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border: 2px solid #2196f3;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  font-style: italic;
}

.strategy-tip {
  background: linear-gradient(135deg, #f3e5f5, #e1bee7);
  border-left: 4px solid #9c27b0;
  padding: 12px;
  margin: 12px 0;
  border-radius: 4px;
}

.rule-detail {
  background: #f8f9fa;
  border-left: 4px solid var(--accent-color);
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.victory-note {
  background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  text-align: center;
  font-weight: 600;
}

/* Player Names Setup */
.player-names-setup {
  display: flex;
  gap: 15px;
  margin: 10px 0;
  padding: 15px;
  background: var(--background-secondary);
  border-radius: 8px;
  border: 2px solid var(--accent-color);
}

.player-name-input {
  flex: 1;
}

.player-name-input label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-color);
}

.player-name-input input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--background-color);
  color: var(--text-color);
  transition: border-color 0.3s ease;
}

.player-name-input input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(58, 95, 136, 0.1);
}

.player-name-input input::placeholder {
  color: var(--text-secondary);
}

/* Professional Hint System Styles */
.professional-hint-message {
  background: linear-gradient(135deg, #e8f5e8, #d4edda);
  border: 2px solid #28a745;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.professional-hint-message .hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #28a745;
}

.professional-hint-message .hint-type {
  background: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8em;
}

.professional-hint-message .hint-evaluation {
  background: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8em;
}

.professional-hint-message .hint-timestamp {
  color: #6c757d;
  font-size: 0.8em;
  font-style: italic;
}

.professional-hint-message .hint-main-message {
  font-size: 1.1em;
  margin: 12px 0;
  padding: 12px;
  background: rgba(40, 167, 69, 0.1);
  border-radius: 8px;
  border-left: 4px solid #28a745;
}

.professional-hint-message .move-details code {
  background: #f8f9fa;
  color: #495057;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  border: 1px solid #dee2e6;
}

.professional-hint-message .strategic-plan {
  margin: 12px 0;
  padding: 10px;
  background: rgba(0, 123, 255, 0.1);
  border-radius: 6px;
  border-left: 3px solid #007bff;
}

.professional-hint-message .alternative-moves {
  margin-top: 12px;
}

.professional-hint-message .alternative-moves ul {
  list-style-type: none;
  padding-left: 0;
  margin: 8px 0;
}

.professional-hint-message .alternative-moves li {
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(108, 117, 125, 0.1);
  border-radius: 6px;
  border-left: 3px solid #6c757d;
}

.professional-hint-message .alt-type {
  background: #6c757d;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: bold;
  margin-left: 4px;
}

/* Hint highlighting styles */
.hint-from {
  background: rgba(0, 255, 0, 0.6) !important;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
  animation: pulse-green 2s infinite;
}

.hint-to {
  background: rgba(0, 255, 0, 0.4) !important;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
  animation: pulse-green-light 2s infinite;
}

.hint-threat {
  background: rgba(255, 0, 0, 0.5) !important;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
}

.hint-defensive {
  background: rgba(0, 0, 255, 0.3) !important;
  box-shadow: 0 0 6px rgba(0, 0, 255, 0.5);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.5); }
  50% { box-shadow: 0 0 15px rgba(0, 255, 0, 1); }
  100% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.5); }
}

@keyframes pulse-green-light {
  0% { box-shadow: 0 0 3px rgba(0, 255, 0, 0.3); }
  50% { box-shadow: 0 0 10px rgba(0, 255, 0, 0.7); }
  100% { box-shadow: 0 0 3px rgba(0, 255, 0, 0.3); }
}

/* Piece Setup Grid */
.piece-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.piece-type {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.piece-type h4 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

/* Benefits and Lists */
.benefits-list li {
  background: #e8f5e8;
  border-left: 4px solid #4caf50;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  list-style: none;
}

.requirements-list li {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  list-style: none;
}

.castling-steps li, .enpassant-steps li {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  list-style: none;
}

.enpassant-conditions li {
  background: #fce4ec;
  border-left: 4px solid #e91e63;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  list-style: none;
}

.check-responses li, .checkmate-conditions li {
  background: #ffebee;
  border-left: 4px solid #f44336;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  list-style: none;
}

.promotion-rules li {
  background: #f3e5f5;
  border-left: 4px solid #9c27b0;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  list-style: none;
}

.castling-description {
  font-style: italic;
  color: var(--text-secondary);
  margin: 8px 0;
}

/* Promotion Options Grid */
.promotion-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.promotion-choice {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promotion-choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.piece-symbol {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.promotion-choice h5 {
  margin-bottom: 8px;
  color: var(--primary-color);
}

/* Draw Types */
.draw-types {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.draw-type {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draw-type:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.draw-type h4 {
  color: var(--primary-color);
  margin-bottom: 12px;
}

/* Time Controls Grid */
.time-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.time-control-type {
  border: 2px solid;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.time-control-type:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.time-control-type.classical {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border-color: #ffa000;
}

.time-control-type.rapid {
  background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
  border-color: #4caf50;
}

.time-control-type.blitz {
  background: linear-gradient(135deg, #fff3e0, #ffcc02);
  border-color: #ff9800;
}

.time-control-type.bullet {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border-color: #f44336;
}

.time-control-type h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.time-range {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.description {
  font-style: italic;
  margin-bottom: 12px;
}

.characteristics {
  text-align: left;
  margin-top: 12px;
}

.characteristics li {
  margin-bottom: 4px;
}

/* Time Bonus Types */
.time-bonus-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.bonus-type {
  background: linear-gradient(135deg, #f3e5f5, #e1bee7);
  border: 2px solid #9c27b0;
  border-radius: 12px;
  padding: 20px;
}

.bonus-type h4 {
  color: var(--primary-color);
  margin-bottom: 12px;
}

.example {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

/* Analysis Panel Styles */
.analysis-panel {
  position: fixed;
  top: 10%;
  right: 20px;
  width: 400px;
  max-height: 80vh;
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow-y: auto;
}

.analysis-header {
  background: var(--primary-color);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
}

.analysis-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.analysis-content {
  padding: 20px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.analysis-overview {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.stat {
  display: flex;
  justify-content: space-between;
}

.stat label {
  font-weight: 600;
}

.analysis-blunders, .analysis-tactical, .analysis-recommendations {
  margin-bottom: 20px;
}

.analysis-blunders h4, .analysis-tactical h4, .analysis-recommendations h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.blunder-item, .tactical-item, .recommendation-item {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 8px;
}

.blunder-item {
  background: #f8d7da;
  border-color: #f5c6cb;
}

.tactical-item {
  background: #d1ecf1;
  border-color: #bee5eb;
}

.eval-loss {
  color: #d32f2f;
  font-weight: bold;
}

.analysis-chart {
  margin-top: 20px;
}

.eval-graph {
  display: flex;
  align-items: end;
  height: 100px;
  border-bottom: 2px solid #ddd;
  gap: 2px;
  margin-top: 10px;
}

.eval-bar {
  flex: 1;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.eval-bar:hover {
  opacity: 0.8;
}

.example strong {
  color: var(--primary-color);
  display: block;
  margin-bottom: 4px;
}

.benefit {
  font-weight: 600;
  color: var(--accent-color);
  font-style: italic;
}

/* Clock Rules */
.clock-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.clock-rule {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.clock-rule h4 {
  color: var(--primary-color);
  margin-bottom: 8px;
}

.rules-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.rule-column {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
}

.rule-column h4 {
  color: var(--primary-color);
  margin-bottom: 16px;
  text-align: center;
}

.time-tips {
  background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
  border: 2px solid #4caf50;
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.time-tips h4 {
  color: var(--primary-color);
  margin-bottom: 16px;
  text-align: center;
}

/* Interactive Board Styles */
.interactive-board-container {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid var(--accent-color);
}

.interactive-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 1px;
  border: 3px solid var(--board-border);
  border-radius: 6px;
  overflow: hidden;
  width: 320px;
  height: 320px;
  position: relative;
}

.interactive-board .square {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}

.interactive-board .square.light {
  background-color: var(--light-square);
}

.interactive-board .square.dark {
  background-color: var(--dark-square);
}

.interactive-board .square:hover {
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.interactive-board .square.selected-piece {
  background-color: rgba(255, 255, 0, 0.7) !important;
  border: 2px solid #ff6b35;
  transform: scale(1.1);
  z-index: 3;
}

.interactive-board .square.possible-move {
  background-color: rgba(0, 255, 0, 0.4) !important;
  border: 2px solid #4caf50;
  animation: pulse-move 1.5s infinite;
}

@keyframes pulse-move {
  0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
  50% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
}

.interactive-board .square.en-passant-capture {
  background-color: rgba(255, 165, 0, 0.6) !important;
  border: 2px solid #ff9800;
  animation: flash-capture 2s infinite;
}

@keyframes flash-capture {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.interactive-board .square.promotion-square {
  background-color: rgba(156, 39, 176, 0.4) !important;
  border: 2px solid #9c27b0;
  animation: promotion-highlight 2s infinite;
}

@keyframes promotion-highlight {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.interactive-board .square.checkmate-square {
  background-color: rgba(244, 67, 54, 0.7) !important;
  border: 2px solid #f44336;
  animation: checkmate-flash 1s infinite;
}

@keyframes checkmate-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.interactive-board .square.castling-highlight {
  background-color: rgba(33, 150, 243, 0.5) !important;
  border: 2px solid #2196f3;
  animation: castling-pulse 1s infinite;
}

@keyframes castling-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(33, 150, 243, 0.6); }
  50% { box-shadow: 0 0 20px rgba(33, 150, 243, 0.9); }
}

/* Coordinate Labels */
.coordinate-label {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: none;
}

.file-label {
  bottom: 2px;
  right: 3px;
}

.rank-label {
  top: 2px;
  left: 3px;
}

/* =============================
   ENHANCED PIECE ANIMATIONS
   ============================= */

/* Smooth piece transitions */
.chess-piece {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              opacity 0.2s ease;
  will-change: transform;
}

/* Animation classes for piece movements */
.piece-moving {
  z-index: 100;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.piece-lift {
  animation: piece-lift 0.2s ease-out forwards;
}

@keyframes piece-lift {
  0% { 
    transform: scale(1) translateZ(0);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  100% { 
    transform: scale(1.1) translateZ(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

.piece-drop {
  animation: piece-drop 0.3s ease-out forwards;
}

@keyframes piece-drop {
  0% { 
    transform: scale(1.1) translateZ(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  100% { 
    transform: scale(1) translateZ(0);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* Capture animation */
.piece-captured {
  animation: piece-captured 0.4s ease-out forwards;
}

@keyframes piece-captured {
  0% { 
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% { 
    opacity: 0;
    transform: scale(0.8) rotate(20deg);
  }
}

/* Castling animation for rook */
.castling-rook {
  animation: slide-smooth 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Promotion highlight */
.promotion-glow {
  animation: promotion-glow 1s ease-in-out infinite alternate;
}

@keyframes promotion-glow {
  0% { 
    box-shadow: 0 0 5px rgba(156, 39, 176, 0.5);
    transform: scale(1);
  }
  100% { 
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.8);
    transform: scale(1.05);
  }
}

/* Smooth square highlighting transitions */
.chess-square {
  transition: background-color 0.2s ease, 
              box-shadow 0.2s ease,
              filter 0.2s ease;
}

/* Enhanced hover effects */
.chess-square:hover .chess-piece {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* Move trail effect */
.move-trail {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, 
    rgba(52, 152, 219, 0.3) 0%, 
    transparent 70%);
  border-radius: 50%;
  animation: trail-fade 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes trail-fade {
  0% { 
    opacity: 1;
    transform: scale(0.5);
  }
  100% { 
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Piece selection pulse */
.selected-square .chess-piece {
  animation: selection-pulse 1.5s ease-in-out infinite;
}

@keyframes selection-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Smooth transitions for possible moves */
.possible-move {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.possible-move::after {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Legacy animation class (enhanced) */
.animate-piece {
  animation: enhanced-piece-move 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes enhanced-piece-move {
  0% { 
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: scale(1.15) rotate(2deg);
  }
  75% {
    transform: scale(1.05) rotate(-1deg);
  }
  100% { 
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Special Examples */
.castling-example, .en-passant-example, .promotion-example {
  margin: 20px 0;
  text-align: center;
}

.castling-example p, .en-passant-example p, .promotion-example p {
  margin-top: 12px;
  font-style: italic;
  color: var(--text-secondary);
}

/* Mobile Responsiveness for Rules */
@media (max-width: 768px) {
  .rules-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  
  .rules-nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .rules-section {
    padding: 16px;
    margin-bottom: 20px;
  }
  
  .rules-section h2 {
    font-size: 1.6rem;
  }
  
  .rules-section h3 {
    font-size: 1.3rem;
  }
  
  .interactive-board {
    width: 280px;
    height: 280px;
  }
  
  .interactive-board .square {
    font-size: 1.5rem;
  }
  
  .piece-setup-grid,
  .promotion-options-grid,
  .time-controls-grid,
  .time-bonus-types,
  .rules-columns {
    grid-template-columns: 1fr;
  }
  
  .draw-types {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .interactive-board {
    width: 240px;
    height: 240px;
  }
  
  .interactive-board .square {
    font-size: 1.2rem;
  }
  
  .coordinate-label {
    font-size: 8px;
  }
}

/* ======================
   COACH INTEGRATION STYLES
   ====================== */

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--background-light);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

/* Centered Game Controls */
.centered-game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Right-aligned Coach Controls */
.coach-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  transform: translateY(0);
}

.coach-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.analysis-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.analysis-btn:hover {
  background: linear-gradient(135deg, #2980b9, #21618c);
}

.strategy-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.strategy-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
}

.tactical-btn {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
}

.tactical-btn:hover {
  background: linear-gradient(135deg, #e67e22, #d68910);
}

/* Advanced Controls */
.advanced-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.export-btn {
  background: linear-gradient(135deg, #27ae60, #229954) !important;
  color: white !important;
}

.export-btn:hover {
  background: linear-gradient(135deg, #229954, #1e8449) !important;
}

.import-btn {
  background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
  color: white !important;
}

.import-btn:hover {
  background: linear-gradient(135deg, #8e44ad, #7d3c98) !important;
}

.analyze-btn {
  background: linear-gradient(135deg, #e67e22, #d35400) !important;
  color: white !important;
}

.analyze-btn:hover {
  background: linear-gradient(135deg, #d35400, #ba4a00) !important;
}

/* Coach Analysis Panel */
.coach-analysis-panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.analysis-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 5px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 10px 15px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: white;
  color: #2c3e50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.7);
  color: #2c3e50;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h4 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.1rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 8px;
}

/* Analysis Items */
.evaluation-item, .strategy-item, .tactical-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
  transition: all 0.3s ease;
}

.evaluation-item:hover, .strategy-item:hover, .tactical-item:hover {
  background: #ecf0f1;
  transform: translateX(5px);
  cursor: pointer;
}

.strategy-item {
  border-left-color: #e74c3c;
}

.tactical-item {
  border-left-color: #f39c12;
}

.priority-high {
  border-left-color: #e74c3c !important;
  background: linear-gradient(90deg, rgba(231, 76, 60, 0.05), transparent) !important;
}

.priority-medium {
  border-left-color: #f39c12 !important;
  background: linear-gradient(90deg, rgba(243, 156, 18, 0.05), transparent) !important;
}

.evaluation-icon, .strategy-icon, .tactical-icon {
  font-size: 1.2rem;
  min-width: 20px;
}

.evaluation-text, .strategy-text, .tactical-text {
  flex: 1;
  line-height: 1.4;
  color: #2c3e50;
  font-size: 0.95rem;
}

/* Square Highlighting for Coach */
.coach-suggestion {
  background: rgba(52, 152, 219, 0.3) !important;
  border: 2px solid #3498db !important;
  animation: coach-pulse 2s infinite;
}

@keyframes coach-pulse {
  0%, 100% { 
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
  }
  50% { 
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
  }
}

/* Responsive Adjustments for Coach Features */
@media (max-width: 768px) {
  .coach-analysis,
  .advanced-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .coach-btn,
  .advanced-controls .control-btn {
    width: 100%;
    justify-content: center;
  }
  
  .analysis-tabs {
    flex-direction: column;
    gap: 2px;
  }
  
  .tab-btn {
    padding: 12px;
    text-align: center;
  }
}

/* Post-Game Actions */
.post-game-actions {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}

.post-game-actions h4 {
  margin: 0 0 15px 0;
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
}

.post-game-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.post-game-btn {
  padding: 10px 16px;
  border: 1px solid #6c757d;
  border-radius: 6px;
  background: #ffffff;
  color: #6c757d;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.post-game-btn:hover {
  background: #f8f9fa;
  border-color: #495057;
  color: #495057;
  opacity: 1;
  transform: translateY(-1px);
}

.post-game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.post-game-btn.export-btn:hover {
  border-color: #27ae60;
  color: #27ae60;
}

.post-game-btn.import-btn:hover {
  border-color: #9b59b6;
  color: #9b59b6;
}

.post-game-btn.analyze-btn:hover {
  border-color: #e67e22;
  color: #e67e22;
}

/* Messages Container */
.messages-container {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin: 15px 0;
  max-height: 200px;
  overflow: hidden;
}

.messages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.messages-header h4 {
  margin: 0;
  color: #495057;
  font-size: 0.9rem;
  font-weight: 600;
}

.clear-messages-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.clear-messages-btn:hover {
  background: #e9ecef;
}

.messages-list {
  max-height: 150px;
  overflow-y: auto;
  padding: 0;
}

.welcome-message, .coach-message, .hint-message, .draw-message {
  padding: 8px 15px;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
}

.welcome-message {
  background: #e7f3ff;
}

.coach-message {
  background: #f0f8f0;
}

.hint-message {
  background: #fff3cd;
}

.draw-message {
  background: #e8f0fe;
  border-left: 4px solid #1976d2;
  font-weight: 600;
}

/* Dark mode message styling */
[data-theme="dark"] .welcome-message {
  background: #1e3a5f;
  color: var(--text-primary);
}

[data-theme="dark"] .coach-message {
  background: #1e4620;
  color: var(--text-primary);
}

[data-theme="dark"] .hint-message {
  background: #3d3619;
  color: var(--text-primary);
}

[data-theme="dark"] .draw-message {
  background: #1a2332;
  color: var(--text-primary);
  border-left-color: #5a7fa8;
}

/* Educational Hint Messages */
.educational-hint-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px solid #5a6fd8;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  color: white;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  animation: hintSlideIn 0.5s ease-out;
}

.hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 8px;
}

.hint-phase {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

.hint-timestamp {
  font-size: 11px;
  opacity: 0.8;
  font-family: 'Courier New', monospace;
}

.hint-explanation {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.strategic-goals, .phase-guidance, .alternative-moves, .learning-objectives {
  margin: 12px 0;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border-left: 4px solid rgba(255,255,255,0.5);
}

.strategic-goals ul, .phase-guidance ul, .alternative-moves ul, .learning-objectives ul {
  margin: 8px 0;
  padding-left: 20px;
}

.strategic-goals li, .phase-guidance li, .alternative-moves li, .learning-objectives li {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.4;
}

.alternative-moves code {
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

/* Dark theme adjustments for educational hints */
[data-theme="dark"] .educational-hint-message {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-color: #4a5568;
  box-shadow: 0 4px 15px rgba(74, 85, 104, 0.4);
}

[data-theme="dark"] .strategic-goals, 
[data-theme="dark"] .phase-guidance, 
[data-theme="dark"] .alternative-moves, 
[data-theme="dark"] .learning-objectives {
  background: rgba(255,255,255,0.1);
  border-left-color: rgba(255,255,255,0.3);
}

[data-theme="dark"] .alternative-moves code {
  background: rgba(255,255,255,0.15);
  color: #e2e8f0;
}

/* Hint highlighting styles */
.hint-from {
  background-color: rgba(46, 204, 113, 0.7) !important;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

.hint-to {
  background-color: rgba(52, 152, 219, 0.7) !important;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.hint-threat {
  background-color: rgba(231, 76, 60, 0.6) !important;
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.4);
}

.hint-defensive {
  background-color: rgba(155, 89, 182, 0.6) !important;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.4);
}

/* Animation for educational hints */
@keyframes hintSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Game mode selector and 2-player enhancements */
.game-mode-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 15px;
}

.game-mode-selector label {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.game-mode-selector select {
  padding: 8px 12px;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  background: var(--background-secondary);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-mode-selector select:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(90, 127, 168, 0.3);
}

/* Current player indicator */
.current-player-indicator {
  margin-top: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 25px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(90, 127, 168, 0.3);
  animation: playerIndicatorPulse 2s ease-in-out infinite;
}

.current-player-indicator span {
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Player status indicators */
.player-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  text-align: center;
  margin-top: 5px;
  transition: all 0.3s ease;
}

.player-status.active {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
  animation: statusPulse 1.5s ease-in-out infinite;
}

.player-status.waiting {
  background: rgba(149, 165, 166, 0.3);
  color: var(--text-secondary);
}

.player-status.thinking {
  background: linear-gradient(135deg, #3498db, #5dade2);
  color: white;
  animation: thinkingPulse 1s ease-in-out infinite;
}

/* Enhanced player info for 2-player mode */
.player-info.player-white-active {
  border: 3px solid #f1c40f;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
  background: rgba(241, 196, 15, 0.05);
}

.player-info.player-black-active {
  border: 3px solid #e74c3c;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
  background: rgba(231, 76, 60, 0.05);
}

/* Animations */
@keyframes playerIndicatorPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes thinkingPulse {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* 2-Player specific styling */
.two-player-mode .player-info {
  transition: all 0.3s ease;
}

.player-info.active-player {
  border-color: #4a90e2 !important;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.15), var(--card-bg)) !important;
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.4) !important;
  transform: scale(1.02);
  animation: activePlayerPulse 2s ease-in-out infinite;
}

@keyframes activePlayerPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(74, 144, 226, 0.4); }
  50% { box-shadow: 0 0 20px rgba(74, 144, 226, 0.6); }
}

.two-player-mode .player-name {
  font-size: 1.1rem;
  font-weight: bold;
}

.two-player-mode #hint-btn {
  display: none; /* Hide hint button in 2-player mode */
}

/* Dark theme adjustments for 2-player features */
[data-theme="dark"] .current-player-indicator {
  background: linear-gradient(135deg, #4a5568, #2d3748);
  box-shadow: 0 4px 15px rgba(74, 85, 104, 0.4);
}

[data-theme="dark"] .player-status.active {
  background: linear-gradient(135deg, #48bb78, #38a169);
}

[data-theme="dark"] .player-status.thinking {
  background: linear-gradient(135deg, #4299e1, #3182ce);
}

[data-theme="dark"] .player-info.player-white-active {
  border-color: #fbd38d;
  box-shadow: 0 0 15px rgba(251, 211, 141, 0.4);
  background: rgba(251, 211, 141, 0.1);
}

[data-theme="dark"] .player-info.player-black-active {
  border-color: #fc8181;
  box-shadow: 0 0 15px rgba(252, 129, 129, 0.4);
  background: rgba(252, 129, 129, 0.1);
}

.message-time {
  color: #6c757d;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.message-content {
  color: #495057;
  line-height: 1.4;
}

/* Responsive for Post-Game */
@media (max-width: 768px) {
  .post-game-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .post-game-btn {
    width: 100%;
    justify-content: center;
  }
  
  .game-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .centered-game-controls {
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .coach-controls {
    justify-content: center;
  }
}