/* =============================================================================
   Generic TLD Calculator Styles - v2.3.0
   Inherits main calculator styles with specific TLD colors

   Changes:
   - Added margin-bottom to .collapsible-content.expanded for better spacing
   - Moved Calculator Settings section below Domain Projections section
   ========================================================================== */

/* Import main calculator selection styles */
@import url('../calculator-selection.css');

/* CSS Variables */
:root {
  /* Generic Colors - Peach/Orange Palette */
  --primary-color: #FFCC99; /* Default for dark theme */
  --primary-color-dark-theme: #FFCC99; /* Original color for dark theme */
  --primary-color-light-theme: #AB9855; /* Light theme */
  --primary-gold: #FFCC99; /* Logo/accent color - will be overridden by theme */

  /* Surface Colors */
  --surface: rgba(18, 18, 18, 0.95);
  --surface-variant: rgba(255, 255, 255, 0.08);
  --surface-container: rgba(255, 255, 255, 0.12);
  --surface-container-high: rgba(255, 255, 255, 0.17);
  --surface-container-highest: rgba(255, 255, 255, 0.22);

  /* Text Colors */
  --on-surface: #ffffff;
  --on-surface-variant: #b3b3b3;
  --on-surface-variant-2: #808080;

  /* Header Theme Backgrounds */
  --header-bg-dark: #000000;
  --header-bg-light: #ffffff;

  /* Generic Specific Colors */
  --active-card-bg: rgba(255, 204, 153, 0.15);
  --active-card-border: #FFCC99;
  --result-positive: #4caf50;
  --result-negative: #f44336;
  --revenue-color: #FFCC99;
  --profit-color: #4caf50;
  --breakeven-color: #2196f3;

  /* Cumulative Profit Chart Colors - Theme Aware */
  --primary-color-chart: #ffe5cc; /* Lighter version (50% white added to #FFCC99) for dark theme */
  --primary-color-chart-dark: #80664d; /* Darker version (50% black added to #FFCC99) for light theme */
  --primary-color-chart-light: #ffe5cc; /* Lighter version for dark theme */

  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(10px);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Theme-aware border colors for totals */
  --totals-border-dark: #ffffff; /* White for dark theme */
  --totals-border-light: #000000; /* Black for light theme */
}

/* Hero Title Styling */
.generic-domain {
  color: var(--primary-color);
  font-weight: 700;
  display: block;
  margin-bottom: 0;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.3));
}

[data-theme="light"] .generic-domain {
  text-shadow: 2px 2px 6px rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0px 2px 6px rgba(255, 255, 255, 0.8));
}

[data-theme="dark"] .generic-domain {
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.8));
}

.hero-title {
  margin: 0 0 0 0;
  padding: 0;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.3));
}

[data-theme="light"] .hero-title {
  text-shadow: 2px 2px 6px rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0px 2px 6px rgba(255, 255, 255, 0.8));
}

[data-theme="dark"] .hero-title {
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.8));
}

.hero-calculator-title {
  margin: 0.5rem 0 0 0;
  padding: 0;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
}

.hero-subtitle {
  margin: var(--spacing-lg) 0 0 0;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #000000 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.3));
}

[data-theme="light"] .hero-subtitle {
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0px 2px 4px rgba(255, 255, 255, 0.8));
}

[data-theme="dark"] .hero-subtitle {
  color: #ffffff !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.8));
}

.section-description {
  margin: 0 0 var(--spacing-lg) 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--on-surface-variant);
  text-align: left;
  width: 100%;
  display: block;
}

/* Section Header with Toggle */
.section-header-with-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

/* Bulletproof Advanced Toggle Switch - FIXED */
.advanced-toggle-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.toggle-switch {
  cursor: pointer;
  display: inline-block;
  user-select: none;
  position: relative;
}

/* Hide the checkbox visually but keep it accessible */
.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
}

.toggle-slider {
  display: inline-block;
  width: 60px;
  height: 30px;
  background: #666;
  border-radius: 15px;
  position: relative;
  transition: background 0.2s ease;
  cursor: pointer;
}

.toggle-handle {
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* FIXED CSS selectors - Use general sibling combinator since input is hidden */
.toggle-switch input[type="checkbox"]:checked ~ .toggle-slider {
  background: var(--primary-color, #FFB366) !important;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-slider .toggle-handle {
  transform: translateX(30px) !important;
}

.toggle-status {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-surface);
  min-width: 30px;
  text-align: left;
  transition: color 0.2s ease;
}

/* Theme-specific status colors */
[data-theme="dark"] .toggle-status {
  color: #ffffff !important;
}

[data-theme="light"] .toggle-status {
  color: #333333;
}

/* Enhanced focus indicator for accessibility */
.toggle-switch input[type="checkbox"]:focus ~ .toggle-slider {
  box-shadow: 0 0 0 3px rgba(255, 204, 153, 0.3);
}

/* Enhanced hover effect */
.toggle-switch:hover .toggle-slider {
  background: #777 !important;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-slider:hover {
  background: #e6a833 !important;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--on-surface);
  white-space: nowrap;
}

/* Theme-specific toggle colors */
[data-theme="dark"] .toggle-slider {
  background-color: #555 !important;
}

[data-theme="dark"] .toggle-slider:before {
  background-color: #ffffff !important;
}

[data-theme="light"] .toggle-slider {
  background-color: #ccc !important;
}

[data-theme="light"] .toggle-slider:before {
  background-color: #ffffff !important;
}

/* Compact Individual Input Toggles */
.input-toggle {
  cursor: pointer;
  display: inline-block;
  user-select: none;
  position: relative;
  margin-left: var(--spacing-md);
  flex-shrink: 0;
  width: 36px;    /* Explicit dimensions */
  height: 18px;
}

/* Hide the checkbox visually but keep it accessible and clickable */
.input-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;    /* Fill container */
  height: 100%;   /* Fill container */
  cursor: pointer;
  z-index: 999;   /* Much higher z-index */
  margin: 0;
  padding: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.input-toggle-slider {
  display: block;
  width: 36px;
  height: 18px;
  background: #666;
  border-radius: 9px;
  position: absolute;
  top: 0;
  left: 0;
  transition: background 0.2s ease;
  pointer-events: none;  /* Let clicks pass through to hidden checkbox */
}

.input-toggle-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  pointer-events: none;  /* Prevent handle from blocking clicks */
}

/* Individual toggle checked state */
.input-toggle input[type="checkbox"]:checked ~ .input-toggle-slider {
  background: var(--primary-color, #FFB366) !important;
}

.input-toggle input[type="checkbox"]:checked ~ .input-toggle-slider .input-toggle-handle {
  transform: translateX(18px) !important;
}

/* Custom toggle active state (overrides checkbox-based system) */
.input-toggle.toggle-active .input-toggle-slider {
  background: var(--primary-color, #FFB366) !important;
  transition: background 0.3s ease !important;
}

.input-toggle.toggle-active .input-toggle-slider .input-toggle-handle {
  transform: translateX(18px) !important;
  transition: transform 0.3s ease !important;
}

.input-toggle.toggle-inactive .input-toggle-slider {
  background: #666 !important;
  transition: background 0.3s ease !important;
}

.input-toggle.toggle-inactive .input-toggle-slider .input-toggle-handle {
  transform: translateX(0) !important;
  transition: transform 0.3s ease !important;
}

/* Theme-specific individual toggle colors */
[data-theme="dark"] .input-toggle-slider {
  background-color: #555 !important;
}

[data-theme="dark"] .input-toggle-slider .input-toggle-handle {
  background-color: #ffffff !important;
}

[data-theme="light"] .input-toggle-slider {
  background-color: #ccc !important;
}

[data-theme="light"] .input-toggle-slider .input-toggle-handle {
  background-color: #ffffff !important;
}

/* Enhanced focus indicator for individual toggles */
.input-toggle input[type="checkbox"]:focus ~ .input-toggle-slider {
  box-shadow: 0 0 0 2px rgba(255, 204, 153, 0.3);
}

/* Enhanced hover effect for individual toggles */
.input-toggle:hover .input-toggle-slider {
  background: #777 !important;
}

.input-toggle input[type="checkbox"]:checked ~ .input-toggle-slider:hover {
  background: #e6a833 !important;
}

/* Disabled state for individual inputs */
.input-group.disabled {
  opacity: 0.5;
  pointer-events: none;
  transform: translateY(2px);
  transition: all 0.3s ease;
}

.input-group.disabled .input-wrapper {
  background: var(--surface-container-low);
  border-color: var(--glass-border-light);
}

/* Disabled state for advanced settings */
.advanced-settings-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.advanced-settings-disabled .input-wrapper {
  background: #333 !important;
}

[data-theme="light"] .advanced-settings-disabled .input-wrapper {
  background: #f5f5f5 !important;
}

/* Specific override for Advanced Settings section title */
.section-title-no-margin {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Background inherited from main site /css/style.css */
  color: var(--on-surface);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.generic-calculator-page {
  /* Use main site background from /css/style.css for consistency */
}

/* Page Container */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.page-header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--spacing-md) 0;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 600;
}

.logo-text {
  color: var(--on-surface);
}

.logo-separator {
  color: var(--primary-color);
  margin: 0 var(--spacing-xs);
}

.logo-calculator {
  color: var(--primary-color);
  font-weight: 500;
}

.header-nav {
  display: flex;
  gap: var(--spacing-md);
}

.nav-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--on-surface);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-button:hover {
  background: var(--surface-container);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.nav-button .material-icons {
  font-size: 1.125rem;
}

/* Main Content */
.main-content {
  flex: 1;
}

.calculator-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Calculator Header */
.calculator-header {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.tld-icon {
  font-size: 4rem;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--active-card-bg);
  border: 2px solid var(--active-card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.generic-icon {
  background: linear-gradient(135deg, rgba(255, 204, 153, 0.2) 0%, rgba(255, 204, 153, 0.1) 100%);
  border-color: var(--primary-color);
}

.calculator-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--on-surface) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.calculator-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--on-surface-variant);
  max-width: 600px;
  line-height: 1.6;
}

.hero-description {
  margin: 0 auto;
  padding-top: var(--spacing-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

@media (min-width: 768px) {
  .hero-description {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    padding-top: var(--spacing-xl);
  }
}

.description-section {
  border: 1px solid var(--glass-border);
  padding: var(--spacing-lg);
  transition: all var(--transition-medium);
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .description-section {
  box-shadow: 0px 4px 12px rgba(255, 255, 255, 0.6);
}

.description-section:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.description-section h3 {
  color: var(--primary-color);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.description-section-icon {
  width: 20px;
  height: 20px;
  color: var(--primary-color);
}

.description-section h3 svg {
  margin-top: 2px;
}

.description-section p {
  color: #000000 !important;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
  text-align: left;
}

[data-theme="dark"] .description-section p {
  color: #ffffff !important;
}

/* Cost Structure Section */
.cost-structure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.cost-card {
  border: 2px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-lg);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.cost-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-color);
}

.cost-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.cost-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cost-header h3 {
  color: var(--on-surface);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.cost-from {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.cost-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  text-align: left;
}

.cost-note {
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

.cost-note a {
  color: var(--primary-color);
  text-decoration: none;
}

.cost-note a:hover {
  text-decoration: underline;
}

.cost-actions {
  text-align: center;
  margin-top: var(--spacing-lg);
}

/* Advanced Options Section */
.advanced-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-lg);
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.option-group label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 500;
  color: var(--on-surface);
  font-size: 1rem;
}

.option-group label i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

/* Option label styling (for div-based labels) */
.option-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 500;
  color: var(--on-surface);
  font-size: 1rem;
}

.option-label i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.option-label svg {
  color: var(--primary-color);
  width: 20px;
  height: 20px;
}

.option-group select {
  background: var(--surface-container);
  border: 2px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-md);
  color: var(--on-surface);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 204, 153, 0.2);
}

.option-group select option {
  background: var(--surface);
  color: var(--on-surface);
}

/* Calculator Sections */
.calculator-section {
  border: 1px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

/* Hero section with reduced margin */
.calculator-hero.calculator-section {
  margin-bottom: calc(var(--spacing-xl) * 0.4); /* 60% reduction from original */
  overflow: hidden; /* Add overflow hidden for word cloud */
  position: relative;
}

/* Generic Calculator Word Cloud Integration */
#generic-word-cloud-container {
  position: relative;
  z-index: 1;
}

#generic-word-cloud-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  pointer-events: none;
  z-index: 1;
}

/* Ensure word cloud doesn't interfere with readability in generic calculator */
#generic-word-cloud-container .hero-content {
  position: relative;
  z-index: 3;
  border-radius: 20px;
  margin: 0 auto;
}

/* Dark mode adjustments for generic calculator word cloud */
[data-theme="dark"] #generic-word-cloud-container::before {
  background: none;
}

/* Light mode adjustments for generic calculator word cloud */
[data-theme="light"] #generic-word-cloud-container::before {
  background: none;
}

/* Right-side separators for input sections */
.calculator-section:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 10%;
  right: -1px;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent,
    var(--glass-border) 20%,
    var(--glass-border) 80%,
    transparent
  );
  opacity: 0.6;
}

/* Left-side separator for results section */
.calculator-section:has(.results-dashboard)::before {
  content: '';
  position: absolute;
  top: 10%;
  left: -1px;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent,
    var(--primary-color) 20%,
    var(--primary-color) 80%,
    transparent
  );
  opacity: 0.4;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--on-surface);
  position: relative;
  margin-bottom: var(--spacing-md);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
  margin-top: var(--spacing-sm);
  border-radius: 2px;
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 500;
  color: var(--on-surface);
  font-size: 0.95rem;
  min-width: 0; /* Allow label to shrink */
  flex-wrap: wrap;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

/* Input Grid */
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* Small screens - use smaller minimum width */
@media (max-width: 480px) {
  .input-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
  }
}

/* Very small screens - use even smaller minimum width */
@media (max-width: 384px) {
  .input-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
  }
}

/* Ultra small screens - allow full width with padding */
@media (max-width: 320px) {
  .input-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  min-width: 0; /* Allow input groups to shrink */
  word-wrap: break-word;
  overflow-wrap: break-word;
}


.input-group label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 500;
  color: var(--on-surface);
  font-size: 0.95rem;
  min-width: 0; /* Allow label to shrink */
  flex-wrap: wrap;
}

/* Small screen label adjustments */
@media (max-width: 384px) {
  .input-group label {
    font-size: 0.9rem;
    gap: var(--spacing-xs);
  }

  .input-wrapper {
    padding: var(--spacing-sm);
  }

  .input-wrapper input {
    font-size: 1rem;
  }

  .input-prefix,
  .input-suffix {
    font-size: 0.8rem;
  }
}

/* Ultra small screen adjustments */
@media (max-width: 320px) {
  .input-wrapper {
    padding: var(--spacing-xs);
  }

  .input-wrapper input {
    font-size: 0.9rem;
  }

  .input-prefix,
  .input-suffix {
    font-size: 0.75rem;
  }
}

/* Container for labels with toggles */
.label-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.label-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 500;
  color: var(--on-surface);
  font-size: 0.95rem;
  cursor: pointer;
}

.label-text {
  font-weight: 500;
}

.input-group label .material-icons {
  color: var(--primary-color);
  font-size: 1.25rem;
}

/* Input Section Separator */
.input-section-separator {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
  grid-column: 1 / -1; /* Make separator span full width in grid */
}

.separator-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--glass-border) 20%,
    var(--glass-border) 80%,
    transparent 100%
  );
}

.separator-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--spacing-xs) var(--spacing-md);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  white-space: nowrap;
}

.separator-label .material-icons {
  font-size: 1rem;
}

.input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-md);
  transition: all var(--transition-fast);
  min-width: 0; /* Allow input wrapper to shrink */
  width: 100%;
}

/* Theme-specific input wrapper backgrounds */
[data-theme="light"] .input-wrapper {
  background: #ffffff;
}

.input-wrapper--with-prefix {
  padding-left: var(--spacing-sm);
}

.input-wrapper--with-suffix {
  padding-right: var(--spacing-sm);
}

.input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 204, 153, 0.2);
}

.input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--on-surface);
  font-size: 1.125rem;
  font-weight: 500;
  text-align: left;
  min-width: 0; /* Allow input to shrink below content size */
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Theme-specific input text colors */
[data-theme="dark"] .input-wrapper input {
  color: #ffffff !important;
}

[data-theme="light"] .input-wrapper input {
  color: #000000 !important;
}

.input-wrapper input:focus {
  outline: none;
}

.input-prefix,
.input-suffix {
  color: var(--on-surface-variant);
  font-weight: 500;
  font-size: 0.9rem;
  flex-shrink: 0; /* Prevent prefix/suffix from shrinking */
  white-space: nowrap; /* Prevent text wrapping */
  min-width: fit-content; /* Only take needed space */
}

/* Theme-specific input prefix/suffix text colors */
[data-theme="dark"] .input-prefix,
[data-theme="dark"] .input-suffix {
  color: #b3b3b3;
}

[data-theme="light"] .input-prefix,
[data-theme="light"] .input-suffix {
  color: #666666;
}

.input-prefix {
  margin-right: var(--spacing-sm);
  min-width: 40px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-suffix {
  margin-left: var(--spacing-sm);
  min-width: 40px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-description {
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Premium Tiers Grid */
.premium-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

/* Radio Options Grid */
.radio-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--surface-container);
  border: 2px solid var(--glass-border);
  border-radius: 0px;
  padding: 0.5rem var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

/* Theme-specific radio option backgrounds */
[data-theme="dark"] .radio-option {
  background: #000000;
}

[data-theme="light"] .radio-option {
  background: #ffffff;
}

.radio-option:hover {
  border-color: var(--primary-color);
}

[data-theme="dark"] .radio-option:hover {
  background: #000000;
}

[data-theme="light"] .radio-option:hover {
  background: #ffffff;
}

.radio-option input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  background: var(--surface);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-right: var(--spacing-sm);
}

/* Theme-specific radio button backgrounds */
[data-theme="dark"] .radio-option input[type="radio"] {
  background: #000000;
}

[data-theme="light"] .radio-option input[type="radio"] {
  background: #ffffff;
}

.radio-option input[type="radio"]:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000000;
}

.radio-option input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 204, 153, 0.2);
}

.radio-text {
  color: var(--on-surface);
  font-weight: 500;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Theme-specific radio text colors */
[data-theme="dark"] .radio-text {
  color: #ffffff !important;
}

[data-theme="light"] .radio-text {
  color: #000000 !important;
}

.radio-main-text {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
}

.radio-sub-text {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--on-surface-variant);
  line-height: 1.2;
}

.tier-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.tier-label {
  font-weight: 500;
  color: var(--on-surface);
  font-size: 0.9rem;
}

.tier-inputs {
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  gap: var(--spacing-sm);
}

.tier-inputs .input-wrapper {
  min-width: 0; /* Prevent grid items from overflowing */
}

.tier-inputs .input-wrapper input {
  min-width: 0; /* Allow input to shrink */
  width: 100%;
}

/* Mobile: Keep tier inputs horizontal on one line */

@media (max-width: 576px) {
  .tier-inputs {
    grid-template-columns: 0.5fr 1fr;
    gap: var(--spacing-xs);
  }
}



/* Results Dashboard */
.results-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

/* Summary Cards */
.summary-cards {
  display: grid;
  gap: var(--spacing-lg);
  /* Default mobile layout: 1 column */
  grid-template-columns: 1fr;
}

/* Tablet layout (768px - 1199px): 2 cards per row */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop layout (1200px+): 4-2-1 grid structure */
@media (min-width: 1200px) {
  .summary-cards {
    grid-template-columns: repeat(4, 1fr);
    /* Currently shows 4 cards in first row */
    /* Layout designed to support future 4-2-1 expansion */
  }
}

.result-card {
  background: var(--surface-container);
  border: none;
  border-radius: 0px;
  padding: var(--spacing-lg);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #444444;
}

[data-theme="dark"] .result-card::before {
  background: #CCCCCC;
}

.result-card.revenue-card::before {
  background: var(--revenue-color);
}
.result-card.profit-card::before {
  background: #444444;
}

[data-theme="dark"] .result-card.profit-card::before {
  background: #4A90E2;
}

/* Specific styling for Amortized Cost card only */
.result-card.profit-card#amortizedCostCard {
  background: rgba(74, 144, 226, 0.1);
  position: relative;
  overflow: hidden;
}

/* Background icon for Amortized Cost card */
.result-card.profit-card#amortizedCostCard::after {
  content: '\e8f0'; /* Material Icons timeline unicode */
  font-family: 'Material Icons';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%) scale(6);
  font-size: 24px;
  color: rgba(74, 144, 226, 0.12);
  z-index: 1;
  pointer-events: none;
}
.result-card.profit-card#amortizedCostCard .result-header {
  position: relative;
  z-index: 2;
}

/* Background icon for Break-even card */
.result-card.breakeven-card::after {
  content: '\f076'; /* Material Icons balance unicode */
  font-family: 'Material Icons';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%) scale(6);
  font-size: 24px;
  color: rgba(255, 204, 153, 0.12);
  z-index: 1;
  pointer-events: none;
}

.result-card.breakeven-card .result-header {
  position: relative;
  z-index: 2;
}

.result-card.breakeven-card .result-value {
  position: relative;
  z-index: 2;
}

.result-card.breakeven-card .result-trend {
  position: relative;
  z-index: 2;
}

/* Background icon for Net Profit card */
.result-card.profit-card#netProfitCard::after {
  content: '\e263'; /* Material Icons trending_up unicode */
  font-family: 'Material Icons';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%) scale(6);
  font-size: 24px;
  color: rgba(76, 175, 80, 0.12);
  z-index: 1;
  pointer-events: none;
}

.result-card.profit-card#netProfitCard .result-header {
  position: relative;
  z-index: 2;
}

.result-card.profit-card#netProfitCard .result-value {
  position: relative;
  z-index: 2;
}

.result-card.profit-card#netProfitCard .result-trend {
  position: relative;
  z-index: 2;
}

/* Negative state: Red icon for Net Profit card */
.result-card.profit-card.negative#netProfitCard::after {
  color: rgba(244, 67, 54, 0.12);
}

/* Background icon for ROI card */
.result-card.roi-card#roiCard::after {
  content: '\e850'; /* Material Icons monetization_on unicode */
  font-family: 'Material Icons';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%) scale(6);
  font-size: 24px;
  color: rgba(76, 175, 80, 0.12);
  z-index: 1;
  pointer-events: none;
}

.result-card.roi-card#roiCard .result-header {
  position: relative;
  z-index: 2;
}

.result-card.roi-card#roiCard .result-value {
  position: relative;
  z-index: 2;
}

.result-card.roi-card#roiCard .result-trend {
  position: relative;
  z-index: 2;
}

.result-card.profit-card#amortizedCostCard .result-header h3 {
  color: #4A90E2;
}

.result-card.profit-card#amortizedCostCard .result-value {
  color: #4A90E2;
  font-weight: bold;
  position: relative;
  z-index: 2;
}

.result-card.profit-card#amortizedCostCard .result-trend {
  color: #4A90E2;
  position: relative;
  z-index: 2;
}

/* Dynamic styling for Net Profit card based on positive/negative values */
.result-card.profit-card#netProfitCard.positive {
  background: rgba(76, 175, 80, 0.1);
}
.result-card.profit-card#netProfitCard.positive .result-header .material-icons {
  color: #4caf50;
}
.result-card.profit-card#netProfitCard.positive .result-header h3 {
  color: #4caf50;
}
.result-card.profit-card#netProfitCard.positive .result-value {
  color: #4caf50;
  font-weight: bold;
}
.result-card.profit-card#netProfitCard.positive::before {
  background: #4caf50;
}

.result-card.profit-card#netProfitCard.negative {
  background: rgba(244, 67, 54, 0.1);
}
.result-card.profit-card#netProfitCard.negative .result-header .material-icons {
  color: #f44336;
}
.result-card.profit-card#netProfitCard.negative .result-header h3 {
  color: #f44336;
}
.result-card.profit-card#netProfitCard.negative .result-value {
  color: #f44336;
  font-weight: bold;
}
.result-card.profit-card#netProfitCard.negative::before {
  background: #f44336;
}

/* Dynamic styling for ROI card based on positive/negative values */
.result-card.roi-card.positive {
  background: rgba(76, 175, 80, 0.1);
}
.result-card.roi-card.positive .result-header .material-icons {
  color: #4caf50;
}
.result-card.roi-card.positive .result-header h3 {
  color: #4caf50;
}
.result-card.roi-card.positive .result-value {
  color: #4caf50;
  font-weight: bold;
}
.result-card.roi-card.positive::before {
  background: #4caf50;
}

.result-card.roi-card.negative {
  background: rgba(244, 67, 54, 0.1);
}
.result-card.roi-card.negative .result-header .material-icons {
  color: #f44336;
}
.result-card.roi-card.negative .result-header h3 {
  color: #f44336;
}
.result-card.roi-card.negative .result-value {
  color: #f44336;
  font-weight: bold;
}
.result-card.roi-card.negative::before {
  background: #f44336;
}

/* Negative state: Red icon for ROI card */
.result-card.roi-card.negative#roiCard::after {
  color: rgba(244, 67, 54, 0.12);
}

/* Projections Legend Styling */
.projections-legend {
  border: 1px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.legend-title {
  color: var(--on-surface);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  text-align: center;
}

.legend-grid > div:first-child,
.legend-grid > div:nth-child(2),
.legend-grid > div:nth-child(3) {
  margin-bottom: var(--spacing-lg);
}

.legend-section {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0px;
  padding: var(--spacing-md);
}

.legend-section-title {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

.legend-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
  cursor: default;
  justify-content: center;
}

.legend-header .material-icons {
  font-size: 1.25rem;
  color: var(--primary-color);
}


.legend-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* Domain Metrics section - increase spacing */
.legend-header:has(+ .legend-items .low-growth) + .legend-items,
.legend-items:has(.low-growth) {
  gap: var(--spacing-xs);
}

/* Special Indicators section - increase spacing */
.legend-header:has(+ .legend-items .break-even-year) + .legend-items,
.legend-items:has(.break-even-year) {
  gap: var(--spacing-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  justify-content: center;
}

/* Specific legend-text colors to match icons */
.legend-color.profit-positive + .legend-text,
.legend-text.positive-profit {
  color: #4caf50;
  font-weight: 500;
}

.legend-color.profit-negative + .legend-text,
.legend-text.negative-profit {
  color: #f44336;
  font-weight: 500;
}

/* Make multiplier text look like multiplier-indicators */
.legend-text.negative-growth {
  font-size: 0.85em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.legend-text.no-growth {
  font-size: 0.85em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(158, 158, 158, 0.1);
  border: 1px solid rgba(158, 158, 158, 0.3);
  color: #9e9e9e;
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.legend-text.low-growth {
  font-size: 0.85em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: #ff9800;
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.legend-text.medium-growth {
  font-size: 0.85em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  color: #2196f3;
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.legend-text.high-growth {
  font-size: 0.85em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #4caf50;
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.legend-color.amortized-costs + .legend-text,
.legend-text.amortized-costs-text {
  color: #4A90E2;
  font-weight: bold;
  background-color: rgba(74, 144, 226, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Break-even Year legend text styling */
.legend-text.break-even-year {
  color: var(--primary-color);
  font-weight: 500;
  border: 1px solid var(--primary-color);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.9em;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.2;
}

/* Totals Row legend text styling */
.legend-text.totals-row {
  color: var(--on-surface);
  font-weight: 500;
  border: 1px solid var(--totals-border-color);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.9em;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.05);
}

/* Theme-specific background adjustment for totals row */
[data-theme="light"] .legend-text.totals-row {
  background: rgba(0, 0, 0, 0.05);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.profit-positive {
  background: #4caf50;
}

.legend-color.profit-negative {
  background: #f44336;
}

.legend-color.amortized-costs {
  background: #4A90E2;
}

.legend-break-even {
  width: 16px;
  height: 16px;
  background: rgba(255, 204, 153, 0.15);
  border: 2px solid var(--primary-color);
  border-radius: 4px;
}

/* Responsive legend */

@media (max-width: 576px) {
  .legend-grid {
    grid-template-columns: 1fr;
  }

  .legend-section {
    padding: var(--spacing-sm);
  }
}

/* Styling for Break-even card using primary color theme */
.result-card.breakeven-card {
  background: rgba(255, 204, 153, 0.15); /* Darker version of primary color for background */
}
.result-card.breakeven-card .result-header .material-icons {
  color: var(--primary-color); /* Use CSS variable for primary color */
}
.result-card.breakeven-card .result-header h3 {
  color: var(--primary-color);
}
.result-card.breakeven-card .result-value {
  color: var(--primary-color);
  font-weight: bold;
}
.result-card.breakeven-card .result-trend {
  color: var(--primary-color);
}
.result-card.breakeven-card::before {
  background: var(--primary-color); /* Primary color for accent line */
}



.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.result-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 0;
}

.result-header .material-icons {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.result-header h3 {
  color: var(--on-surface);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: left;
  flex-grow: 1;
}

.result-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
}

.result-trend {
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  white-space: nowrap;
}

.result-trend.positive {
  color: var(--result-positive);
}

.result-trend.negative {
  color: var(--result-negative);
}


.result-trend.neutral {
  color: var(--on-surface-variant);
}

/* Projections Table */
.projections-table-container {
  border-radius: 0px;
}

.projections-cards {
  display: none; /* Hide cards by default on desktop */
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 0px;
}

.projections-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.projections-table th,
.projections-table td {
  padding: var(--spacing-sm);
  text-align: right;
  border-bottom: 1px solid var(--glass-border);
}

.projections-table th {
  background: transparent;
  color: var(--on-surface);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.projections-table th:first-child {
  text-align: left;
}

.projections-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--primary-color);
}


.projections-table tr:hover {
  background: var(--surface-container);
}

/* Loading State for Projections Table */
.loading-row {
  height: 80px;
}

.loading-message {
  text-align: center !important;
  color: var(--on-surface-variant) !important;
  font-style: italic;
  padding: var(--spacing-lg) !important;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: var(--spacing-sm);
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.no-data {
  text-align: center !important;
  color: var(--error) !important;
  font-style: italic;
  padding: var(--spacing-lg) !important;
}

/* Profit/Loss Color Coding for Tables */
.profit-positive {
  color: var(--result-positive) !important;
  font-weight: 600;
}

.profit-negative {
  color: var(--result-negative) !important;
  font-weight: 600;
}

/* Chart Container */
.chart-container {
  background: transparent;
  border-radius: 0px;
  padding: 0;
  margin-top: var(--spacing-lg);
  min-height: 400px;
  height: auto;
}

/* Disable hover effects on chart SVG */
.apexcharts-svg.hovering-zoom {
  cursor: default !important;
}

.apexcharts-svg.hovering-zoom * {
  cursor: default !important;
}

/* Force chart SVG backgrounds to respect theme */
[data-theme="dark"] .apexcharts-svg {
  background: transparent !important;
}

[data-theme="light"] .apexcharts-svg {
  background: transparent !important;
}

/* Ensure all ApexCharts SVG elements have transparent background */
.apexcharts-svg {
  background: transparent !important;
}

/* Reduce legend spacing from chart below */
.apexcharts-legend-series {
  margin: 10px 15px !important;
}

/* Year column data cell styling in projections table */
[data-theme="light"] .projections-table td:first-child {
  color: #E67E00;
  font-weight: 600;
}



/* Set all SVG icons to use primary color */
svg {
  fill: var(--primary-color) !important;
}

/* Ensure SVG icons in section titles and subsections use primary color */
.section-title svg,
.subsection-title svg {
  fill: var(--primary-color) !important;
}

/* Make icons in primary action buttons black */
.action-button.primary svg {
  fill: #000000 !important;
}

/* Make icons in toggle buttons theme-aware */
.toggle-button svg {
  fill: #000000 !important;
}

/* Light theme - white icons */
[data-theme="light"] .toggle-button svg {
  fill: #ffffff !important;
}

#breakevenChart,
#domainAnalysisChart {
  width: 100%;
  height: auto;
  min-height: 350px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: center;
}

.action-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--on-surface);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}

.action-button:hover {
  transform: translateY(-2px);
}

.action-button.primary {
  background: var(--primary-color);
  color: #000000 !important;
  border-color: var(--primary-color);
}

.action-button.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.action-button.secondary {
  background: transparent;
  border-color: var(--glass-border);
}

.action-button.secondary:hover {
  background: #000000;
  border-color: var(--primary-color);
  color: #ffffff !important;
}

/* Secondary button icon colors */
.action-button.secondary svg,
.action-button.secondary .material-icons {
  color: var(--primary-color);
}

.action-button.secondary:hover svg,
.action-button.secondary:hover .material-icons {
  color: #ffffff !important;
}

.action-button .material-icons {
  font-size: 1.125rem;
}

/* Footer */
.page-footer {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-info {
  color: var(--on-surface-variant);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-links a {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* Responsive Design */
@media (min-width: 768px) and (max-width: 991px) {
  .input-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Keep 2-column layout until 576px */
@media (min-width: 576px) and (max-width: 767px) {
  .input-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (min-width: 992px) and (max-width: 1199px) {
  .input-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (max-width: 576px) {
  .header-content {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }

  .header-nav {
    justify-content: center;
  }

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

  .premium-tiers-grid {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }


  .calculator-section {
    padding: var(--spacing-md);
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-button {
    width: 100%;
    justify-content: center;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .projections-table {
    font-size: 0.75rem;
  }

  .projections-table th,
  .projections-table td {
    padding: var(--spacing-xs);
  }

  .chart-container {
    min-height: 350px;
    height: auto;
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  #breakevenChart,
  #domainAnalysisChart {
    width: 100%;
    height: 400px;
    min-height: 400px;
    position: relative;
  }

  /* Mobile Projections Cards */
  .projections-table-container {
  }

  .projections-table {
    display: none; /* Hide table on mobile */
  }

  .projections-cards {
    display: flex; /* Show cards only on mobile */
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .projection-card {
    border: 1px solid var(--glass-border);
    padding-top: var(--spacing-sm);
    transition: all var(--transition-medium);
  }

  .projection-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
  }

  .projection-card.totals-card {
    font-weight: bold;
    border: 2px solid var(--totals-border-color, rgba(204, 153, 51, 0.3));
  }

  .projection-year {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-align: center;
  }

  .projection-year .material-icons {
    font-size: 1.125rem;
  }

  .projection-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }

  .projection-metric {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
  }

  .metric-label {
    font-size: 0.75rem;
    color: var(--on-surface-variant);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .metric-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--on-surface);
    line-height: 1.2;
  }

  .metric-value.profit-negative {
    color: var(--result-negative);
  }

  .metric-value.profit-positive {
    color: var(--result-positive);
  }

  .projection-domains {
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--spacing-md);
    border-radius: 0px;
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }

  .domain-count {
    text-align: center;
    flex: 1;
  }

  .domain-count-label {
    font-size: 0.75rem;
    color: var(--on-surface-variant);
  }

  .domain-count-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--on-surface);
  }
}

/* Advanced Settings section - no bottom padding on desktop */
@media (min-width: 769px) {
  #advancedSettingsSection {
    padding-bottom: 0;
  }

  #calculatorStrategiesSection {
    padding-bottom: 0;
  }
}


@media (max-width: 576px) {
  .projection-domains {
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--spacing-sm);
    border-radius: 0px;
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .calculator-title {
    font-size: 2rem;
  }

  .calculator-subtitle {
    font-size: 1rem;
  }

  .tld-icon {
    width: 80px;
    height: 80px;
    font-size: 3rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .result-value {
    font-size: 1.5rem;
  }

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

/* Ultra small screens - projection cards in single column */
@media (max-width: 384px) {
  .projection-domains {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .projection-metrics {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

/* TLD and Import 2-Column Layout */
.tld-import-two-column {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-lg);
  align-items: start;
}

/* Mobile: Stack vertically */

@media (max-width: 576px) {
  .tld-import-two-column {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

/* TLD and Import Analysis Responsive Container */
.tld-import-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-lg); /* Restore gap between sections */
  align-items: stretch; /* Make sections fill container height */
}

/* Sections will inherit natural calculator-section styling */

/* Mobile: Stack vertically with TLD first, then Import */

@media (max-width: 576px) {
  .tld-import-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-md); /* Restore gap on mobile */
  }
}

/* Dark Theme Specific */
[data-theme="dark"] {
  /* All the above styles already use dark theme colors */
  --totals-border-color: var(--totals-border-dark);
}

/* Light Theme Support */
[data-theme="light"] {
  --primary-color: var(--primary-color-light-theme); /* Use darker primary color for light theme */
  --primary-color-chart: var(--primary-color-chart-dark); /* Use darker chart color for light theme */
  --primary-gold: #AB9855; /* Light theme logo color */
  --surface: rgba(255, 255, 255, 0.95);
  --surface-variant: rgba(0, 0, 0, 0.08);
  --surface-container: rgba(0, 0, 0, 0.12);
  --surface-container-high: rgba(0, 0, 0, 0.17);
  --surface-container-highest: rgba(0, 0, 0, 0.22);
  --on-surface: #000000;
  --on-surface-variant: #666666;
  --on-surface-variant-2: #333333;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(0, 0, 0, 0.2);
  --totals-border-color: var(--totals-border-light);

  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
}

/* Light theme secondary button override - light grey background with black text */
[data-theme="light"] .action-button.secondary {
  background: #e9ecef !important;
  border-color: #ced4da !important;
  color: #000000 !important;
}

/* Light theme secondary button icon color */
[data-theme="light"] .action-button.secondary svg {
  color: #000000 !important;
}

/* Calculator Disclaimer - Theme Aware */
.calculator-disclaimer {
  transition: all 0.3s ease;
}

/* Dark theme (default) */
.calculator-disclaimer {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.calculator-disclaimer p {
  color: rgba(255, 255, 255, 0.7) !important;
}

.calculator-disclaimer .material-icons,
.calculator-disclaimer svg {
  color: rgba(255, 255, 255, 0.7) !important;
  opacity: 0.7 !important;
}

/* Light theme */
[data-theme="light"] .calculator-disclaimer {
  border-color: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .calculator-disclaimer p {
  color: #333333 !important;
}

[data-theme="light"] .calculator-disclaimer .material-icons,
[data-theme="light"] .calculator-disclaimer svg {
  color: #666666 !important;
  opacity: 1 !important;
}

/* Remove border from ApexCharts legend markers */
.apexcharts-legend-marker {
  stroke: none !important;
}

.apexcharts-legend-marker path {
  stroke: none !important;
}

/* Hide y-axis title from charts */
.apexcharts-yaxis-title-text {
  display: none !important;
}


/* Loading and Animation States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.calculating {
  position: relative;
}

.calculating::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 204, 153, 0.1);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop: Show table, hide cards */
@media (min-width: 769px) {
  .projections-table {
    display: table; /* Show table on desktop */
  }

  .projections-cards {
    display: none; /* Hide cards on desktop */
  }
}

/* Print Styles */
@media print {
  .header-nav,
  .action-buttons {
    display: none;
  }

  .calculator-section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }

  .result-card {
    break-inside: avoid;
  }
}

/* =============================================================================
   Collapsible Section Styles
   ========================================================================== */

/* Section Title with Toggle */
.collapsible-section .section-title {
  position: relative;
  margin: 0 0 var(--spacing-lg) 0;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  padding-right: 50px; /* Space for the dropdown button */
}

.collapsible-section .section-title:hover {
  opacity: 0.8;
}

/* When collapsed, no margin-bottom on section title */
.collapsible-section[data-collapsed="true"] .section-title {
  margin-bottom: 0;
}

/* When expanded, keep normal margin-bottom */
.collapsible-section[data-collapsed="false"] .section-title {
  margin-bottom: var(--spacing-md);
}

/* Position dropdown button to the right */
.collapsible-section .toggle-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

/* Toggle Button */
.toggle-button {
  background: var(--primary-color);
  border: none;
  border-radius: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Color inherited by SVG fill="currentColor" */
  color: #000000;
}

/* Light theme - white icons */
[data-theme="light"] .toggle-button {
  color: #ffffff;
}

.toggle-button:hover {
  background: var(--primary-color);
  opacity: 0.8;
}

.toggle-button .material-icons {
  font-size: 20px;
  color: black;
}

/* Light theme icon color */
[data-theme="light"] .toggle-button .material-icons {
  color: #ffffff;
}

/* Dark theme icon color */
[data-theme="dark"] .toggle-button .material-icons {
  color: #000000;
}

.hidden {
  display: none !important;
}

/* Collapsible Content */
.collapsible-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-content.expanded {
  max-height: 12000px; /* Large enough to contain comprehensive calculation explanations */
  opacity: 1;
  padding-bottom: var(--spacing-lg);
}


/* Collapsible Section Styling */
.collapsible-section {
  border: 1px solid var(--surface-container);
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Specific styling for calculation explanation section */
@media (min-width: 769px) {
  .section-title {
    padding-bottom: var(--spacing-md);
  }

  .collapsible-section .toggle-button {
    margin-top: -11px;
  }

  #calculationExplanation,
  #systemVariablesSection {
    padding-bottom: 0;
  }
}

.collapsible-section:hover {
  border-color: var(--surface-container-high);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}




/* =============================================================================
   Calculation Explanation Section Styles
   ========================================================================== */

/* Calculation Explanation Grid */
.calculation-explanation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
}

/* Calculation Cards */
.calculation-card {
  background: transparent;
  border: 1px solid var(--surface-container);
  border-radius: 0;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calculation-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(255, 204, 153, 0.1);
  transform: translateY(-2px);
}

/* Calculation Card Header */
.calculation-header {
  background: transparent;
  color: var(--on-surface);
  padding: var(--spacing-md) 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all 0.3s ease;
}

.calculation-separator {
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) 50%, transparent 100%);
  opacity: 0.6;
  min-width: 50px;
}

/* Dark theme calculation header */
[data-theme="dark"] .calculation-header {
  background: transparent;
  color: #ffffff !important;
}

/* Light theme calculation header */
.calculation-header i {
  font-size: 24px;
  color: var(--primary-color);
}

.calculation-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: inherit;
}

/* Calculation Card Content */
.calculation-content {
  padding: var(--spacing-lg);
}

/* Formula Groups */
.formula-group {
  margin-bottom: var(--spacing-lg);
}

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

.formula-group h4 {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}


/* Formula Items */
.formula {
  background: transparent;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 0;
  margin-bottom: var(--spacing-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  border-left: 5px solid var(--surface-container);
  border-top: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.formula:hover {
  border-left-color: var(--primary-color);
  background: var(--surface-container);
}

.formula:last-child {
  margin-bottom: 0;
}

/* Example Calculations */
.example {
  background: rgba(76, 175, 80, 0.1);
  border-top: 1px solid rgba(76, 175, 80, 0.2);
  border-right: 1px solid rgba(76, 175, 80, 0.2);
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
  border-left: 5px solid var(--result-positive);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 0;
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}

.example strong {
  color: var(--result-positive);
  font-weight: 600;
}

/* Calculation Note */
.calculation-note {
  background: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 0;
  padding: var(--spacing-md);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xl);
}

.calculation-note i {
  color: var(--primary-color);
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.calculation-note p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--on-surface-variant);
}

/* Responsive Design */
@media (min-width: 768px) {
  .calculation-explanation-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

@media (min-width: 1200px) {
  .calculation-explanation-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .calculation-card {
    max-height: none;
  }
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  /* Collapsible Section Mobile Styles */
  .collapsible-section .section-title {
    padding: 0;
    margin-bottom: var(--spacing-md);
  }

  .toggle-button {
    width: 36px;
    height: 36px;
  }

  .toggle-button .material-icons {
    font-size: 18px;
  }

  .collapsible-content {
    padding: 0 var(--spacing-sm);
  }

  .collapsible-content.expanded {
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    padding-left: 0;
    padding-right: 0;
    max-height: 12000px; /* Increased height to match desktop and prevent cutoff */
  }

  /* Calculation Card Mobile Styles */
  .calculation-header {
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    padding-left: 0;
    padding-right: 0;
  }

  .calculation-header h3 {
    font-size: 1rem;
  }

  .calculation-content {
    padding: var(--spacing-md);
  }

  .formula {
    font-size: 0.8rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .example {
    font-size: 0.8rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .calculation-note {
    padding: var(--spacing-sm);
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .calculation-note i {
    align-self: flex-start;
    margin-top: 0;
  }
}

/* Print Styles for Calculation Section */
@media print {
  .calculation-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .calculation-header {
    background: #f5f5f5 !important;
    color: black !important;
  }

  .formula {
    background: #f9f9f9 !important;
    color: black !important;
    border-color: #ccc !important;
  }

  .example {
    background: #f0f8f0 !important;
    border-color: #4caf50 !important;
    color: black !important;
  }
}

/* =============================================================================
   Multiplier Indicators Styles
   ========================================================================== */

.multiplier-indicator {
  font-size: 0.7em;
  font-weight: 500;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 204, 153, 0.1);
  border: 1px solid rgba(255, 204, 153, 0.2);
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

/* Theme-aware multiplier indicators - colors now handled by specific growth classes */

/* Ensure multiplier indicators don't break table layouts */
.projections-table td .multiplier-indicator {
  vertical-align: middle;
}

/* Responsive multiplier indicators */

@media (max-width: 576px) {
  .multiplier-indicator {
    font-size: 0.65em;
    margin-left: 2px;
    padding: 1px 3px;
  }
}

/* Prevent domain count and multiplier from wrapping */
.projections-table td:nth-child(2),
.projections-table td:nth-child(3) {
  white-space: nowrap;
}

/* At 848px and below, reduce font size to fit domain count and multiplier on one line */
@media (max-width: 847px) {
  .projections-table td:nth-child(2),
  .projections-table td:nth-child(3) {
    font-size: 0.8em;
  }

  .projections-table td:nth-child(2) .multiplier-indicator,
  .projections-table td:nth-child(3) .multiplier-indicator {
    font-size: 0.6em;
  }
}

/* Special styling for different multiplier ranges */
.multiplier-indicator.high {
  background: rgba(76, 175, 80, 0.1) !important;
  border-color: rgba(76, 175, 80, 0.2) !important;
  color: #4caf50 !important;
}

.multiplier-indicator.medium {
  background: rgba(33, 150, 243, 0.1) !important;
  border-color: rgba(33, 150, 243, 0.2) !important;
  color: #2196f3 !important;
}

.multiplier-indicator.low {
  background: rgba(255, 152, 0, 0.1) !important;
  border-color: rgba(255, 152, 0, 0.2) !important;
  color: #ff9800 !important;
}

.multiplier-indicator.negative {
  background: rgba(244, 67, 54, 0.1) !important;
  border-color: rgba(244, 67, 54, 0.2) !important;
  color: #f44336 !important;
}

.multiplier-indicator.none {
  background: rgba(158, 158, 158, 0.1) !important;
  border-color: rgba(158, 158, 158, 0.2) !important;
  color: #9e9e9e !important;
}

/* =============================================================================
   Advanced Settings Grouping Styles
   ========================================================================== */

/* Advanced Settings Groups Container */
.advanced-settings-groups {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Individual Advanced Settings Group */
.advanced-settings-group {
  background: var(--surface);
  border: 1px solid var(--surface-container);
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.advanced-settings-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--glass-border);
  transition: background 0.3s ease;
}

.advanced-settings-group:hover::before {
  background: var(--primary-color);
}

.advanced-settings-group:hover {
  border-color: var(--surface-container-high);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Group Header */
.group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  position: relative;
}

.group-title-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}


.group-toggle-right {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-shrink: 0;
}

.group-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  background: rgba(255, 204, 153, 0.1);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.group-icon-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
}

.group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Mobile layout: Move descriptions under icon */
@media (max-width: 576px) {
  .group-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-lg);
    position: relative;
  }

  .group-icon-title {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--spacing-md);
    flex: 1;
    width: 100%;
  }

  .group-icon {
    order: 1;
    margin-bottom: var(--spacing-xs);
  }

  .group-title-content {
    order: 2;
    text-align: left;
    max-width: 100%;
    width: 100%;
  }

  .group-title-content .input-description {
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .group-header {
    position: relative;
  }

  .group-header .input-toggle {
    position: absolute;
    top: 8px;
    right: 0;
    order: 1;
  }

  .group-icon-title {
    margin-right: 0; /* Remove margin since toggle is independent */
    width: calc(100% - 60px); /* Account for toggle space */
  }
}

.group-title-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.group-title-content .input-description {
  margin: 0;
  padding: 0;
  text-align: left;
}

.group-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--on-surface);
  margin: 0;
  line-height: 1.2;
}

/* New simplified group header styles */
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Advanced Settings Section Container */
.advanced-settings-section {
  transition: all 0.3s ease;
}

/* Parameters Body Container */
.parameters-body {
  padding: var(--spacing-lg) 0;
  background: var(--surface-container-low);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}


.group-badge {
  background: var(--primary-color);
  color: #000000 !important;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: var(--spacing-sm);
}

.group-description {
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: var(--spacing-xs) 0 0 0;
  flex: 1;
  max-width: 400px;
}

/* Group Toggle Switch */
.group-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.group-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
}

.group-toggle-slider {
  width: 48px;
  height: 24px;
  background: #666;
  border-radius: 12px;
  position: relative;
  transition: background 0.3s ease;
  cursor: pointer;
}

.group-toggle-handle {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.group-toggle-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  min-width: 45px;
  text-align: right;
  transition: color 0.3s ease;
}

/* Group Toggle States */
.group-toggle input[type="checkbox"]:checked ~ .group-toggle-slider {
  background: var(--primary-color) !important;
}

.group-toggle input[type="checkbox"]:checked ~ .group-toggle-slider .group-toggle-handle {
  transform: translateX(24px) !important;
}

.group-toggle input[type="checkbox"]:checked ~ .group-toggle-text {
  color: var(--primary-color);
  font-weight: 600;
}

/* Enhanced focus indicator */
.group-toggle input[type="checkbox"]:focus ~ .group-toggle-slider {
  box-shadow: 0 0 0 3px rgba(255, 204, 153, 0.3);
}

/* Enhanced hover effect */
.group-toggle:hover .group-toggle-slider {
  background: #777 !important;
}

.group-toggle input[type="checkbox"]:checked ~ .group-toggle-slider:hover {
  background: var(--primary-dark) !important;
}

/* Group Parameters Container */
.group-parameters {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  contain: layout style; /* Performance optimization */
}

.group-parameters.expanded {
  max-height: 2000px; /* Large enough to contain all parameters */
  opacity: 1;
  padding: var(--spacing-lg);
  overflow-x: hidden; /* Prevent horizontal overflow */
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Parameter Grid */
.parameter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* Desktop 2-column layout */
@media (min-width: 768px) {
  .parameter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Standalone Parameters Section */
.standalone-parameters-section {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--surface-container);
}

.section-header {
  margin-bottom: var(--spacing-lg);
}

.section-title-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.section-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--on-surface);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.section-description {
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 var(--spacing-lg) 0;
}

/* Standalone Parameters Grid */
.standalone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* Desktop 2-column layout for standalone parameters */
@media (min-width: 768px) {
  .standalone-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Active Group State */
.advanced-settings-group.active .group-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #000000 !important;
}

.advanced-settings-group.active .group-icon {
  background: rgba(0, 0, 0, 0.1);
  color: #000000 !important;
}

.advanced-settings-group.active .group-name {
  color: #000000 !important;
}

.advanced-settings-group.active .group-description {
  color: rgba(0, 0, 0, 0.7);
}

.advanced-settings-group.active .group-badge {
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff !important;
}

.advanced-settings-group.active::before {
  background: var(--primary-color);
  height: 100%;
}

/* Parameter Input Styles in Groups */
.group-parameters .input-group {
  opacity: 0.3;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* Input grids inside group parameters need to be more flexible */
.group-parameters .input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  width: 100%;
  min-width: 0;
  overflow: hidden; /* Prevent any overflow from children */
}

/* Make group parameters behave exactly like parameters-body grids */
.group-parameters .input-grid {
  /* Inherit the same responsive behavior as main input-grid */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* Apply the same progressive breakpoints as main grid */
@media (max-width: 480px) {
  .group-parameters .input-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
  }
}

@media (max-width: 384px) {
  .group-parameters .input-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
  }
}

@media (max-width: 320px) {
  .group-parameters .input-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
  }
}

/* Separators inside group parameters should not force grid width */
.group-parameters .input-section-separator {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  grid-column: 1; /* Override full span to prevent overflow */
  width: 100%;
  min-width: 0;
  overflow: hidden;
  contain: layout; /* Performance optimization */
  isolation: isolate; /* Create new stacking context */
  padding: var(--spacing-sm) 0;
}

/* Separator labels in group parameters need to be flexible */
.group-parameters .separator-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-shrink: 1;
  min-width: 0;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(204, 153, 51, 0.3);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-color);
  will-change: contents; /* Browser optimization hint */
}

/* Separator lines should be flexible */
.group-parameters .separator-line {
  flex: 1;
  min-width: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204, 153, 51, 0.3), transparent);
}

/* Hide separator lines on mobile but keep the label */
@media (max-width: 576px) {
  .separator-line,
  .group-parameters .separator-line,
  .input-section-separator .separator-line,
  .parameters-body .separator-line {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    opacity: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    flex: 0 !important;
  }

  .input-section-separator {
    justify-content: flex-start;
    gap: var(--spacing-sm);
  }

  .separator-label {
    max-width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: var(--spacing-sm) 0;
  }
}

/* Use same responsive behavior as main grid for consistency */
@media (max-width: 576px) {
  .group-parameters .input-grid {
    grid-template-columns: repeat(2, 1fr); /* Same as main grid */
    gap: var(--spacing-lg);
  }
}

/* Match main grid behavior for 480px breakpoint */
@media (max-width: 480px) {
  .group-parameters .input-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Same as main grid */
    gap: var(--spacing-md);
  }

  /* Enhanced separator label handling */
  .group-parameters .separator-label {
    max-width: 50%;
    font-size: 0.8rem;
    padding: 2px 6px;
  }

  .group-parameters .separator-label .material-icons {
    font-size: 0.9rem;
  }
}

/* Very small screens - match main grid 384px breakpoint */
@media (max-width: 384px) {
  .group-parameters .input-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Same as main grid */
    gap: var(--spacing-sm);
  }

  /* Further enhanced separator label handling */
  .group-parameters .separator-label {
    max-width: 45%;
    font-size: 0.75rem;
    padding: 2px 4px;
  }

  .group-parameters .separator-label .material-icons {
    font-size: 0.8rem;
  }
}

/* Ultra small screens - tighter spacing and stronger containment */
@media (max-width: 320px) {
  .group-parameters .input-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Force all children to not overflow */
  .group-parameters .input-grid > * {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Ultra-small separator labels with aggressive truncation */
  .group-parameters .separator-label {
    max-width: 35%;
    font-size: 0.7rem;
    padding: 1px 3px;
  }

  .group-parameters .separator-label span {
    font-size: 0.65rem;
  }

  .group-parameters .separator-label .material-icons {
    font-size: 0.75rem;
  }
}

.group-parameters.expanded .input-group {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for parameters */
.group-parameters.expanded .input-group:nth-child(1) { transition-delay: 0.05s; }
.group-parameters.expanded .input-group:nth-child(2) { transition-delay: 0.1s; }
.group-parameters.expanded .input-group:nth-child(3) { transition-delay: 0.15s; }
.group-parameters.expanded .input-group:nth-child(4) { transition-delay: 0.2s; }
.group-parameters.expanded .input-group:nth-child(5) { transition-delay: 0.25s; }
.group-parameters.expanded .input-group:nth-child(6) { transition-delay: 0.3s; }

/* Override disabled state for grouped parameters */
.group-parameters .input-group.disabled {
  opacity: 0.6;
  pointer-events: none;
  transform: translateY(2px);
}

.group-parameters.expanded .input-group.disabled {
  opacity: 0.6;
  transform: translateY(2px);
}

/* Ensure input groups in parameters don't overflow */
.group-parameters .input-group {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Input descriptions in group parameters should be flexible */
.group-parameters .input-description {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
  font-size: 0.8rem; /* Slightly smaller for group parameters */
}

/* Even smaller description text on very small screens */
@media (max-width: 480px) {
  .group-parameters .input-description {
    font-size: 0.75rem;
  }
}

/* Group-specific color accents */
.advanced-settings-group:nth-child(1)::before { background: linear-gradient(135deg, #FFB366, #FF9933); }
.advanced-settings-group:nth-child(2)::before { background: linear-gradient(135deg, #4caf50, #388e3c); }
.advanced-settings-group:nth-child(3)::before { background: linear-gradient(135deg, #2196f3, #1976d2); }
.advanced-settings-group:nth-child(4)::before { background: linear-gradient(135deg, #9c27b0, #7b1fa2); }
.advanced-settings-group:nth-child(5)::before { background: linear-gradient(135deg, #ff5722, #d84315); }

.advanced-settings-group:nth-child(1).active::before { background: linear-gradient(135deg, #FFB366, #FF9933); }
.advanced-settings-group:nth-child(2).active::before { background: linear-gradient(135deg, #4caf50, #388e3c); }
.advanced-settings-group:nth-child(3).active::before { background: linear-gradient(135deg, #2196f3, #1976d2); }
.advanced-settings-group:nth-child(4).active::before { background: linear-gradient(135deg, #9c27b0, #7b1fa2); }
.advanced-settings-group:nth-child(5).active::before { background: linear-gradient(135deg, #ff5722, #d84315); }

/* Theme-aware adjustments */
[data-theme="light"] .advanced-settings-group {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .group-parameters {
  background: #ffffff;
}

[data-theme="light"] .group-description {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .group-toggle-slider {
  background: #ccc !important;
}

/* Mobile Responsive Design */

@media (max-width: 576px) {
  .group-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-sm);
    position: relative;
  }

  .group-icon-title {
    flex: 1;
    min-width: 0; /* Allow content to shrink */
  }

  .group-header .input-toggle {
    position: absolute;
    right: 0;
    flex-shrink: 0;
    z-index: 10;
  }

  /* Ensure toggle aligns with h3 title height */
  .group-header .group-name {
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
  }

  .group-title-left {
    width: 100%;
    margin-bottom: var(--spacing-sm);
  }

  .group-description {
    max-width: none;
  }

  .group-toggle-right {
    align-self: flex-end;
    margin-left: 0;
  }

  .parameter-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .group-parameters.expanded {
    padding: var(--spacing-md);
    overflow-x: hidden;
  }

  .standalone-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .group-icon {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }

  .group-name {
    font-size: 1rem;
  }

  .group-badge {
    font-size: 0.65rem;
    padding: 1px 4px;
  }

  .group-description {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .advanced-settings-groups {
    gap: var(--spacing-md);
  }

  .group-header {
    padding-left: 0;
    padding-right: 0;
  }

  .group-parameters.expanded {
    padding: var(--spacing-sm);
    overflow-x: hidden;
  }

  .parameter-grid {
    gap: var(--spacing-sm);
  }

  .group-toggle-slider {
    width: 40px;
    height: 20px;
  }

  .group-toggle-handle {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }

  .group-toggle input[type="checkbox"]:checked ~ .group-toggle-slider .group-toggle-handle {
    transform: translateX(20px) !important;
  }

  .group-toggle-text {
    font-size: 0.8rem;
    min-width: 40px;
  }
}

/* =============================================================================
   Results Overview Section Styles
   ========================================================================== */

/* Overview Content Layout */
.overview-content {
  max-width: 100%;
}

.overview-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.overview-header h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  font-size: 1.8rem;
  font-weight: 600;
}

.overview-summary {
  color: var(--on-surface-variant);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* Metrics Grid */
.overview-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.metric-card {
  background: var(--surface-container);
  border: 1px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-lg);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.metric-label {
  font-size: 0.9rem;
  color: var(--on-surface-variant);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--spacing-xs);
  line-height: 1.2;
}

.metric-value.profit-positive {
  color: var(--result-positive);
}

.metric-value.profit-negative {
  color: var(--result-negative);
}

.metric-sublabel {
  font-size: 0.85rem;
  color: var(--on-surface-variant-2);
  font-style: italic;
}

/* Narrative Section */
.overview-narrative {
  border: 1px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.overview-narrative h4 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Removed ::before pseudo-element - now using SVG icons */

.analysis-text {
  color: var(--on-surface);
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

/* Highlights Section */
.overview-highlights {
  border: 1px solid var(--glass-border);
  border-radius: 0px;
  padding: var(--spacing-lg);
  border-left: 4px solid var(--primary-color);
}

.overview-highlights h4 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Removed ::before pseudo-element - now using SVG icons */

.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insights-list li {
  color: var(--on-surface);
  padding: var(--spacing-sm) 0;
  padding-left: 0;
  position: relative;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.insights-list li:last-child {
  border-bottom: none;
}

/* Removed ::before pseudo-element - now using SVG icons in JavaScript */

/* Responsive Design */

@media (max-width: 576px) {
  .overview-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .metric-card {
    padding: var(--spacing-md);
  }

  .metric-value {
    font-size: 1.4rem;
  }

  .overview-header h3 {
    font-size: 1.5rem;
  }

  .overview-summary {
    font-size: 1rem;
  }

  .overview-narrative,
  .overview-highlights {
    padding: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .overview-metrics {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 1.3rem;
  }

  .overview-header {
    margin-bottom: var(--spacing-lg);
  }

  .overview-header h3 {
    font-size: 1.4rem;
  }
}

/* Print Styles */
@media print {
  .overview-content {
    page-break-inside: avoid;
  }

  .metric-card {
    break-inside: avoid;
    border: 1px solid #ccc;
    background: white;
  }

  .overview-narrative,
  .overview-highlights {
    background: white;
    border: 1px solid #ccc;
  }
}

/* =============================================================================
   HIGH SPECIFICITY MULTIPLIER INDICATOR CLASSES
   Override all theme conflicts and ensure consistent colors
   ========================================================================== */

/* Target generic calculator page specifically for maximum specificity */
.generic-calculator-page .multiplier-indicator.negative {
  background: rgba(244, 67, 54, 0.1) !important;
  border-color: rgba(244, 67, 54, 0.2) !important;
  color: #f44336 !important;
}

.generic-calculator-page .multiplier-indicator.none {
  background: rgba(158, 158, 158, 0.1) !important;
  border-color: rgba(158, 158, 158, 0.2) !important;
  color: #9e9e9e !important;
}

.generic-calculator-page .multiplier-indicator.low {
  background: rgba(255, 152, 0, 0.1) !important;
  border-color: rgba(255, 152, 0, 0.2) !important;
  color: #ff9800 !important;
}

.generic-calculator-page .multiplier-indicator.medium {
  background: rgba(33, 150, 243, 0.1) !important;
  border-color: rgba(33, 150, 243, 0.2) !important;
  color: #2196f3 !important;
}

.generic-calculator-page .multiplier-indicator.high {
  background: rgba(76, 175, 80, 0.1) !important;
  border-color: rgba(76, 175, 80, 0.2) !important;
  color: #4caf50 !important;
}

.generic-calculator-page .multiplier-indicator.year-end {
  background: rgba(0, 230, 118, 0.15) !important;
  border-color: rgba(0, 230, 118, 0.3) !important;
  color: #00e676 !important;
  font-weight: 600;
}

/* Theme-aware variants with maximum specificity */
[data-theme="dark"].generic-calculator-page .multiplier-indicator.negative {
  background: rgba(244, 67, 54, 0.15) !important;
  border-color: rgba(244, 67, 54, 0.3) !important;
  color: #ef5350 !important;
}

[data-theme="dark"].generic-calculator-page .multiplier-indicator.none {
  background: rgba(158, 158, 158, 0.15) !important;
  border-color: rgba(158, 158, 158, 0.3) !important;
  color: #bdbdbd !important;
}

[data-theme="dark"].generic-calculator-page .multiplier-indicator.low {
  background: rgba(255, 152, 0, 0.15) !important;
  border-color: rgba(255, 152, 0, 0.3) !important;
  color: #ffb74d !important;
}

[data-theme="dark"].generic-calculator-page .multiplier-indicator.medium {
  background: rgba(33, 150, 243, 0.15) !important;
  border-color: rgba(33, 150, 243, 0.3) !important;
  color: #64b5f6 !important;
}

[data-theme="dark"].generic-calculator-page .multiplier-indicator.high {
  background: rgba(76, 175, 80, 0.15) !important;
  border-color: rgba(76, 175, 80, 0.3) !important;
  color: #81c784 !important;
}

[data-theme="dark"].generic-calculator-page .multiplier-indicator.year-end {
  background: rgba(0, 230, 118, 0.2) !important;
  border-color: rgba(0, 230, 118, 0.4) !important;
  color: #69f0ae !important;
  font-weight: 600;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.negative {
  background: rgba(244, 67, 54, 0.08) !important;
  border-color: rgba(244, 67, 54, 0.15) !important;
  color: #e53935 !important;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.none {
  background: rgba(158, 158, 158, 0.08) !important;
  border-color: rgba(158, 158, 158, 0.15) !important;
  color: #757575 !important;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.low {
  background: rgba(255, 152, 0, 0.08) !important;
  border-color: rgba(255, 152, 0, 0.15) !important;
  color: #f57c00 !important;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.medium {
  background: rgba(33, 150, 243, 0.08) !important;
  border-color: rgba(33, 150, 243, 0.15) !important;
  color: #1e88e5 !important;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.high {
  background: rgba(76, 175, 80, 0.08) !important;
  border-color: rgba(76, 175, 80, 0.15) !important;
  color: #43a047 !important;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.year-end {
  background: rgba(0, 230, 118, 0.12) !important;
  border-color: rgba(0, 230, 118, 0.25) !important;
  color: #00c853 !important;
  font-weight: 600;
}

/* Year-end indicator styling - grey theme for "@YrEnd" */
.generic-calculator-page .multiplier-indicator.yr-end {
  background: rgba(158, 158, 158, 0.15) !important;
  border-color: rgba(158, 158, 158, 0.3) !important;
  color: #9e9e9e !important;
  font-weight: 500;
  font-style: italic;
}

[data-theme="dark"].generic-calculator-page .multiplier-indicator.yr-end {
  background: rgba(158, 158, 158, 0.15) !important;
  border-color: rgba(158, 158, 158, 0.3) !important;
  color: #bdbdbd !important;
  font-weight: 500;
  font-style: italic;
}

[data-theme="light"].generic-calculator-page .multiplier-indicator.yr-end {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: #616161 !important;
  font-weight: 500;
  font-style: italic;
}


/* ============================================================================
   TLD Validation Error Styling
   ============================================================================ */

.tld-validation-errors {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(244, 67, 54, 0.08);
    border-left: 4px solid #f44336;
    animation: slideDown 0.3s ease-out;
}

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

.tld-validation-errors:empty {
    display: none;
}

.tld-error-item {
    display: block;
    color: #d32f2f;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-xs);
}

.tld-error-item:last-child {
    margin-bottom: 0;
}

.tld-error-item strong {
    color: #c62828;
    font-weight: 600;
}

/* Highlight invalid input */
.input-wrapper--with-prefix input:not(:placeholder-shown):invalid {
    border-color: #f44336;
    background-color: rgba(244, 67, 54, 0.02);
}

/* Dark mode adjustments */
[data-theme="dark"] .tld-validation-errors {
    background: rgba(244, 67, 54, 0.12);
    border-left-color: #ef5350;
}

[data-theme="dark"] .tld-error-item {
    color: #ef5350;
}

[data-theme="dark"] .tld-error-item strong {
    color: #ff8a80;
}


/* Stacked TLD display for IDNs */
.tld-unicode {
    display: block;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: 1.2;
}

.tld-punycode {
    display: block;
    font-size: 0.25em;
    opacity: 0.7;
    
    font-weight: 400;
    margin-top: -0.2em;
    margin-left: 0;
    line-height: 1.2;
}

[data-theme="dark"] .tld-punycode {
    color: #ffffff !important;
}

[data-theme="light"] .tld-punycode {
    color: #000000 !important;
}

/* Light theme - increase card background opacity */
[data-theme="light"] .result-card.profit-card#amortizedCostCard {
    background: rgba(74, 144, 226, 0.21);
}

[data-theme="light"] .result-card.profit-card#netProfitCard.positive {
    background: rgba(76, 175, 80, 0.21);
}

[data-theme="light"] .result-card.profit-card#netProfitCard.negative {
    background: rgba(244, 67, 54, 0.21);
}

[data-theme="light"] .result-card.roi-card.positive {
    background: rgba(76, 175, 80, 0.21);
}

[data-theme="light"] .result-card.roi-card.negative {
    background: rgba(244, 67, 54, 0.21);
}

[data-theme="light"] .result-card.breakeven-card {
    background: rgba(255, 204, 153, 0.35);
}
