/* ===== 全局样式 ===== */
:root {
  /* Class颜色 */
  --attack-color: #e74c3c;
  --attack-light: #ffebee;
  --tank-color: #3498db;
  --tank-light: #e3f2fd;
  --utility-color: #2ecc71;
  --utility-light: #e8f5e9;

  /* 中性色 */
  --bg-dark: #2c3e50;
  --bg-light: #ecf0f1;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --border-color: #ddd;
  --white: #ffffff;

  /* 阴影和边框 */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.2);
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  line-height: 1.45;
  display: flex;
  padding: 0;
  margin: 0;
  color: var(--text-dark);
}

/* ===== 导航栏样式 ===== */
.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.sidebar-tagline {
  font-size: 12px;
  color: #999;
}

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

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.nav-item {
  display: block;
  padding: 10px 15px;
  margin-bottom: 5px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s;
  cursor: pointer;
}

.nav-item:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  transform: translateX(5px);
}

.nav-item.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.nav-item-text {
  font-size: 14px;
  font-weight: 500;
}

.nav-item-badge {
  float: right;
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active .nav-item-badge {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
  font-size: 11px;
  color: #999;
  text-align: center;
}

/* External Links Grid Layout */
#sidebarLinksContainer {
  display: grid;
  grid-template-columns: repeat(var(--links-per-row, 1), 1fr);
  gap: 5px;
  justify-items: var(--links-align, center);
}

/* 语言选择器样式 */
.language-selector {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-selector:hover {
  border-color: #667eea;
}

.language-selector:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.language-selector option {
  padding: 8px;
}

/* ===== 主内容区域 ===== */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  animation: fadeIn 0.5s ease;
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    border-radius: 0;
  }

  .main-content {
    margin-left: 0;
  }

  body {
    flex-direction: column;
  }

  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .creatures-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
  }
}

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

/* ===== 页面头部 ===== */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--bg-light);
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 15px;
}

.stats-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ===== Section 通用样式 ===== */
.section {
  margin-bottom: 30px;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-dark);
}

/* ===== Control Slots 指示器 ===== */
.slots-section {
  background: var(--bg-light);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 30px;
}

.slots-indicator {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.slots-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dark);
}

.slots-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.slots-status {
  margin-left: 10px;
  font-size: 1rem;
}

.slots-bar-container {
  width: 100%;
  height: 30px;
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.slots-bar {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
}

.slots-bar.under { background: #f39c12; }
.slots-bar.full { background: var(--utility-color); }
.slots-bar.over { background: var(--attack-color); }

/* ===== 已选择生物 ===== */
.selected-creatures {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.selected-creature {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 10px;
  padding: 15px;
  border-radius: var(--radius);
  border: 2px solid var(--border-color);
  background: var(--white);
  transition: all 0.3s ease;
}

.selected-creature:hover {
  box-shadow: var(--shadow-sm);
}

.selected-creature.attack { border-left: 5px solid var(--attack-color); }
.selected-creature.tank { border-left: 5px solid var(--tank-color); }
.selected-creature.utility { border-left: 5px solid var(--utility-color); }

.selected-creature .name {
  font-weight: 600;
  font-size: 1.1rem;
  grid-column: 1;
  grid-row: 1;
}

.selected-creature .details {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  grid-column: 1;
  grid-row: 2;
}

.selected-creature .creature-info {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
  padding-top: 10px;
  border-top: 1px solid var(--bg-light);
}

.selected-creature .creature-info .info-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.selected-creature .creature-info .info-section strong {
  color: var(--text-dark);
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.selected-creature .creature-info .info-item {
  padding-left: 10px;
  color: var(--text-light);
  line-height: 1.5;
}

.selected-creature .creature-info .ability-item {
  padding-left: 10px;
  color: var(--text-light);
  line-height: 1.5;
}

.selected-creature .btn-remove {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
}

.selected-creature select {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-remove {
  padding: 8px 15px;
  background: var(--attack-color);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-remove:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* ===== 筛选器 ===== */
.filters {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input {
  width: 100%;
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 15px;
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.filter-chip.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* ===== Class Section ===== */
.class-section {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.class-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  cursor: pointer;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  user-select: none;
}

.class-header:hover {
  filter: brightness(1.1);
}

.attack-section .class-header { background: var(--attack-color); }
.tank-section .class-header { background: var(--tank-color); }
.utility-section .class-header { background: var(--utility-color); }

.class-icon {
  font-size: 1.5rem;
}

.class-name {
  flex: 1;
}

.class-count {
  background: rgba(255,255,255,0.3);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.class-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.creature-list {
  max-height: 600px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
  background: var(--bg-light);
  padding: 15px;
}

.creature-list.collapsed {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

/* ===== 生物卡片网格 ===== */
.creatures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.creature-card {
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.creature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.creature-card.selected {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.creature-card.attack.selected { border-color: var(--attack-color); background: var(--attack-light); }
.creature-card.tank.selected { border-color: var(--tank-color); background: var(--tank-light); }
.creature-card.utility.selected { border-color: var(--utility-color); background: var(--utility-light); }

.creature-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.creature-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.creature-slots,
.creature-taming,
.creature-dungeon {
  padding: 3px 8px;
  background: var(--bg-light);
  border-radius: 4px;
}

.creature-ability {
  font-size: 0.85rem;
  color: #667eea;
  margin-bottom: 8px;
  font-weight: 500;
}

.creature-summary {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 10px;
}

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

.btn-add,
.btn-added {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add {
  background: #667eea;
  color: white;
}

.btn-add:hover {
  background: #5568d3;
}

.btn-added {
  background: var(--utility-color);
  color: white;
  cursor: default;
}

/* ===== 推荐结果 ===== */
.recommendations {
  min-height: 200px;
}

.codex-info {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.codex-info h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.build-type {
  font-size: 1.1rem;
  opacity: 0.95;
}

.talents-section,
.mastery-section,
.analysis-section {
  margin-bottom: 25px;
}

.talents-section h3,
.mastery-section h3,
.analysis-section h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: var(--text-dark);
  border-bottom: 2px solid var(--bg-light);
  padding-bottom: 10px;
}

.talent-card {
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.talent-card:hover {
  box-shadow: var(--shadow-sm);
}

.talent-card.priority-high { border-left: 5px solid #e74c3c; }
.talent-card.priority-medium { border-left: 5px solid #f39c12; }
.talent-card.priority-low { border-left: 5px solid #95a5a6; }

.talent-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.talent-rank {
  font-size: 1.5rem;
}

.talent-name {
  font-weight: 600;
  font-size: 1.1rem;
  flex: 1;
}

.talent-class-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

.talent-class-badge.attack { background: var(--attack-color); }
.talent-class-badge.tank { background: var(--tank-color); }
.talent-class-badge.utility { background: var(--utility-color); }

.talent-details-btn {
  border: none;
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.talent-details-btn:hover {
  background: rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}

.talent-details {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.talent-details div {
  margin-bottom: 5px;
}

.talent-synergy {
  background: rgba(102, 126, 234, 0.1);
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
}

.talent-synergy strong {
  color: #667eea;
}

.talent-synergy-item {
  margin-top: 8px;
  font-size: 0.9rem;
  padding-left: 15px;
}

/* Usage Note */
.usage-note {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid #FFC107;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-dark);
  font-style: italic;
}

.mastery-list {
  list-style: none;
  padding: 0;
}

.mastery-list li {
  padding: 10px 15px;
  background: var(--bg-light);
  border-radius: 5px;
  margin-bottom: 8px;
  border-left: 3px solid #667eea;
}

.build-analysis {
  background: var(--bg-light);
  padding: 20px;
  border-radius: var(--radius);
}

.build-analysis h4 {
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--text-dark);
}

.build-analysis ul {
  list-style: none;
  padding: 0;
}

.build-analysis li {
  padding: 5px 0;
  padding-left: 25px;
  position: relative;
}

/* ===== Placeholder ===== */
.placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.placeholder p:first-child {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.hint {
  font-size: 0.95rem;
}

/* ===== Footer ===== */
.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--bg-light);
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

.footer a {
  color: #667eea;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== Loading Indicator ===== */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-indicator.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-indicator p {
  color: white;
  margin-top: 20px;
  font-size: 1.1rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .creatures-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
  }
}

/* ===== Ability 可点击样式 ===== */
.ability-item.clickable {
  cursor: pointer;
  padding: 8px 12px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  transition: all 0.2s ease;
  border-left: 3px solid var(--utility-color);
}

.ability-item.clickable:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ability-item.clickable strong {
  color: var(--utility-color);
  font-weight: 600;
}

.ability-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.4;
}

/* ===== Ability Modal 弹窗样式 ===== */
.ability-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.ability-modal.show {
  display: flex;
}

.ability-modal-content {
  background: white;
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
  position: relative;
}

.ability-modal-header {
  background: linear-gradient(135deg, var(--utility-color), #27ae60);
  color: white;
  padding: 24px 30px;
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ability-modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ability-modal-type {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.ability-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ability-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.ability-modal-body {
  padding: 30px;
}

.ability-section {
  margin-bottom: 24px;
}

.ability-section h3 {
  color: var(--text-dark);
  font-size: 1.2rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--utility-color);
}

.ability-section p {
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 8px;
}

.ability-creatures-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ability-synergies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.ability-synergy-item {
  background: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid var(--utility-color);
}

.ability-synergy-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.ability-synergy-with {
  font-weight: 600;
  color: var(--text-dark);
}

.ability-synergy-strength {
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.15);
  color: var(--utility-color);
  white-space: nowrap;
}

.ability-synergy-reason {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-dark);
}

.ability-creature-card {
  background: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.ability-creature-card.attack {
  border-left-color: var(--attack-color);
}

.ability-creature-card.tank {
  border-left-color: var(--tank-color);
}

.ability-creature-card.utility {
  border-left-color: var(--utility-color);
}

.ability-creature-card:hover {
  background: white;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.ability-creature-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.ability-creature-info {
  font-size: 0.85rem;
  color: var(--text-light);
}

.ability-translation-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #856404;
  font-size: 0.9rem;
}

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

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

/* ===== Phase 3: Talent Details Modal ===== */
.talent-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.talent-modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease forwards;
  opacity: 1;
}

.talent-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.talent-modal-header {
  background: linear-gradient(135deg, var(--tank-color), var(--utility-color));
  color: white;
  padding: 24px 30px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.talent-modal-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.talent-modal-class-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.talent-modal-class-badge.attack {
  background: var(--attack-color);
}

.talent-modal-class-badge.tank {
  background: var(--tank-color);
}

.talent-modal-class-badge.utility {
  background: var(--utility-color);
}

.talent-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.talent-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.talent-modal-body {
  padding: 30px;
}

.talent-section {
  margin-bottom: 24px;
}

.talent-section h3 {
  color: var(--text-dark);
  font-size: 1.2rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--utility-color);
}

/* Score Breakdown Styling */
.score-breakdown {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 16px;
}

.score-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  color: var(--text-dark);
}

.score-item:last-child {
  border-bottom: none;
}

.score-item strong {
  color: var(--text-dark);
}

.score-details {
  margin-top: 8px;
  margin-left: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.score-details > div {
  margin-bottom: 6px;
}

.score-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--utility-color);
  padding-top: 12px !important;
  border-top: 2px solid var(--utility-color) !important;
  border-bottom: none !important;
}

/* Cost-Effectiveness Styling */
.cost-effectiveness-rating {
  font-size: 1.3rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.cost-effectiveness-detail {
  color: var(--text-light);
  font-size: 0.95rem;
}

.cost-effectiveness-detail strong {
  color: var(--utility-color);
  font-size: 1.1rem;
}

/* Affected Creatures Styling */
.coverage-info {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.affected-creatures-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.affected-creature-item {
  background: var(--bg-light);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--utility-color);
}

.affected-creature-item strong {
  color: var(--text-dark);
  font-size: 1.05rem;
}

/* Talent Actions (Details Button) */
.talent-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.btn-talent-details {
  background: linear-gradient(135deg, var(--utility-color), var(--tank-color));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.btn-talent-details:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-talent-details:active {
  transform: translateY(0);
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
  .talent-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .talent-modal-header {
    padding: 20px;
  }

  .talent-modal-title {
    font-size: 1.5rem;
  }

  .talent-modal-body {
    padding: 20px;
  }
}
