/* AI Profile Panel Styling */
.ai-profile-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  margin: 20px 0;
  overflow: hidden;
  font-family: 'Roboto', sans-serif;
  transition: all 0.3s ease;
  position: relative;
}

/* Personality-specific styling */
.ai-profile-panel.aggressive {
  border-left: 5px solid #e74c3c;
}

.ai-profile-panel.defensive {
  border-left: 5px solid #3498db;
}

.ai-profile-panel.positional {
  border-left: 5px solid #2ecc71;
}

.ai-profile-panel.tactical {
  border-left: 5px solid #f39c12;
}

.ai-profile-panel.balanced {
  border-left: 5px solid #9b59b6;
}

.ai-profile-panel.hypermodern {
  border-left: 5px solid #1abc9c;
}

.ai-profile-panel.dynamic {
  border-left: 5px solid #e67e22;
}

.profile-header {
  display: flex;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Personality-specific header backgrounds */
.ai-profile-panel.aggressive .profile-header {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.ai-profile-panel.defensive .profile-header {
  background: linear-gradient(135deg, #2980b9, #3498db);
}

.ai-profile-panel.positional .profile-header {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.ai-profile-panel.tactical .profile-header {
  background: linear-gradient(135deg, #d35400, #f39c12);
}

.ai-profile-panel.balanced .profile-header {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
}

.ai-profile-panel.hypermodern .profile-header {
  background: linear-gradient(135deg, #16a085, #1abc9c);
}

.ai-profile-panel.dynamic .profile-header {
  background: linear-gradient(135deg, #d35400, #e67e22);
}

/* Chess pattern overlay for header */
.profile-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  opacity: 0.3;
  z-index: 1;
}

.profile-header * {
  position: relative;
  z-index: 2;
}

/* Chess Chat 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: 5px 0;
  padding: 8px 12px;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
}

.opponent-message {
  background-color: #F2F2F2;
  align-self: flex-start;
  margin: 5px 0;
  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%;
}

#minimize-chat {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

.chat-input-container {
  padding: 10px;
  border-top: 1px solid #ccc;
  display: flex;
}

#chat-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-right: 5px;
}

#send-chat {
  padding: 8px 12px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#send-chat:hover {
  background-color: #45a049;
}


.profile-title {
  flex: 1;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.profile-title h3 {
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 700;
}

.personality-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(5px);
}

#personality-icon {
  margin-right: 5px;
}

.profile-content {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.profile-content::-webkit-scrollbar {
  width: 6px;
}

.profile-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.profile-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.profile-section {
  margin-bottom: 25px;
}

.profile-section h4 {
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
}

/* Personality-specific section headers */
.ai-profile-panel.aggressive .profile-section h4 {
  border-bottom-color: rgba(231, 76, 60, 0.3);
}

.ai-profile-panel.defensive .profile-section h4 {
  border-bottom-color: rgba(52, 152, 219, 0.3);
}

.ai-profile-panel.positional .profile-section h4 {
  border-bottom-color: rgba(46, 204, 113, 0.3);
}

.ai-profile-panel.tactical .profile-section h4 {
  border-bottom-color: rgba(243, 156, 18, 0.3);
}

.ai-profile-panel.balanced .profile-section h4 {
  border-bottom-color: rgba(155, 89, 182, 0.3);
}

.ai-profile-panel.hypermodern .profile-section h4 {
  border-bottom-color: rgba(26, 188, 156, 0.3);
}

.ai-profile-panel.dynamic .profile-section h4 {
  border-bottom-color: rgba(230, 126, 34, 0.3);
}

.personality-description {
  line-height: 1.6;
  color: #555;
  font-size: 14px;
}

.strengths-weaknesses {
  display: flex;
  gap: 20px;
}

.strengths,
.weaknesses {
  flex: 1;
}

.strengths h5,
.weaknesses h5 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 15px;
  font-weight: 600;
}

.strengths h5::before {
  content: "✓ ";
  color: #27ae60;
}

.weaknesses h5::before {
  content: "✗ ";
  color: #e74c3c;
}

#ai-strengths,
#ai-weaknesses {
  margin: 0;
  padding-left: 20px;
  color: #555;
  font-size: 13px;
}

#ai-strengths li,
#ai-weaknesses li {
  margin-bottom: 5px;
}

.skill-bars {
  margin-top: 10px;
}

.skill-bar {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.skill-name {
  width: 100px;
  min-height: 20px;
  font-size: 12px;
  color: #555;
}

.bar-container {
  flex: 1;
  height: 25px;
  background: #f0f0f0;
  border-radius: 5px;
  overflow: hidden;
}

.bar {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease-in-out;
}

/* Personality-specific skill bars */
.ai-profile-panel.aggressive .bar {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.ai-profile-panel.defensive .bar {
  background: linear-gradient(90deg, #2980b9, #3498db);
}

.ai-profile-panel.positional .bar {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.ai-profile-panel.tactical .bar {
  background: linear-gradient(90deg, #d35400, #f39c12);
}

.ai-profile-panel.balanced .bar {
  background: linear-gradient(90deg, #8e44ad, #9b59b6);
}

.ai-profile-panel.hypermodern .bar {
  background: linear-gradient(90deg, #16a085, #1abc9c);
}

.ai-profile-panel.dynamic .bar {
  background: linear-gradient(90deg, #d35400, #e67e22);
}

.opening-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.opening-tag {
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 13px;
  color: #fff;
  background: #7f8c8d;
  transition: transform 0.2s;
}

.opening-tag:hover {
  transform: translateY(-2px);
}

/* Personality-specific opening tags */
.ai-profile-panel.aggressive .opening-tag {
  background: #e74c3c;
}

.ai-profile-panel.defensive .opening-tag {
  background: #3498db;
}

.ai-profile-panel.positional .opening-tag {
  background: #2ecc71;
}

.ai-profile-panel.tactical .opening-tag {
  background: #f39c12;
}

.ai-profile-panel.balanced .opening-tag {
  background: #9b59b6;
}

.ai-profile-panel.hypermodern .opening-tag {
  background: #1abc9c;
}

.ai-profile-panel.dynamic .opening-tag {
  background: #e67e22;
}

/* Expand button for modal view */
.expand-profile {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.expand-profile:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* Modal styling */
.profile-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.profile-modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: white;
  width: 80%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  display: flex;
  align-items: center;
  position: relative;
}

.modal-title {
  flex: 1;
}

.modal-title h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  color: #333;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

.modal-body {
  padding: 0 20px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}

.modal-section {
  margin-bottom: 30px;
}

.modal-section h3 {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  color: #2c3e50;
}

.modal-footer {
  padding: 15px 20px;
  background: #f9f9f9;
  text-align: right;
  border-top: 1px solid #eee;
}

.modal-footer button {
  padding: 8px 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-footer button:hover {
  background: #2980b9;
}

/* Personality quote styling */
.personality-quote {
  font-style: italic;
  color: #555;
  padding: 15px;
  border-left: 3px solid #ccc;
  margin: 15px 0;
  background: #f9f9f9;
  position: relative;
}

.personality-quote::before {
  content: '"';
  font-size: 40px;
  color: #ddd;
  position: absolute;
  left: 5px;
  top: -5px;
}

/* Personality-specific quotes */
.ai-profile-panel.aggressive .personality-quote {
  border-left-color: #e74c3c;
}

.ai-profile-panel.defensive .personality-quote {
  border-left-color: #3498db;
}

.ai-profile-panel.positional .personality-quote {
  border-left-color: #2ecc71;
}

.ai-profile-panel.tactical .personality-quote {
  border-left-color: #f39c12;
}

.ai-profile-panel.balanced .personality-quote {
  border-left-color: #9b59b6;
}

.ai-profile-panel.hypermodern .personality-quote {
  border-left-color: #1abc9c;
}

.ai-profile-panel.dynamic .personality-quote {
  border-left-color: #e67e22;
}

/* Opponent change animation */
@keyframes profileChange {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  40% {
    /* Extended fade-out phase */
    transform: translateY(10px);
    opacity: 0;
  }

  60% {
    /* Hold at invisible state for content swap */
    transform: translateY(-10px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.ai-profile-panel.changing {
  animation: profileChange 1.2s ease-in-out;
  /* Slightly longer animation */
}


/* Loading overlay */
.opponent-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: 12px;
  opacity: 1;
  transition: opacity 0.5s;
}

.opponent-loading-overlay.fade-out {
  opacity: 0;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: white;
  font-size: 18px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Animation for skill bars */
@keyframes skillBarFill {
  from {
    width: 0;
  }

  to {
    width: var(--target-width);
  }
}

.bar.animate {
  animation: skillBarFill 1s forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .strengths-weaknesses {
    flex-direction: column;
  }

  .modal-header {
    flex-direction: column;
    text-align: center;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}

/* New opponent notification */
.opponent-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 300px;
}

.opponent-notification.active {
  transform: translateX(0);
}

.notification-content {
  display: flex;
  align-items: center;
}

.notification-content i {
  font-size: 24px;
  margin-right: 15px;
}

.notification-text {
  flex: 1;
}

.notification-details {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.promotion-dialog {
  display: flex;
  flex-direction: column;
  background-color: white;
  border: 2px solid black;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.promotion-button {
  width: 100%;
  height: 30px;
  border: none;
  border-bottom: 1px solid #ccc;
  background-color: white;
  cursor: pointer;
  font-size: 20px;
  transition: background-color 0.2s;
}

.promotion-button:hover {
  background-color: #f0f0f0;
}

.promotion-button:last-child {
  border-bottom: none;
}

/* Buckets Modal Styles */
#buckets-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#buckets-modal .modal-content {
  background-color: #f8f9fa;
  margin: 5% auto;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 80%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  color: #333;
}

#buckets-modal h2 {
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 24px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

#buckets-modal .close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #7f8c8d;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

#buckets-modal .close:hover {
  color: #e74c3c;
}

#buckets-modal .buckets-info {
  background-color: #eaf2f8;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #3498db;
}

#buckets-modal .buckets-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.bucket-card {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.bucket-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.bucket-card.new {
  border-top: 4px solid #e74c3c;
}

.bucket-card.learning {
  border-top: 4px solid #f39c12;
}

.bucket-card.reviewing {
  border-top: 4px solid #f1c40f;
}

.bucket-card.mastered {
  border-top: 4px solid #2ecc71;
}

.bucket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bucket-header h4 {
  margin: 0;
  font-size: 18px;
  color: #2c3e50;
}

.bucket-count {
  background-color: #ecf0f1;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 14px;
  color: #7f8c8d;
}

.bucket-description {
  color: #7f8c8d;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.4;
}

.bucket-progress {
  position: relative;
  height: 8px;
  background-color: #ecf0f1;
  border-radius: 4px;
  overflow: hidden;
}

.bucket-progress .progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.new .progress-bar {
  background-color: #e74c3c;
}

.learning .progress-bar {
  background-color: #f39c12;
}

.reviewing .progress-bar {
  background-color: #f1c40f;
}

.mastered .progress-bar {
  background-color: #2ecc71;
}

.progress-text {
  position: absolute;
  right: 5px;
  top: -5px;
  font-size: 12px;
  color: #7f8c8d;
}

#buckets-modal .buckets-stats {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

#buckets-modal .buckets-stats h3 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.stat-item {
  text-align: center;
}

.stat-label {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
}

.buckets-chart-container {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #buckets-modal .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 15px;
  }

  #buckets-modal .buckets-container {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .buckets-chart-container {
    height: 250px;
  }
}

/* Button styling */
#view-buckets-btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

#view-buckets-btn:hover {
  background-color: #2980b9;
}

.buckets-actions {
  margin-top: 20px;
  text-align: right;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.danger-button {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.danger-button:hover {
  background-color: #d32f2f;
}

.learning-data-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.learning-data-content {
  position: relative;
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  width: 80%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-height: 80vh;
  overflow-y: auto;
}

.learning-data-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.learning-data-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.learning-data-tab {
  padding: 8px 15px;
  cursor: pointer;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-bottom: none;
  margin-right: 5px;
  margin-bottom: 5px;
  border-radius: 5px 5px 0 0;
}

.learning-data-tab.active {
  background-color: #fff;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
}

.learning-data-section {
  display: none;
}

.learning-data-section.active {
  display: block;
}

.learning-data-table {
  width: 100%;
  border-collapse: collapse;
}

.learning-data-table th,
.learning-data-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.learning-data-table th {
  background-color: #f2f2f2;
}

.learning-data-table tr:hover {
  background-color: #f5f5f5;
}

.profile-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.profile-id {
  font-size: 0.9em;
  color: #7f8c8d;
}

.profile-rating {
  font-weight: bold;
  color: #2c3e50;
}

.profile-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-label {
  font-size: 0.8em;
  color: #7f8c8d;
}

.stat-value {
  font-size: 1.2em;
  font-weight: bold;
  color: #2c3e50;
}

.profile-playstyle {
  margin-bottom: 20px;
}

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

.playstyle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.playstyle-item {
  display: flex;
  align-items: center;
}

.playstyle-label {
  width: 80px;
  font-size: 0.9em;
}

.playstyle-bar {
  flex-grow: 1;
  height: 8px;
  background-color: #ecf0f1;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 10px;
}

.playstyle-fill {
  height: 100%;
  background-color: #3498db;
}

.playstyle-value {
  width: 40px;
  font-size: 0.9em;
  text-align: right;
}

.profile-openings {
  margin-bottom: 10px;
}

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

.opening-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.opening-name {
  font-size: 0.9em;
}

.opening-frequency {
  font-size: 0.9em;
  color: #7f8c8d;
}

.adaptive-settings {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
}

.adaptive-settings h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.settings-item {
  display: flex;
  align-items: center;
}

.settings-item label {
  width: 120px;
  font-size: 0.9em;
}

.settings-item input {
  flex-grow: 1;
  margin: 0 10px;
}

.settings-item span {
  width: 50px;
  font-size: 0.9em;
  text-align: right;
}

.milestone-list {
  list-style-type: none;
  padding: 0;
}

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

.milestone-item.achieved {
  background-color: rgba(46, 204, 113, 0.1);
  border-left-color: #2ecc71;
}

.milestone-date {
  font-size: 0.8em;
  color: #7f8c8d;
}

.progress-chart {
  height: 200px;
  margin: 20px 0;
}


.castling-move {
  background-color: #4CAF50 !important;
  /* Green */
  position: relative;
}

.castling-move::after {
  content: "♜";
  /* Rook symbol */
  position: absolute;
  font-size: 10px;
  bottom: 2px;
  right: 2px;
  opacity: 0.7;
}

.skill-level-info {
  margin-top: 8px;
  padding: 8px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.05);
}

.skill-level-header {
  margin-bottom: 5px;
}

.skill-accuracy {
  color: #2ecc71;
  font-weight: 500;
}

.skill-level-details {
  font-size: 0.9em;
  color: #c5c1c1;
  line-height: 1.4;
}

.skill-detail {
  display: inline-block;
  margin-right: 10px;
  font-size: 0.85em;
}

/* Fix for AI profile panel vertical spacing */
.ai-profile-panel .profile-section {
  margin-bottom: 25px !important;
  min-height: 20px;
  padding-bottom: 15px !important;
}

.ai-profile-panel .skill-bar {
  margin-bottom: 20px !important;
  display: flex !important;
  align-items: center !important;
}

.ai-profile-panel .skill-name {
  width: 100px !important;
  min-height: 20px;
  background-color: #ffffff;
  display: inline-block !important;
}

.ai-profile-panel .bar-container {
  flex: 1 !important;
  height: 10px !important;
}

.ai-profile-panel .strengths-weaknesses {
  display: flex !important;
  flex-direction: row !important;
  gap: 20px !important;
}

.ai-profile-panel .strengths,
.ai-profile-panel .weaknesses {
  flex: 1 !important;
}