/* === EVE Online Dark Theme — Drone Analyzer === */

:root {
  --bg-deep: #060a12;
  --bg-base: #0a0e17;
  --bg-surface: #111827;
  --bg-elevated: #1a2236;
  --bg-hover: #1e293b;
  --border: #1e2a3a;
  --border-bright: #2a3a52;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #00d4ff;
  --accent-dim: #0ea5e9;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --accent-glow-strong: rgba(0, 212, 255, 0.3);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --yellow: #f59e0b;
  --yellow-dim: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --orange: #f59e0b;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle starfield-like background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(14, 165, 233, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 30, 0.4) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* === HEADER === */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.info-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8rem;
  transition: var(--transition);
}

.info-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.info-toggle svg {
  width: 16px;
  height: 16px;
}

/* === INFO PANEL === */

.info-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.info-panel.open {
  max-height: 800px;
}

.info-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.info-inner h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.formula-block {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.formula-block code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.info-card h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.info-card ul {
  list-style: none;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.info-card li {
  padding: 2px 0;
}

.info-card li strong {
  color: var(--text-primary);
}

.info-card li code {
  background: var(--bg-deep);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  color: var(--accent-dim);
}

/* === MAIN LAYOUT === */

.main-content {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px 32px;
}

.main-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

/* === PANELS === */

.panel-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* === FORM INPUTS === */

.input-group {
  margin-bottom: 14px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: help;
}

.select-input, .text-input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.8rem;
  transition: var(--transition);
  outline: none;
}

.select-input:focus, .text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.select-input:hover, .text-input:hover {
  border-color: var(--border-bright);
}

.select-input option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.checkbox-input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-bright);
  border-radius: 3px;
  background: var(--bg-deep);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  position: relative;
}

.checkbox-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-input:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 11px;
  color: var(--bg-deep);
  font-weight: 700;
}

.range-input {
  width: 100%;
  height: 6px;
  appearance: none;
  background: var(--bg-deep);
  border-radius: 3px;
  outline: none;
  border: 1px solid var(--border);
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-glow-strong);
}

.range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-group.half {
  flex: 1;
}

/* Autocomplete */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.autocomplete-list.show {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--accent-glow);
}

.autocomplete-item .ship-class-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-deep);
  padding: 2px 6px;
  border-radius: 3px;
}

.ship-info-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.72rem;
}

.ship-info-bar span {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.mwd-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--orange);
}

.auto-calc-display {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.vni-bonus-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-sm);
}

.badge {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.68rem;
}

.effective-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  color: var(--accent);
  font-weight: 600;
}

/* === CHART === */

.chart-section {
  position: relative;
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-label {
  width: 130px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-wrapper {
  flex: 1;
  height: 26px;
  background: var(--bg-deep);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.chart-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  position: relative;
}

.chart-bar.green { background: linear-gradient(90deg, rgba(34, 197, 94, 0.6), rgba(34, 197, 94, 0.8)); }
.chart-bar.yellow { background: linear-gradient(90deg, rgba(245, 158, 11, 0.6), rgba(245, 158, 11, 0.8)); }
.chart-bar.red { background: linear-gradient(90deg, rgba(239, 68, 68, 0.6), rgba(239, 68, 68, 0.8)); }

.chart-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
}

.chart-value-outside {
  margin-left: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* === RECOMMENDATION === */

.recommendation-section {
  border-color: var(--accent);
  border-width: 1px;
  background: linear-gradient(135deg, var(--bg-surface), rgba(0, 212, 255, 0.05));
}

.rec-title {
  color: var(--accent);
}

.rec-title svg {
  color: var(--accent);
}

.rec-content {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.rec-content strong {
  color: var(--accent);
}

.rec-content .rec-drone-name {
  color: var(--green);
  font-weight: 700;
}

.rec-content .rec-bad {
  color: var(--red);
}

.rec-content .rec-highlight {
  color: var(--accent);
  font-weight: 600;
}

/* === DRONE TABLES === */

.drone-tables {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drone-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.drone-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.drone-group-header:hover {
  background: var(--bg-hover);
}

.drone-group-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drone-group-title .group-type-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 3px;
}

.drone-group-dps {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.drone-table-wrapper {
  overflow-x: auto;
}

.drone-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.drone-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  white-space: nowrap;
}

.drone-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(30, 42, 58, 0.5);
  white-space: nowrap;
}

.drone-table tr:last-child td {
  border-bottom: none;
}

.drone-table tr:hover td {
  background: var(--bg-elevated);
}

.drone-name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.dmg-type {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.dmg-type.thermal { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.dmg-type.explosive { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.dmg-type.em { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.dmg-type.kinetic { background: rgba(156, 163, 175, 0.15); color: #d1d5db; }

.app-good { color: var(--green); font-weight: 600; }
.app-mid { color: var(--yellow); font-weight: 600; }
.app-bad { color: var(--red); font-weight: 600; }

.best-row td {
  background: var(--green-dim) !important;
}

/* === FOOTER === */

.app-footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.app-footer a:hover {
  color: var(--accent);
}

/* === SCROLLBAR === */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* === RESPONSIVE === */

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  
  .input-panel {
    max-width: 100%;
  }
  
  .header-inner {
    padding: 10px 16px;
  }
  
  .main-content {
    padding: 12px 16px 24px;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 13px;
  }
  
  .logo-subtitle {
    display: none;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .input-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .chart-label {
    width: 80px;
    font-size: 0.6rem;
  }
  
  .chart-value {
    font-size: 0.6rem;
    right: 4px;
  }
  
  .chart-value-outside {
    font-size: 0.6rem;
  }
  
  .drone-table {
    font-size: 0.68rem;
  }
  
  .drone-table th, .drone-table td {
    padding: 6px 8px;
  }
  
  .panel-section {
    padding: 14px;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.drone-group {
  animation: fadeIn 0.3s ease forwards;
}

.drone-group:nth-child(2) { animation-delay: 0.05s; }
.drone-group:nth-child(3) { animation-delay: 0.1s; }
.drone-group:nth-child(4) { animation-delay: 0.15s; }
.drone-group:nth-child(5) { animation-delay: 0.2s; }
