:root {
  /* Premium Myna Palette: Obsidian & Gold */
  --bg-color: #0b0f19; /* Deep Midnight */
  --sidebar-bg: #111827; /* Dark Slate */
  --card-bg: #161e31; /* Lighter Midnight */
  --text-primary: #f8fafc; /* Ice White */
  --text-secondary: #94a3b8; /* Cool Grey */
  
  /* Accent Colors */
  --accent: #fdba31; /* Myna Gold */
  --accent-hover: #ff9f1c; /* Deep Amber */
  --accent-soft: rgba(253, 186, 49, 0.15); /* For active states */
  
  --error: #ef4444;
  --success: #10b981;
  --border-radius: 12px;
  --transition-speed: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  font-smoothing: antialiased;
}

.app-container {
  display: flex;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.logo h1 {
  color: var(--accent);
  margin-bottom: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  padding: 14px 16px;
  cursor: pointer;
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  transition: all var(--transition-speed);
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links li:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-links li.active {
  background-color: var(--accent);
  color: #000; /* Contrast on gold */
  box-shadow: 0 4px 12px rgba(253, 186, 49, 0.3);
}

/* Content */
.content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: radial-gradient(circle at top right, #1f2a40 0%, transparent 40%);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

h2 {
  margin-bottom: 24px;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-block;
  background: linear-gradient(90deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
}

/* Components */
.card {
  background-color: var(--card-bg);
  padding: 24px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-speed);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(253, 186, 49, 0.2);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Inputs & Buttons */
select,
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  margin: 12px 0;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  transition: all 0.2s;
  font-size: 0.95rem;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(253, 186, 49, 0.1);
}

select[multiple] {
  height: 120px;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-speed);
  display: block;
  width: 100%;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

button:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #0b0f19;
  box-shadow: 0 4px 15px rgba(253, 186, 49, 0.2);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(253, 186, 49, 0.3);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background-color: var(--accent-soft);
}

/* File Upload */
.file-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 15px;
  border-radius: var(--border-radius);
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.02);
}

.file-upload input {
  display: none;
}

.file-upload:hover {
  border-color: var(--accent);
  background: rgba(253, 186, 49, 0.05);
}

.file-upload span {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Status Messages */
.status-msg {
  margin-top: 12px;
  color: var(--success);
  min-height: 24px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Plot Container */
.plot-container {
  width: 100%;
  height: 600px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.controls-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-bar select {
  width: auto;
  margin: 0;
  flex: 1;
}

.controls-bar button {
  width: auto;
  margin: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
