/* ============================================================
   Satisfactory Production Calculator - Styles
   Theme: Dark industrial with FICSIT orange accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ========== CSS Variables ========== */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2d42;
  --bg-input: #243044;
  --bg-header: #0d1420;
  --border: #2d3a4d;
  --border-light: #3d4f66;
  --text-primary: #e8ecf1;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fbbf24;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --green: #10b981;
  --red: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --font-heading: 'Rajdhani', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

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

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ========== Header ========== */
.app-header {
  background: var(--bg-header);
  border-bottom: 2px solid var(--accent-dark);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  font-family: var(--font-heading);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.logo-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ========== Main Layout ========== */
.app-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

/* ========== Input Section ========== */
.input-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.input-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group select,
.input-group input[type="number"],
.input-group input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
}

.input-group select {
  min-width: 280px;
  cursor: pointer;
}

.input-group input[type="number"] {
  width: 120px;
  font-family: var(--font-mono);
}

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

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

/* ========== Buttons ========== */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #000;
  border-color: var(--accent);
}

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

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ========== Settings Panel ========== */
.settings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(245, 158, 11, 0.05);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.settings-header:hover {
  background: rgba(245, 158, 11, 0.1);
}

.settings-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--accent);
}

.settings-toggle {
  color: var(--text-muted);
  transition: transform var(--transition);
  font-size: 0.9rem;
}

.settings-panel.open .settings-toggle {
  transform: rotate(180deg);
}

.settings-body {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.settings-panel.open .settings-body {
  padding: 1.25rem;
  max-height: 2000px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.setting-item label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.setting-item input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

/* ========== Tabs ========== */
.tab-container {
  margin-bottom: 1.5rem;
}

.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  margin-bottom: 0;
}

.tab-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(245, 158, 11, 0.05);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.25rem;
  min-height: 300px;
  box-shadow: var(--shadow-sm);
}

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

/* ========== Production Tree ========== */
.tree-view {
  font-family: var(--font-body);
}

.tree-node {
  margin-left: 1.25rem;
  border-left: 1px solid var(--border);
  position: relative;
}

.tree-node:last-child {
  border-left-color: transparent;
}

.tree-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 1.25rem;
  height: 1rem;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.tree-node:last-child::before {
  border-left: 1px solid var(--border);
}

.tree-root {
  margin-left: 0;
  border-left: none;
}

.tree-root::before {
  display: none;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  margin-left: 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  flex-wrap: wrap;
}

.tree-item:hover {
  background: var(--bg-card-hover);
}

.tree-expand {
  width: 1.2rem;
  height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.tree-node.collapsed > .tree-children {
  display: none;
}

.tree-node.collapsed > .tree-item .tree-expand {
  transform: rotate(-90deg);
}

.tree-item-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tree-item-icon.ore { background: #b45309; }
.tree-item-icon.fluid { background: var(--cyan); }
.tree-item-icon.ingot { background: #94a3b8; }
.tree-item-icon.basic { background: var(--blue); }
.tree-item-icon.intermediate { background: var(--purple); }
.tree-item-icon.oil { background: #854d0e; }
.tree-item-icon.aluminum { background: #a1a1aa; }
.tree-item-icon.advanced { background: #c084fc; }
.tree-item-icon.project { background: var(--accent); }
.tree-item-icon.nuclear { background: var(--green); }
.tree-item-icon.misc { background: var(--text-muted); }

.tree-item-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.tree-item-rate {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
}

.tree-item-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tree-item-raw {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tree-children {
  /* just a container */
}

/* ========== Summary Cards ========== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.25rem;
}

.summary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.summary-card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
}

.summary-card-header.machines { color: var(--blue); }
.summary-card-header.resources { color: var(--green); }
.summary-card-header.power { color: var(--accent); }
.summary-card-header.byproducts { color: var(--purple); }

.summary-card-body {
  padding: 0;
}

/* ========== Tables ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(45, 58, 77, 0.5);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: rgba(245, 158, 11, 0.03);
}

.data-table .num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-align: right;
}

.data-table .total-row td {
  font-weight: 600;
  border-top: 2px solid var(--accent-dark);
  background: rgba(245, 158, 11, 0.05);
}

/* ========== Flow Visualization ========== */
.flow-container {
  width: 100%;
  overflow: auto;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-height: 400px;
  position: relative;
}

.flow-container svg {
  display: block;
}

.flow-node rect {
  rx: 6;
  ry: 6;
  stroke-width: 1.5;
  transition: all var(--transition);
}

.flow-node:hover rect {
  filter: brightness(1.2);
  stroke-width: 2;
}

.flow-node text {
  font-family: var(--font-body);
  fill: var(--text-primary);
}

.flow-node .node-title {
  font-weight: 600;
  font-size: 12px;
}

.flow-node .node-rate {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--accent);
}

.flow-node .node-machine {
  font-size: 10px;
  fill: var(--text-muted);
}

.flow-edge {
  fill: none;
  stroke-width: 2;
  opacity: 0.5;
}

.flow-edge:hover {
  opacity: 0.8;
  stroke-width: 3;
}

/* ========== Save/Load Panel ========== */
.storage-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.storage-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
}

.storage-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.saved-plans-list {
  display: grid;
  gap: 0.5rem;
}

.saved-plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.saved-plan-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.saved-plan-info h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.saved-plan-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.saved-plan-actions {
  display: flex;
  gap: 0.4rem;
}

/* ========== Recipe Selector ========== */
.recipe-selector {
  margin-top: 0.75rem;
}

.recipe-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: all var(--transition);
}

.recipe-option:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.recipe-option.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.recipe-option input[type="radio"] {
  accent-color: var(--accent);
}

.recipe-option .recipe-name {
  font-weight: 500;
}

.recipe-option .recipe-alt-badge {
  font-size: 0.7rem;
  background: var(--purple);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
}

.recipe-option .recipe-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== Empty State ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.9rem;
}

/* ========== Power Bar ========== */
.power-bar {
  height: 24px;
  background: var(--bg-input);
  border-radius: 12px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.power-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #000;
  transition: width 0.5s ease;
  min-width: 40px;
}

/* ========== Tooltip ========== */
.tooltip {
  position: absolute;
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  max-width: 300px;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 400px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--accent);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: color var(--transition);
}

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

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ========== Warnings ========== */
.warning-list {
  margin-top: 0.75rem;
}

.warning-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--red);
}

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

.animate-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease infinite;
}

/* ========== Search in dropdown ========== */
.search-select-wrapper {
  position: relative;
}

.search-select-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

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

.search-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: var(--shadow);
}

.search-select-dropdown.open {
  display: block;
}

.search-select-group-label {
  padding: 0.4rem 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.3);
}

.search-select-option {
  padding: 0.4rem 0.75rem 0.4rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-select-option:hover,
.search-select-option.highlighted {
  background: var(--accent-glow);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  html { font-size: 13px; }

  .app-header { padding: 0.5rem 1rem; }

  .app-main { padding: 1rem; }

  .input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .input-group select {
    min-width: 100%;
  }

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

  .modal {
    min-width: 90vw;
  }

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

  .tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ========== Language Switcher ========== */
.lang-switcher {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-btn {
  background: var(--bg-input);
  border: none;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.lang-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

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

.lang-btn.active {
  background: var(--accent-dark);
  color: #000;
}

/* ========== Logistics Tab ========== */
.logistics-warnings {
  margin-bottom: 1.25rem;
}

.logistics-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.logistics-msg.logistics-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.logistics-msg.logistics-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

.logistics-msg.logistics-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--blue);
}

.logistics-section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cyan);
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.logistics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.75rem;
}

.logistics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.logistics-card:hover {
  border-color: var(--border-light);
}

.logistics-card-warn {
  border-color: rgba(245, 158, 11, 0.4);
}

.logistics-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.logistics-card-name {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-card-rate {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.logistics-card-body {
  padding: 0.6rem 0.85rem;
}

.logistics-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.85rem;
}

.logistics-label {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 60px;
}

.logistics-value {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.logistics-ok {
  color: var(--green);
}

.logistics-exceed {
  color: var(--red);
  font-weight: 500;
}

/* ========== Announcement Button ========== */
.btn-bell {
  position: relative;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
}

.announcement-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 300px;
  max-width: 380px;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: none;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.announcement-popup.open {
  display: block;
}

.announcement-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: var(--bg-card);
  border-left: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
  transform: rotate(45deg);
}

.announcement-popup h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.announcement-popup p {
  margin: 0;
  word-break: break-all;
}

/* ========== Ore Settings ========== */
.ore-settings-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ore-settings-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.ore-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}

.ore-setting-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.ore-setting-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 500;
}

.ore-setting-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  outline: none;
}

.ore-setting-select:focus {
  border-color: var(--accent);
}

.ore-setting-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ========== Announcement Bell ========== */
.announce-wrapper {
  position: relative;
}

.announce-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.announce-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.announce-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 150;
  display: none;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.announce-popup.open {
  display: block;
}

.announce-popup-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* ========== Print Styles ========== */
@media print {
  body { background: white; color: black; }
  body::before { display: none; }
  .app-header { position: static; box-shadow: none; border-bottom: 2px solid #000; }
  .btn, .settings-panel, .storage-section, .header-actions { display: none; }
  .tab-content { display: block !important; border: 1px solid #ccc; }
  .data-table td, .data-table th { border: 1px solid #ccc; }
}
