/* ══════════════════════════════════════════════════════════════════════════
   ADVANCED CONTROL SYSTEM ANALYZER — PREMIUM DARK THEME
   ══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Primary Colors */
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  
  /* Background Colors - Dark Theme */
  --bg-dark: #0f0f1a;
  --bg-darker: #0a0a12;
  --bg-card: rgba(22, 22, 35, 0.85);
  --bg-card-solid: #161623;
  --bg-input: rgba(30, 30, 50, 0.6);
  --bg-hover: rgba(139, 92, 246, 0.1);
  
  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;
  
  /* Border Colors */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-accent: rgba(139, 92, 246, 0.3);
  --border-glow: rgba(139, 92, 246, 0.5);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  
  /* Glassmorphism */
  --glass-blur: blur(20px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
  
  /* Animation */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  
  /* Animated gradient background */
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 70%),
    var(--bg-darker);
  background-attachment: fixed;
}

/* Subtle animated noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTAINER & LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.container {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 32px 40px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  margin-top: 24px;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER & TITLE
   ═══════════════════════════════════════════════════════════════════════════ */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 40px;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-container {
  display: flex;
  gap: 8px;
  background: rgba(15, 15, 26, 0.6);
  padding: 6px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-500) transparent;
}

.tab-container::-webkit-scrollbar {
  height: 4px;
}

.tab-container::-webkit-scrollbar-track {
  background: transparent;
}

.tab-container::-webkit-scrollbar-thumb {
  background: var(--primary-500);
  border-radius: 4px;
}

.tab-button {
  flex: 1;
  min-width: 180px;
  padding: 14px 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  white-space: nowrap;
}

.tab-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tab-button:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-button.active {
  color: white;
  font-weight: 600;
}

.tab-button.active::before {
  opacity: 1;
}

.tab-button span,
.tab-button {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB CONTENT & ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeSlideIn 0.4s ease-out;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════════════════════ */
.analysis-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-section h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TWO-COLUMN LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.layout-two-columns {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
}

.main-column {
  min-width: 0;
}

.side-column {
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HELP CARD (Side Panel)
   ═══════════════════════════════════════════════════════════════════════════ */
.help-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: sticky;
  top: 24px;
  backdrop-filter: blur(10px);
}

.help-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-card h3::before {
  content: '💡';
  font-size: 1.1rem;
}

.help-card ul {
  list-style: none;
  padding: 0;
}

.help-card li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.help-card li:last-child {
  border-bottom: none;
}

.help-card li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-500);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PARAMS SECTION (Controls)
   ═══════════════════════════════════════════════════════════════════════════ */
.params-section {
  background: rgba(30, 30, 50, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.param-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

input::placeholder {
  color: var(--text-muted);
}

input:hover,
select:hover {
  border-color: var(--border-accent);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background: rgba(30, 30, 50, 0.8);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

select option {
  background: var(--bg-card-solid);
  color: var(--text-primary);
  padding: 12px;
}

/* Checkbox styling */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.checkbox-group input[type="checkbox"]:checked {
  background: var(--primary-gradient);
  border-color: var(--primary-500);
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Frequency range inputs */
.freq-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.freq-range input {
  flex: 1;
}

.freq-range span {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ZPK DISPLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.zpk-display {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.zpk-display h4 {
  color: #22d3ee;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zpk-display h4::before {
  content: '⚡';
}

.zpk-content {
  background: rgba(15, 15, 26, 0.5);
  padding: 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #22d3ee;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.analyze-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin: 28px auto;
  padding: 16px 32px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.analyze-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.5);
}

.analyze-btn:hover::before {
  opacity: 1;
}

.analyze-btn:active {
  transform: translateY(0);
}

/* Secondary Button */
.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  color: var(--text-accent);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.secondary-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--primary-500);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLOT CONTAINERS
   ═══════════════════════════════════════════════════════════════════════════ */
.plot-container {
  background: rgba(15, 15, 26, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin: 24px 0;
  min-height: 450px;
  position: relative;
  overflow: hidden;
}

/* Plotly overrides for dark theme */
.plot-container .plotly .main-svg {
  border-radius: var(--radius-lg);
}

#freq-plot { min-height: 520px; }
#time-plot { min-height: 420px; }
#pz-plot { min-height: 360px; }

/* Loading state */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 450px;
  background: rgba(15, 15, 26, 0.5);
  border-radius: var(--radius-lg);
}

.loading-spinner::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error state */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 24px;
  border-radius: var(--radius-md);
  text-align: center;
  margin: 20px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULTS SECTION & TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.results-section {
  margin-top: 32px;
}

.results-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.response-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(22, 22, 35, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.response-table th {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.12) 100%);
  color: var(--text-primary);
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
}

.response-table td {
  padding: 14px 20px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
}

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

.response-table tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INTERPRETATION BOX
   ═══════════════════════════════════════════════════════════════════════════ */
.interpretation-box {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  position: relative;
}

.interpretation-box::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 4px 0 0 4px;
}

.interpretation-box h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 8px;
}

.interpretation-box p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STABILITY STATUS INDICATORS
   ═══════════════════════════════════════════════════════════════════════════ */
.status-indicator {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.status-stable {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-stable::before {
  content: '✓';
  font-size: 1.2rem;
}

.status-unstable {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-unstable::before {
  content: '✗';
  font-size: 1.2rem;
}

.status-marginal {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-marginal::before {
  content: '⚠';
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CRITERIA TABLES (Routh, Hurwitz)
   ═══════════════════════════════════════════════════════════════════════════ */
.criteria-results {
  margin-top: 32px;
}

.criteria-results h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.routh-array,
.hurwitz-matrix {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(22, 22, 35, 0.6);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.routh-array th,
.routh-array td,
.hurwitz-matrix th,
.hurwitz-matrix td {
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  text-align: center;
  font-size: 0.875rem;
}

.routh-array th,
.hurwitz-matrix th {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  font-weight: 600;
}

.routh-row-label {
  background: rgba(139, 92, 246, 0.08) !important;
  font-weight: 600;
  color: var(--text-accent) !important;
}

#criteria-conclusion {
  padding: 16px;
  background: rgba(30, 30, 50, 0.4);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXTRA TOOLS SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.extra-tools {
  margin-top: 32px;
}

.extra-tools h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

#pz-text {
  margin-top: 12px;
  padding: 16px;
  background: rgba(30, 30, 50, 0.4);
  border-radius: var(--radius-sm);
  border-left: 3px solid #22d3ee;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DYNAMIC PARAMS & FORMULA DISPLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.dynamic-params {
  background: rgba(30, 30, 50, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0;
}

.param-row {
  margin-bottom: 16px;
}

.param-row:last-child {
  margin-bottom: 0;
}

.formula-display {
  background: rgba(15, 15, 26, 0.5);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary-500);
  margin-top: 16px;
  overflow-x: auto;
}

.info-box {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #fbbf24;
  margin-top: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY & FOCUS
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-button:focus-visible,
.analyze-btn:focus-visible,
.secondary-btn:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Remove focus outline on mouse click */
.tab-button:focus:not(:focus-visible),
.analyze-btn:focus:not(:focus-visible),
.secondary-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .layout-two-columns {
    grid-template-columns: 1fr;
  }
  
  .help-card {
    position: static;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  .container {
    margin: 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .tab-container {
    flex-direction: column;
    gap: 4px;
  }
  
  .tab-button {
    min-width: auto;
    text-align: left;
  }
  
  .param-group {
    grid-template-columns: 1fr;
  }
  
  .freq-range {
    flex-direction: column;
    gap: 8px;
  }
  
  .analyze-btn {
    width: 100%;
    max-width: none;
    padding: 14px 24px;
  }
  
  .response-table th,
  .response-table td {
    padding: 10px 14px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 8px;
    padding: 16px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .params-section {
    padding: 16px;
  }
  
  .zpk-display {
    padding: 14px;
    font-size: 0.8125rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLOTLY DARK THEME OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */
.js-plotly-plot .plotly .modebar {
  background: transparent !important;
}

.js-plotly-plot .plotly .modebar-btn {
  color: var(--text-secondary) !important;
}

.js-plotly-plot .plotly .modebar-btn:hover {
  color: var(--text-primary) !important;
}