/* Oracle Idle - Main Stylesheet */

:root {
  --bg-primary: #0d0d1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #1e1e3a;
  --bg-hover: #252545;
  --accent-gold: #ffd700;
  --accent-gold-dim: #b8960c;
  --accent-purple: #9b59b6;
  --accent-blue: #3498db;
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0b0;
  --text-muted: #606080;
  --border-color: #2a2a4a;
  --border-gold: #ffd70033;
  --rarity-common: #9e9e9e;
  --rarity-uncommon: #4caf50;
  --rarity-rare: #2196f3;
  --rarity-epic: #9c27b0;
  --rarity-legendary: #ff9800;
  --progress-bg: #0a0a1a;
  --progress-fill: linear-gradient(90deg, #9b59b6, #ffd700);
  --shadow-glow: 0 0 20px rgba(155, 89, 182, 0.3);
  --transition: 0.2s ease;
  --radius: 8px;
  --radius-sm: 4px;
  --font-main: 'Segoe UI', system-ui, sans-serif;
}

/* ======================== RESET & BASE ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }

/* ======================== LAYOUT ======================== */
#app {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  grid-template-rows: 50px 1fr 30px;
  grid-template-areas:
    "header header header"
    "sidebar main right"
    "footer footer footer";
  height: 100vh;
  gap: 0;
}

/* ======================== HEADER ======================== */
#header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--bg-secondary), var(--bg-tertiary), var(--bg-secondary));
  border-bottom: 1px solid var(--border-gold);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header-logo .logo-icon { font-size: 24px; }

.header-stats {
  display: flex;
  gap: 20px;
  align-items: center;
}

.header-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.header-stat .stat-icon { font-size: 16px; }
.header-stat .stat-value { color: var(--accent-gold); font-weight: 600; }

.header-actions {
  display: flex;
  gap: 8px;
}

/* ======================== SIDEBAR ======================== */
#sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.nav-section {
  padding: 4px 8px;
  margin-bottom: 4px;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  font-weight: 600;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-family: var(--font-main);
  text-align: left;
  position: relative;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(155,89,182,0.3), transparent);
  color: var(--accent-gold);
  border-left: 2px solid var(--accent-gold);
}

.nav-btn .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-btn .nav-label { flex: 1; }
.nav-btn .nav-badge {
  background: var(--accent-purple);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Character mini stats in sidebar */
.sidebar-character {
  padding: 12px;
  margin: 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.char-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 8px;
  text-align: center;
}

.char-mini-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.char-mini-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.char-mini-stat .stat-name { color: var(--text-muted); }
.char-mini-stat .stat-val { color: var(--text-primary); font-weight: 600; }

/* HP/Mana bars */
.stat-bar-wrap {
  margin-top: 8px;
}

.stat-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 2px;
}

.stat-bar {
  height: 8px;
  background: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.stat-bar-fill.hp { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.stat-bar-fill.mana { background: linear-gradient(90deg, #2980b9, #3498db); }
.stat-bar-fill.xp { background: var(--progress-fill); }

/* ======================== MAIN CONTENT ======================== */
#main {
  grid-area: main;
  overflow-y: auto;
  background: var(--bg-primary);
  padding: 16px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Page headers */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title .title-icon { font-size: 24px; }

/* ======================== SKILLS TAB ======================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.skill-category-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-purple);
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
  grid-column: 1 / -1;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--progress-fill);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.skill-card:hover {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.skill-card.active-skill {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(255,215,0,0.2);
}

.skill-card.active-skill::before { transform: scaleX(1); }

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

.skill-icon { font-size: 28px; }

.skill-info { flex: 1; }

.skill-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-level {
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 600;
}

.skill-xp-bar {
  height: 6px;
  background: var(--progress-bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.skill-xp-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.skill-xp-text {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Action list in skill panel */
.skill-actions-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.skill-actions-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.action-item:hover {
  border-color: var(--accent-purple);
  background: var(--bg-hover);
}

.action-item.active-action {
  border-color: var(--accent-gold);
  background: rgba(255,215,0,0.05);
}

.action-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.action-icon { font-size: 20px; }

.action-info { flex: 1; }

.action-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.action-details {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.action-detail { display: flex; align-items: center; gap: 3px; }

.action-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.action-level-req {
  font-size: 11px;
  color: var(--text-muted);
}

.action-queue-btn {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(155,89,182,0.3);
  border: 1px solid var(--accent-purple);
  border-radius: 3px;
  color: var(--accent-purple);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.action-queue-btn:hover {
  background: var(--accent-purple);
  color: white;
}

/* Active Action Progress */
#active-action-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 0 15px rgba(255,215,0,0.1);
}

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

.active-action-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-btn {
  padding: 4px 12px;
  background: rgba(231,76,60,0.2);
  border: 1px solid var(--accent-red);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-main);
  transition: all var(--transition);
}

.stop-btn:hover { background: var(--accent-red); color: white; }

.action-progress-bar {
  height: 14px;
  background: var(--progress-bg);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.action-progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 7px;
  transition: width 0.1s linear;
  position: relative;
  overflow: hidden;
}

.action-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

.action-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

/* Queue display */
.queue-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.queue-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.queue-items {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.queue-remove {
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
}

/* ======================== COMBAT TAB ======================== */
.combat-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.zones-panel, .combat-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.zone-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.zone-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.zone-card:hover { border-color: var(--accent-purple); }
.zone-card.selected { border-color: var(--accent-gold); background: rgba(255,215,0,0.05); }
.zone-card.locked { opacity: 0.4; cursor: not-allowed; }

.zone-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-req { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.monsters-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.monster-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.monster-card:hover { border-color: var(--accent-red); }
.monster-card.active-monster { border-color: var(--accent-red); box-shadow: 0 0 10px rgba(231,76,60,0.2); }

.monster-icon { font-size: 24px; }
.monster-info { flex: 1; }
.monster-name { font-size: 13px; font-weight: 600; }
.monster-level { font-size: 11px; color: var(--text-muted); }

.monster-hp-bar {
  height: 6px;
  background: var(--progress-bg);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.monster-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #c0392b, #e74c3c);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Combat log */
.combat-log {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  height: 200px;
  overflow-y: auto;
  margin-top: 10px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

.log-entry {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.log-entry.player-attack { color: var(--accent-blue); }
.log-entry.monster-attack { color: var(--accent-red); }
.log-entry.loot { color: var(--accent-gold); }
.log-entry.level-up { color: var(--accent-green); font-weight: 700; }
.log-entry.death { color: var(--accent-red); font-weight: 700; }
.log-entry.system { color: var(--text-muted); }

/* ======================== CRAFTING TAB ======================== */
.crafting-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.recipes-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.craft-skill-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.craft-skill-tab {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-main);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.craft-skill-tab:hover { border-color: var(--accent-purple); color: var(--text-primary); }
.craft-skill-tab.active { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(255,215,0,0.05); }

.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.recipe-item:hover { border-color: var(--accent-purple); }
.recipe-item.selected { border-color: var(--accent-gold); }
.recipe-item.cant-craft { opacity: 0.5; }

.recipe-icon { font-size: 24px; }

.recipe-info { flex: 1; }

.recipe-name { font-size: 13px; font-weight: 600; }

.recipe-materials {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.recipe-material {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.recipe-material.have { color: var(--accent-green); }
.recipe-material.missing { color: var(--accent-red); }

.craft-info-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.craft-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}

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

.craft-preview-icon { font-size: 36px; }

.craft-preview-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.craft-preview-rarity {
  font-size: 12px;
  font-weight: 600;
}

.craft-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.qty-btn {
  padding: 4px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  transition: all var(--transition);
}

.qty-btn:hover { border-color: var(--accent-purple); }

.qty-input {
  width: 60px;
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 4px;
  font-family: var(--font-main);
  font-size: 13px;
}

.craft-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-main);
  transition: all var(--transition);
  margin-top: 10px;
}

.craft-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(155,89,182,0.4); }
.craft-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Craft queue */
.craft-queue {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.craft-queue-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.craft-queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
}

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

.craft-queue-progress {
  flex: 1;
  height: 4px;
  background: var(--progress-bg);
  border-radius: 2px;
  overflow: hidden;
}

.craft-queue-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* ======================== MARKET TAB ======================== */
.market-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.market-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.market-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
}

.market-refresh {
  font-size: 11px;
  color: var(--text-muted);
}

.market-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
}

.market-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.market-item:hover { border-color: var(--accent-gold); }

.market-item-icon { font-size: 20px; }

.market-item-info { flex: 1; }

.market-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.market-item-qty {
  font-size: 11px;
  color: var(--text-muted);
}

.market-item-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 13px;
}

.buy-btn, .sell-btn {
  padding: 4px 10px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}

.buy-btn {
  background: rgba(46,204,113,0.2);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.buy-btn:hover { background: var(--accent-green); color: white; }

.sell-btn {
  background: rgba(231,76,60,0.2);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.sell-btn:hover { background: var(--accent-red); color: white; }

/* Sell panel - inventory list */
.sell-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
}

/* ======================== INVENTORY TAB ======================== */
.inventory-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-main);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--accent-purple); color: var(--text-primary); }
.filter-btn.active { border-color: var(--accent-purple); color: var(--accent-purple); background: rgba(155,89,182,0.1); }

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.inv-slot {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 80px;
  justify-content: center;
}

.inv-slot:hover {
  border-color: var(--accent-purple);
  transform: scale(1.05);
  z-index: 10;
}

.inv-slot.rarity-common { border-color: var(--rarity-common); }
.inv-slot.rarity-uncommon { border-color: var(--rarity-uncommon); }
.inv-slot.rarity-rare { border-color: var(--rarity-rare); }
.inv-slot.rarity-epic { border-color: var(--rarity-epic); }
.inv-slot.rarity-legendary { border-color: var(--rarity-legendary); box-shadow: 0 0 8px rgba(255,152,0,0.3); }

.inv-icon { font-size: 28px; }

.inv-name {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.inv-qty {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: var(--accent-gold);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ======================== EQUIPMENT TAB ======================== */
.equipment-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.equipment-paper-doll {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  grid-template-rows: repeat(5, auto);
  gap: 8px;
  align-items: center;
  justify-items: center;
}

.equip-slot {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  width: 70px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.equip-slot:hover { border-color: var(--accent-purple); }
.equip-slot.filled { border-style: solid; border-color: var(--accent-gold); }
.equip-slot.filled:hover { border-color: var(--accent-red); }

.equip-slot-icon { font-size: 24px; }
.equip-slot-label { font-size: 9px; color: var(--text-muted); text-align: center; margin-top: 2px; }

.equip-slot-item-icon { font-size: 28px; }
.equip-slot-item-name { font-size: 9px; color: var(--accent-gold); text-align: center; }

.equip-unequip {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--accent-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}

.equip-slot:hover .equip-unequip { opacity: 1; }

.char-doll-center { 
  font-size: 60px; 
  grid-column: 2;
  grid-row: 1 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.equipment-stats {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.equip-stat-section { margin-bottom: 14px; }

.equip-stat-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.equip-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.equip-stat-name { color: var(--text-secondary); }
.equip-stat-value { color: var(--text-primary); font-weight: 600; }
.equip-stat-value.bonus { color: var(--accent-green); }

/* ======================== TASKS TAB ======================== */
.tasks-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tasks-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  transition: all var(--transition);
}

.task-card:hover { border-color: var(--accent-purple); }
.task-card.completed { opacity: 0.6; border-color: var(--accent-green); }

.task-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.task-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.task-objectives {
  margin-bottom: 10px;
}

.task-objective {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
}

.task-objective.done { color: var(--accent-green); }
.task-obj-check { font-size: 14px; }

.task-progress {
  height: 4px;
  background: var(--progress-bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.task-progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.task-reward {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--accent-gold);
  align-items: center;
}

.task-reward .reward-label { color: var(--text-muted); font-size: 11px; }

.claim-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold));
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  margin-top: 8px;
  transition: all var(--transition);
}

.claim-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.claim-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ======================== RIGHT PANEL ======================== */
#right-panel {
  grid-area: right;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
}

.panel-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Action Log */
#action-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 200px;
  overflow-y: auto;
}

.log-msg {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 6px;
  border-radius: 3px;
  animation: fadeIn 0.3s ease;
}

.log-msg.gain { color: var(--accent-green); }
.log-msg.xp { color: var(--accent-blue); }
.log-msg.gold { color: var(--accent-gold); }
.log-msg.error { color: var(--accent-red); }
.log-msg.level { color: var(--accent-purple); font-weight: 700; }

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

/* Stats summary */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stat-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.stat-item-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-item-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Top skills */
.top-skills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-skill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.top-skill-icon { font-size: 16px; }
.top-skill-name { flex: 1; color: var(--text-secondary); }
.top-skill-level { color: var(--accent-gold); font-weight: 700; }

.top-skill-bar {
  width: 60px;
  height: 4px;
  background: var(--progress-bg);
  border-radius: 2px;
  overflow: hidden;
}

.top-skill-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 2px;
}

/* ======================== FOOTER ======================== */
#footer {
  grid-area: footer;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.footer-left { display: flex; gap: 16px; align-items: center; }
.footer-right { display: flex; gap: 8px; align-items: center; }

/* ======================== BUTTONS ======================== */
.btn {
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  color: white;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold));
  color: var(--bg-primary);
}

.btn-gold:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover { border-color: var(--accent-purple); color: var(--text-primary); }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ======================== TOOLTIP ======================== */
.tooltip {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 200px;
  max-width: 280px;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6);
  pointer-events: none;
  animation: tooltipFade 0.15s ease;
}

@keyframes tooltipFade {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.tooltip-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tooltip-rarity {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.tooltip-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.tooltip-stats {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.tooltip-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 2px 0;
}

.tooltip-stat-name { color: var(--text-muted); }
.tooltip-stat-value { color: var(--accent-green); font-weight: 600; }

.tooltip-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent-gold);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

/* ======================== NOTIFICATIONS ======================== */
#notifications {
  position: fixed;
  top: 60px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  animation: notifSlide 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  pointer-events: auto;
}

@keyframes notifSlide {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.notification.hiding {
  animation: notifHide 0.3s ease forwards;
}

@keyframes notifHide {
  to { opacity: 0; transform: translateX(100px); height: 0; padding: 0; margin: 0; }
}

.notification.info { border-color: var(--accent-blue); }
.notification.success { border-color: var(--accent-green); }
.notification.warning { border-color: var(--accent-gold); }
.notification.error { border-color: var(--accent-red); }
.notification.level { border-color: var(--accent-purple); background: rgba(155,89,182,0.2); }

.notification-icon { font-size: 18px; }

/* ======================== MODAL ======================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 400px;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), var(--shadow-glow);
  animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.9) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--accent-red); }

/* ======================== RARITY COLORS ======================== */
.rarity-common { color: var(--rarity-common); }
.rarity-uncommon { color: var(--rarity-uncommon); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }

/* ======================== MISC ======================== */
.gold-text { color: var(--accent-gold); }
.purple-text { color: var(--accent-purple); }
.green-text { color: var(--accent-green); }
.red-text { color: var(--accent-red); }
.muted { color: var(--text-muted); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* Skill selection highlight */
.selected-skill-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.selected-skill-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.selected-skill-icon { font-size: 42px; }
.selected-skill-name { font-size: 20px; font-weight: 700; color: var(--accent-gold); }
.selected-skill-level { font-size: 14px; color: var(--text-muted); }

.selected-skill-xp-bar {
  height: 10px;
  background: var(--progress-bg);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.selected-skill-xp-fill {
  height: 100%;
  background: var(--progress-fill);
  transition: width 0.5s ease;
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 1200px) {
  #app {
    grid-template-columns: 180px 1fr 240px;
  }
}

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 50px auto 1fr 30px;
    grid-template-areas:
      "header"
      "sidebar"
      "main"
      "footer";
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  #right-panel { display: none; }
  #sidebar { flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-section { display: flex; gap: 4px; }
  .nav-section-title { display: none; }
  .sidebar-character { display: none; }

  .combat-layout, .crafting-layout, .tasks-layout, .market-layout, .equipment-layout {
    grid-template-columns: 1fr;
  }
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Offline progress modal */
.offline-info {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}

.offline-time {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.offline-gains {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offline-gain-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}

.offline-gain-name { color: var(--text-secondary); }
.offline-gain-val { color: var(--accent-green); font-weight: 600; }
