/* Elegant Dark Theme - Deep Obsidian Vignette & Dynamic Accents */
[data-theme="dark"] {
  --background-color: #050002;
  --bg-vignette: radial-gradient(ellipse at 50% 0%, #1c050a 0%, #050002 85%);
  --text-color: #FFFFFF;
  --text-muted: #CBD5E1;

  --form-bg: rgba(15, 5, 8, 0.4);
  /* Elegant deepened glassmorphism */
  --header-bg: rgba(5, 0, 2, 0.75);
  --border-color: rgba(255, 46, 84, 0.1);
  /* Subtle ruby-tinted border */
  --shadow-color: rgba(0, 0, 0, 0.9);

  --link-color: #FF2E54;

  /* Primary Ruby Gradient (Female & Default) */
  --accent-color: #FF2E54;
  --accent-gradient: linear-gradient(135deg, #FF2E54 0%, #D10020 100%);
  --accent-glow: rgba(209, 0, 32, 0.4);

  --button-bg: rgba(28, 5, 10, 0.6);
  --button-text: #F8FAFC;
  --input-bg: rgba(5, 0, 2, 0.6);

  --table-header-bg: rgba(15, 5, 8, 0.95);
  --table-row-even: rgba(255, 255, 255, 0.01);
  --table-row-hover: rgba(255, 46, 84, 0.06);

  /* Variant colors */
  --primary: #FF2E54;
  --primary-soft: rgba(255, 46, 84, 0.15);
  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --info: #0EA5E9;
  --info-soft: rgba(14, 165, 233, 0.15);
  --secondary: #64748B;
  --secondary-soft: rgba(100, 116, 139, 0.15);
}

/* Dynamic Male Accent Override (Sapphire Blue) - High Contrast */
[data-theme="dark"] body.theme-male {
  --background-color: #000208;
  --bg-vignette: radial-gradient(ellipse at 50% 0%, #0a1628 0%, #000208 80%);
  --text-color: #F0F6FF;
  --text-muted: #A8C4E0;

  --form-bg: rgba(8, 18, 38, 0.6);
  --header-bg: rgba(4, 10, 24, 0.85);
  --border-color: rgba(96, 165, 250, 0.25);
  --shadow-color: rgba(0, 0, 0, 0.95);

  --link-color: #93C5FD;

  --accent-color: #60A5FA;
  --accent-gradient: linear-gradient(135deg, #93C5FD 0%, #3B82F6 100%);
  --accent-glow: rgba(96, 165, 250, 0.45);

  --button-bg: rgba(10, 22, 44, 0.75);
  --button-text: #F0F6FF;
  --input-bg: rgba(6, 14, 30, 0.75);

  --table-header-bg: rgba(8, 18, 38, 0.95);
  --table-row-even: rgba(59, 130, 246, 0.04);
  --table-row-hover: rgba(96, 165, 250, 0.12);

  --primary: #60A5FA;
  --primary-soft: rgba(96, 165, 250, 0.2);
  --info: #7DD3FC;
  --info-soft: rgba(125, 211, 252, 0.2);
}

/* System mode fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --background-color: #050002;
    --bg-vignette: radial-gradient(ellipse at 50% 0%, #1c050a 0%, #050002 85%);
    --text-color: #FFFFFF;
    --text-muted: #CBD5E1;
    --form-bg: rgba(15, 5, 8, 0.4);
    --header-bg: rgba(5, 0, 2, 0.75);
    --border-color: rgba(255, 46, 84, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.6);
    --link-color: #FF2E54;
    --accent-color: #FF2E54;
    --accent-gradient: linear-gradient(135deg, #FF2E54 0%, #D10020 100%);
    --accent-glow: rgba(209, 0, 32, 0.4);
    --button-bg: rgba(28, 5, 10, 0.6);
    --button-text: #F8FAFC;
    --input-bg: rgba(5, 0, 2, 0.6);
    --table-header-bg: rgba(15, 5, 8, 0.95);
    --table-row-even: rgba(255, 255, 255, 0.01);
    --table-row-hover: rgba(255, 46, 84, 0.06);
    --primary: #FF2E54;
    --primary-soft: rgba(255, 46, 84, 0.15);
    --success: #10B981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.15);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --info: #0EA5E9;
    --info-soft: rgba(14, 165, 233, 0.15);
    --secondary: #64748B;
    --secondary-soft: rgba(100, 116, 139, 0.15);
  }

  :root:not([data-theme]) body.theme-male {
    --background-color: #000208;
    --bg-vignette: radial-gradient(ellipse at 50% 0%, #0a1628 0%, #000208 80%);
    --text-color: #F0F6FF;
    --text-muted: #A8C4E0;
    --form-bg: rgba(8, 18, 38, 0.6);
    --header-bg: rgba(4, 10, 24, 0.85);
    --border-color: rgba(96, 165, 250, 0.25);
    --shadow-color: rgba(0, 0, 0, 0.95);
    --link-color: #93C5FD;
    --accent-color: #60A5FA;
    --accent-gradient: linear-gradient(135deg, #93C5FD 0%, #3B82F6 100%);
    --accent-glow: rgba(96, 165, 250, 0.45);
    --button-bg: rgba(10, 22, 44, 0.75);
    --button-text: #F0F6FF;
    --input-bg: rgba(6, 14, 30, 0.75);
    --table-header-bg: rgba(8, 18, 38, 0.95);
    --table-row-even: rgba(59, 130, 246, 0.04);
    --table-row-hover: rgba(96, 165, 250, 0.12);
    --primary: #60A5FA;
    --primary-soft: rgba(96, 165, 250, 0.2);
    --info: #7DD3FC;
    --info-soft: rgba(125, 211, 252, 0.2);
  }
}