/* Challenge Import UI */
.challenge-import {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.region-select-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.challenge-import select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #c89b3c;
  font-size: 0.95em;
  background: var(--card-bg);
  color: var(--fg);
  cursor: pointer;
  min-width: 48px;
  width: auto;
  max-width: 80px;
}
.region-note {
  font-size: 0.75em;
  color: #c89b3c;
  opacity: 0.85;
  white-space: nowrap;
}

.challenge-import input[type="text"] {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #c89b3c;
  font-size: 1em;
  background: var(--card-bg);
  color: var(--fg);
  min-width: 250px;
}

.wip-notice {
  background: #ffe7b3;
  color: #7a4c00;
  border: 1px solid #c89b3c;
  border-radius: 6px;
  padding: 10px 18px;
  margin: 18px auto 10px auto;
  text-align: center;
  font-size: 1.08em;
  max-width: 600px;
  box-shadow: 0 2px 8px 0 rgba(200, 155, 60, 0.07);
}

@media (max-width: 600px) {
  .challenge-import {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .challenge-import input[type="text"] {
    min-width: 0;
    width: 100%;
    font-size: 1em;
    box-sizing: border-box;
  }
  .challenge-import .region-select-group,
  .challenge-import select,
  .challenge-import button {
    width: 100%;
    box-sizing: border-box;
  }
  .region-select-group {
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 0;
  }
  .challenge-import select {
    max-width: 100%;
    min-width: 48px;
  }
}

.challenge-import button {
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: #c89b3c;
  color: #0b0e14;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

.challenge-import button:hover {
  background: #b18a2a;
}

.challenge-import #challenge-import-status {
  margin-left: 10px;
  font-size: 0.95em;
  color: #c89b3c;
}

/* Theme variables */
.theme-light {
  --bg: #f7f7f7;
  --fg: #181818;
  --tab: #e0e0e0;
  --tab-active: #fff;
  --tab-action: #f0f0f0;
  --card-bg: #fff;
  --card-hover: #f5f5f5;
}

.theme-dark {
  --bg: #0b0e14;
  --fg: #e6e6e6;
  --tab: #151a23;
  --tab-active: #1f2633;
  --tab-action: #232b3a;
  --card-bg: #151a23;
  --card-hover: #1f2633;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg, #0b0e14);
  color: var(--fg, #e6e6e6);
  margin: 0;
  padding: 20px;
  transition:
    background 0.2s,
    color 0.2s;
}

/* Header */
.page-header {
  text-align: center;
  padding: 40px 20px 30px;
  margin: -20px -20px 30px -20px;
  background: linear-gradient(
    135deg,
    rgba(200, 155, 60, 0.1) 0%,
    rgba(200, 155, 60, 0.05) 100%
  );
  border-bottom: 2px solid rgba(200, 155, 60, 0.3);
  position: relative;
}

.page-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c89b3c, transparent);
}

h1 {
  margin: 0 0 12px 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg, #e6e6e6);
}

h1 .highlight {
  color: #c89b3c;
  font-weight: 800;
}

#progress {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
  color: rgba(200, 155, 60, 0.9);
  letter-spacing: 0.5px;
}

.progress-info {
  max-width: 400px;
  margin: 0 auto;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(200, 155, 60, 0.2);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c89b3c 0%, #f0e6d2 50%, #c89b3c 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow:
    0 0 12px rgba(200, 155, 60, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.animations-enabled .progress-bar {
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Theme Switcher */
#theme-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.theme-toggle,
.animation-toggle {
  background: var(--card-bg, #151a23);
  border: 1px solid rgba(200, 155, 60, 0.3);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover,
.animation-toggle:hover {
  background: var(--card-hover, #1f2633);
  border-color: rgba(200, 155, 60, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 155, 60, 0.2);
}

.animation-toggle.disabled {
  opacity: 0.5;
}

/* Tabs Bar */
#tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
}

.tab {
  padding: 6px 12px;
  background: var(--tab, #151a23);
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  transition:
    background 0.2s,
    opacity 0.2s;
}

.tab:hover {
  opacity: 0.85;
}

.tab.active {
  opacity: 1;
  background: var(--tab-active, #1f2633);
  position: relative;
  z-index: 2;
}

.tab.add {
  font-weight: bold;
}

/* Tab Actions Row */
#tab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 15px;
  align-items: center;
  border-radius: 0 4px 12px 12px;
  min-height: 42px;
  transition: background 0.2s;
  background: var(--tab-action, #232b3a);
}

@media (max-width: 600px) {
  #tab-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 4px;
  }
  #tab-actions .action-group {
    gap: 8px;
    padding: 0;
    border-left: none;
    border-top: 2px solid rgba(255, 255, 255, 0.08);
    margin-top: 6px;
  }
  #tab-actions .action-group:first-of-type {
    border-top: none;
    margin-top: 0;
  }
}

#tab-actions .action-group {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

#tab-actions .action-group:first-of-type {
  border-left: none;
  padding-left: 0;
}

#tab-actions .color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  margin-right: 10px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

#tab-actions .color-swatch input[type="color"] {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  cursor: pointer;
}

#tab-actions .action {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.9;
  border: none;
  color: inherit;
  transition:
    background 0.2s,
    opacity 0.2s;
}

#tab-actions .action:hover {
  background: rgba(0, 0, 0, 0.3);
  opacity: 1;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--card-bg, #151a23);
  border-radius: 8px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid rgba(200, 155, 60, 0.15);
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  max-width: 340px;
  min-width: 0;
}
.filter-bar input[type="text"] {
  width: 100%;
  min-width: 120px;
  max-width: 340px;
  padding: 8px 32px 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(200, 155, 60, 0.3);
  font-size: 0.95em;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1em;
  color: #c89b3c;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  z-index: 2;
  padding: 0 2px;
  user-select: none;
  transition:
    opacity 0.2s,
    color 0.2s;
}
.search-clear-btn:hover {
  opacity: 1;
  color: #b18a2a;
}

.filter-bar input[type="text"]:focus {
  outline: none;
  border-color: #c89b3c;
}

.filter-bar select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(200, 155, 60, 0.3);
  font-size: 0.95em;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.2s;
}

.filter-bar select:focus {
  outline: none;
  border-color: #c89b3c;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 0.9em;
  color: var(--fg);
  transition: all 0.2s;
}
.filter-badge-region {
  background: rgba(70, 130, 180, 0.18);
  border: 1px solid #4682b4;
}
.filter-badge-region:hover {
  background: rgba(70, 130, 180, 0.28);
  border-color: #5faee3;
}
.filter-badge-property {
  background: rgba(200, 155, 60, 0.15);
  border: 1px solid rgba(200, 155, 60, 0.4);
}
.filter-badge-property:hover {
  background: rgba(200, 155, 60, 0.25);
  border-color: #c89b3c;
}

.filter-reset {
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.filter-reset:hover {
  background: rgba(231, 76, 60, 0.25);
  border-color: #e74c3c;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.2);
}

@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .search-bar-wrapper {
    max-width: 100%;
    width: 100%;
  }
  .filter-bar input[type="text"],
  .filter-bar select,
  .filter-reset {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Active Filters (Badges) */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  min-height: 0;
}

.active-filters:empty {
  margin-bottom: 0;
}

.filter-badge-label {
  font-weight: 500;
}

.filter-badge-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(200, 155, 60, 0.3);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: background 0.2s;
}

.filter-badge-remove:hover {
  background: rgba(200, 155, 60, 0.6);
}

/* Champions Grid */
#champion-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

#champion-grid:not(:has(.region-section)) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.region-section {
  flex: 1 1 300px;
  min-width: 300px;
  padding: 16px;
  background: var(--card-bg, #151a23);
  border-radius: 8px;
  border: 1px solid rgba(200, 155, 60, 0.1);
}

@media (max-width: 768px) {
  #champion-grid {
    flex-direction: column;
  }
  .region-section {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
}

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

.region-count {
  font-size: 0.9em;
  opacity: 0.7;
}

.champion-grid-region {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.champion {
  background: var(--card-bg, #151a23);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.1s,
    opacity 0.2s;
}

.champion:hover {
  transform: scale(1.05);
  background: var(--card-hover, #1a1f2b);
}

.champion img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
}

.champion-name {
  font-size: 12px;
  margin-top: 4px;
  word-break: break-word;
}

.champion.done {
  opacity: 0.35;
}

.champion.done img {
  filter: grayscale(100%);
}
