/* ==========================================================================
   WarAuction - Obsidian & Gold Design System
   Modern, responsive, glassmorphic UI for WoW 12.1.5 Arbitrage Engine
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark-0: #07090e;
  --bg-dark-1: #0d111a;
  --bg-dark-2: #141b26;
  --bg-dark-3: #1c2536;
  --bg-dark-4: #26334a;

  /* Gold & Accent Tokens */
  --gold-primary: #f59e0b;
  --gold-bright: #fbbf24;
  --gold-glow: #ffd700;
  --gold-dark: #b45309;
  --gold-muted: rgba(245, 158, 11, 0.15);

  /* Quality Colors (WoW Standards) */
  --quality-poor: #9d9d9d;
  --quality-common: #ffffff;
  --quality-uncommon: #1eff00;
  --quality-rare: #0070dd;
  --quality-epic: #a335ee;
  --quality-legendary: #ff8000;
  --quality-artifact: #e6cc80;

  /* Functional Status */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Text Colors */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Glassmorphism Borders & Shadows */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-gold-subtle: rgba(245, 158, 11, 0.3);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.25);

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark-0);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glow */
.bg-gradient-mesh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(163, 53, 238, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(0, 112, 221, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-dark-0) 0%, var(--bg-dark-1) 100%);
  pointer-events: none;
  z-index: -2;
}

.ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Typography Utilities */
.gold-text {
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.green-text {
  color: var(--color-success);
}

.purple-text {
  color: var(--quality-epic);
}

.blue-text {
  color: var(--color-info);
}

/* Header & Navigation */
.app-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(13, 17, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  position: relative;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--bg-dark-3), var(--bg-dark-2));
  border-radius: 12px;
  border: 1px solid var(--border-gold-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
}

.logo-icon {
  font-size: 22px;
}

.gold-ring {
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-primary), transparent 60%);
  opacity: 0.4;
  pointer-events: none;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.version-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 9, 14, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(180, 83, 9, 0.1));
  border: 1px solid var(--border-gold-subtle);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.badge-count {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 1px 6px;
  border-radius: 10px;
}

.badge-count.gold {
  background: rgba(245, 158, 11, 0.25);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold-subtle);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-dark-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-toggle-btn:hover {
  border-color: var(--border-gold-subtle);
  background: var(--bg-dark-3);
}

.api-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-success);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
}

/* Main Content Area */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 24px 60px 24px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

/* Glass Card */
.glass-card {
  background: rgba(20, 27, 38, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.kpi-icon.gold { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--border-gold-subtle); }
.kpi-icon.purple { background: rgba(163, 53, 238, 0.15); border: 1px solid rgba(163, 53, 238, 0.3); }
.kpi-icon.blue { background: rgba(0, 112, 221, 0.15); border: 1px solid rgba(0, 112, 221, 0.3); }
.kpi-icon.green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
  margin: 2px 0;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Hero Banner */
.hero-banner {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-gold-subtle);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(20, 27, 38, 0.8) 100%);
}

.banner-content {
  max-width: 800px;
}

.banner-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold-bright);
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-gold-subtle);
  margin-bottom: 12px;
}

.banner-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  line-height: 1.2;
}

.banner-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.banner-buttons {
  display: flex;
  gap: 14px;
}

.banner-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.mini-stat {
  background: rgba(7, 9, 14, 0.5);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  text-align: center;
  min-width: 110px;
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-name {
  font-size: 11px;
  color: var(--text-dim);
}

/* Section Cards & Tables */
.section-card {
  padding: 24px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.data-table td {
  padding: 14px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-dark-3);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.item-details {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 600;
  font-size: 14px;
}

.item-meta {
  font-size: 11px;
  color: var(--text-dim);
}

/* Quality Styling */
.quality-EPIC { color: var(--quality-epic); }
.quality-RARE { color: var(--quality-rare); }
.quality-UNCOMMON { color: var(--quality-uncommon); }
.quality-COMMON { color: var(--text-main); }

/* Realm Pill */
.realm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 500;
}

.realm-pill.owned {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--border-gold-subtle);
  color: var(--gold-bright);
}

/* Price & Currency Display */
.price-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.price-tag.gold {
  color: var(--gold-bright);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #000;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-dark-3);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: var(--bg-dark-4);
  border-color: var(--border-gold-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* Toolbar & Filters */
.filter-toolbar {
  padding: 18px 24px;
  margin-bottom: 20px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-dark-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.form-select {
  padding: 10px 14px;
  background: var(--bg-dark-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Switch */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch-label input {
  display: none;
}

.slider {
  position: relative;
  width: 38px;
  height: 20px;
  background-color: var(--bg-dark-4);
  border-radius: 20px;
  transition: var(--transition-fast);
}

.slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition-fast);
}

input:checked + .slider {
  background-color: var(--gold-primary);
}

input:checked + .slider::before {
  transform: translateX(18px);
}

.switch-text {
  font-size: 13px;
  color: var(--text-main);
}

/* Tour Planner */
.tour-config-card {
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--border-gold-subtle);
}

.tour-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tour-summary-bar {
  display: flex;
  gap: 24px;
  background: rgba(7, 9, 14, 0.5);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  flex-wrap: wrap;
}

.tour-metric {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
}

.metric-val {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Tour Timeline Steps */
.tour-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tour-step-card {
  padding: 20px;
  border-left: 4px solid var(--gold-primary);
}

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

.step-realm {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.step-realm-name {
  font-size: 18px;
  font-weight: 700;
}

.step-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.action-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.action-badge.buy {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.action-badge.sell {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold-subtle);
}

/* Realms Matrix Grid */
.realms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.realm-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-glass);
}

.realm-card.owned {
  border-color: var(--border-gold-subtle);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(20, 27, 38, 0.7));
}

.realm-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.realm-name-big {
  font-weight: 700;
  font-size: 16px;
}

.realm-pop-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.sub-realms-tag {
  font-size: 12px;
  color: var(--text-muted);
}

/* Addon Hub Grid */
.addon-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.feature-bullets {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.bullet-item {
  display: flex;
  gap: 14px;
}

.bullet-icon {
  font-size: 22px;
}

.addon-commands-box {
  background: rgba(7, 9, 14, 0.6);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.download-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-path-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.live-code-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.code-preview {
  flex: 1;
  background: #080a0f;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: auto;
  max-height: 520px;
  color: #38bdf8;
  line-height: 1.6;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-dark-3);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .banner-stats {
    width: 100%;
    justify-content: space-between;
  }
  .addon-hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-tabs {
    overflow-x: auto;
    width: 100%;
  }
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 12px;
    gap: 12px;
  }
}
