/* Chess Tutor Button */
.chess-tutor-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  z-index: 1000;
}

.chess-tutor-button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.chess-tutor-button svg {
  width: 18px;
  height: 18px;
}

.chess-tutor-button.active {
  background-color: #2ecc71;
}

@media (max-width: 768px) {
  .chess-tutor-button {
    bottom: 10px;
    right: 10px;
    padding: 8px 12px;
  }
  
  .chess-tutor-button span {
    display: none;
  }
  
  .chess-tutor-button svg {
    margin-right: 0;
  }
}

/* Animation for the button */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.chess-tutor-button.pulse {
  animation: pulse 1.5s infinite;
}

/* Panel highlight effect */
@keyframes highlightPanel {
  0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

.tutelage-panel.highlight-panel {
  animation: highlightPanel 1.5s ease-out;
}

/* Counter Moves Styles */
.counter-moves {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.counter-moves h5 {
  margin-top: 0;
  color: #3498db;
  margin-bottom: 10px;
}

.counter-moves h6 {
  margin-top: 15px;
  margin-bottom: 10px;
  color: #2c3e50;
}

.counter-moves-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.counter-move-item {
  padding: 8px;
  background-color: #f8f9fa;
  border-left: 3px solid #3498db;
  margin-bottom: 8px;
  border-radius: 0 4px 4px 0;
}

.counter-move-item:hover {
  background-color: #eef2f7;
}

.counter-move-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.counter-move-title {
  font-weight: bold;
}

.counter-move-actions {
  display: flex;
  gap: 5px;
}

.counter-move-action {
  cursor: pointer;
  color: #7f8c8d;
  transition: color 0.2s;
}

.counter-move-action:hover {
  color: #3498db;
}

.counter-move-action.delete:hover {
  color: #e74c3c;
}

.counter-move-details {
  font-size: 0.9em;
  color: #7f8c8d;
}

.counter-move-note {
  font-style: italic;
  margin-top: 5px;
  font-size: 0.9em;
}

.counter-move-form {
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
}

.form-row {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.form-row label {
  margin-bottom: 5px;
  font-size: 0.9em;
  color: #2c3e50;
}

.form-row input {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#add-counter-move {
  width: 100%;
  padding: 8px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

#add-counter-move:hover {
  background-color: #2980b9;
}

.success-message {
  background-color: rgba(46, 204, 113, 0.1);
  border-left: 3px solid #2ecc71;
  padding: 8px;
  margin-top: 10px;
  border-radius: 0 4px 4px 0;
  animation: fadeOut 3s forwards;
  animation-delay: 2s;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Chess Tutor Assistant Styles */
.chess-tutor-assistant {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 450px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: all 0.3s ease;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chess-tutor-assistant.minimized {
  height: 50px;
}

.chess-tutor-assistant.hidden {
  transform: translateY(calc(100% + 20px));
}

.tutor-header {
  background-color: #2c3e50;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.tutor-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

.tutor-title i {
  font-size: 18px;
}

.tutor-controls {
  display: flex;
  gap: 8px;
}

.tutor-controls button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.tutor-controls button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.tutor-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background-color: #f8f9fa;
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 18px;
  line-height: 1.4;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.message.tutor {
  background-color: #e9ecef;
  color: #212529;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.message.user {
  background-color: #3498db;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.message.thinking {
  background-color: #e9ecef;
  color: #6c757d;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dots span {
  width: 8px;
  height: 8px;
  background-color: #6c757d;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.message-time {
  font-size: 0.7em;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
}

.tutor-footer {
  padding: 10px 15px;
  background-color: #fff;
  display: flex;
  gap: 10px;
  border-top: 1px solid #e9ecef;
}

.tutor-input {
  flex: 1;
  padding: 8px 15px;
  border: 1px solid #ced4da;
  border-radius: 20px;
  outline: none;
  transition: border-color 0.2s;
}

.tutor-input:focus {
  border-color: #3498db;
}

.send-btn {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.send-btn:hover {
  background-color: #2980b9;
}

.send-btn i {
  font-size: 14px;
}

.open-chess-tutor {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 999;
  font-weight: bold;
}

.open-chess-tutor:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.open-chess-tutor.hidden {
  transform: scale(0);
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .chess-tutor-assistant {
    width: 90%;
    height: 400px;
    bottom: 10px;
    right: 5%;
  }
  
  .open-chess-tutor {
    bottom: 10px;
    right: 10px;
    padding: 8px 15px;
  }
  
  .open-chess-tutor span {
    display: none;
  }
}

/* Chess Advice Box Styles */
.chess-advice-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.chess-advice-box.hidden {
  transform: translateY(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

.advice-header {
  background-color: #2c3e50;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.advice-title {
  font-weight: bold;
  font-size: 16px;
}

.advice-controls button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.advice-content {
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}

#advice-message {
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}

.advice-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.advice-option {
  padding: 10px;
  background-color: #f1f5f9;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
}

.advice-option:hover {
  background-color: #e2e8f0;
}

.option-number {
  font-weight: bold;
  margin-right: 8px;
  color: #3498db;
  min-width: 20px;
}

.option-text {
  flex: 1;
}

.advice-footer {
  padding: 10px 15px;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
}

#new-advice-btn {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

#new-advice-btn:hover {
  background-color: #2980b9;
}

/* Chess Tutor Button */
.chess-tutor-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 999;
  font-weight: bold;
}

.chess-tutor-btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.chess-tutor-btn.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chess-tutor-btn i {
  font-size: 18px;
}

/* Button styles for the assistant */
.make-move-btn {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  margin-top: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.make-move-btn:hover {
  background-color: #2980b9;
}

/* Flashing effect for the button */
@keyframes flash {
  0%, 100% {
    background-color: #3498db;
  }
  50% {
    background-color: #e74c3c;
  }
}

.chess-tutor-btn.flashing {
  animation: flash 1s infinite;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .chess-advice-box {
    width: 90%;
    right: 5%;
  }
  
  .chess-tutor-btn {
    bottom: 10px;
    right: 10px;
    padding: 8px 15px;
  }
  
  .chess-tutor-btn span {
    display: none;
  }
}

/* Chess Queue System Styles */
.matchmaking-panel {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.matchmaking-panel h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.matchmaking-status {
    font-weight: bold;
    margin: 10px 0;
    color: #2196F3;
}

.player-count {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.matchmaking-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.queue-position {
    margin: 10px 0;
    font-size: 0.9em;
}

.match-info {
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 5px;
    padding: 10px;
    margin-top: 15px;
}

.match-status, .match-color {
    margin: 5px 0;
}

/* Chat window styles */
#chess-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 400px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.chat-header {
    padding: 10px;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.my-message {
    background-color: #DCF8C6;
    align-self: flex-end;
    margin-left: auto;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.opponent-message {
    background-color: #F2F2F2;
    align-self: flex-start;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.system-message {
    margin: 5px 0;
    padding: 5px 10px;
    border-radius: 10px;
    background-color: #f0f0f0;
    color: #666;
    font-style: italic;
    text-align: center;
    font-size: 0.9em;
    align-self: center;
    max-width: 90%;
}

/* Pulse animation for notifications */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.pulse {
    animation: pulse 1.5s infinite;
}
