@font-face {
    font-family: 'Fonarto';
    src: url('../../assets/fonts/Fonarto.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Isidora';
    src: url('../../assets/fonts/Isidora.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Gibed';
    src: url('../../assets/fonts/gibed.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Quizlo';
    src: url('../../assets/fonts/Quizlo.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
:root {
  --emerald-deep: #085D36;
  --emerald-royal: #004B3B;
  --emerald-main: #097969;
  --emerald-light: #50C878;
  --emerald-accent: #187C19;
  --olive-drab: #6B8E23;
  --royal-crimson: #940128;
  --rich-gold: #D4AF37;

  --bg-gradient: radial-gradient(circle at 50% 0%, var(--emerald-royal), #021a11);
  --card-bg: rgba(0, 75, 59, 0.15);
  --input-bg: rgba(8, 93, 54, 0.2);
  --border-color: rgba(80, 200, 120, 0.2);
  --text-primary: #f0fff4;
  --text-secondary: rgba(240, 255, 244, 0.7);
  --accent-gradient: linear-gradient(to right, var(--emerald-main), var(--emerald-light));
  --primary-btn: var(--emerald-main);
  --secondary-color: var(--emerald-royal);
  --accent-color: var(--royal-crimson);

  --font-nature: 'Isidora', sans-serif;
  --font-gibed: 'Gibed', sans-serif;
  --font-quizlo: 'Quizlo', sans-serif;
  --font-fonarto: 'Fonarto', sans-serif;}

body {
  margin: 0;
  font-family: var(--font-nature);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 80vh;
  /* Ensure visibility even with low content */
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Layout */
.app-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Tools Grid (Landing Page) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.tool-card {
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.tool-card:hover {
  transform: translateY(-5px);
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--secondary-color);
}

/* Cards */
.glass-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

.card {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.card h2 {
  margin-top: 0;
  color: var(--text-primary);
}

/* Sidebar Specifics */
.sidebar h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.sidebar .section-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

/* File Upload State */
.file-status-box {
  background: var(--input-bg);
  border: 1px dashed var(--text-secondary);
  border-radius: 1rem;
  padding: 1rem;
  /* Reduced padding */
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  margin-bottom: 1rem;
  /* Flex centering */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  /* Optional constraint */
}

.file-status-box:hover {
  border-color: var(--secondary-color);
  background: rgba(214, 51, 132, 0.1);
}

.file-status-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.file-loaded {
  border-style: solid;
  border-color: var(--primary-btn);
  color: var(--primary-btn);
}

/* Form Controls */
label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

select,
input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

select:focus,
input:focus {
  border-color: var(--secondary-color);
}

option {
  background-color: #1e293b;
  /* Dark Slate to match theme */
  color: #ffffff;
}

/* Buttons */
.btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-sizing: border-box;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #00a651, #008f45);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 166, 81, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 166, 81, 0.6);
  opacity: 1;
  background: linear-gradient(135deg, #008f45, #00a651);
}

/* Results Panel */
.main-panel {
  min-height: 500px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 4rem;
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Tables in Dark Mode */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  color: var(--text-secondary);
}

th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

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

/* Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.badge-ns {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.badge-star {
  background: rgba(0, 166, 81, 0.2);
  color: #00a651;
}

.badge-high {
  background: rgba(214, 51, 132, 0.2);
  color: #d63384;
}

.hidden {
  display: none !important;
}

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

::-webkit-scrollbar-track {
  background: #0f172a;
}

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

/* RESPONSIVE MEDIA QUERIES */

@media (max-width: 1024px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  .app-grid {
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .app-grid {
    grid-template-columns: 1fr;
    /* Stack sidebar and main */
  }

  .sidebar {
    order: 1;
    /* Keep it at top if desired, or move to bottom? Usually input first */
  }

  .main-panel {
    order: 2;
  }

  h1 {
    font-size: 2rem;
  }

  /* Make tables scrollable horizontally */
  div[style*="overflow-x: auto"] {
    width: 100%;
    overflow-x: auto;
  }

  .glass-card {
    padding: 1.5rem;
  }

  /* Adjust grid stats */
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

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

  .btn {
    width: 100%;
  }

  th,
  td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* User Profile & Dropdown */
.user-profile {
  position: relative;
  display: inline-block;
  margin-left: 1rem;
}

.user-profile #user-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-main), var(--royal-crimson));
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.user-profile #user-menu-toggle:hover {
  background: linear-gradient(135deg, var(--royal-crimson), var(--emerald-main));
  transform: scale(1.1);
}

/* Back Button Styling - Premium Pink */
.back-button-container {
  margin-bottom: 1.5rem;
}

.back-btn {
  text-decoration: none !important;
  color: var(--royal-crimson) !important;
  border: 1px solid rgba(148, 1, 40, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-weight: 700 !important;
  padding: 0.6rem 1.25rem !important;
  border-radius: 12px !important;
  background: rgba(148, 1, 40, 0.08) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.5px !important;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.back-btn:hover {
  background: rgba(148, 1, 40, 0.18) !important;
  transform: translateX(-5px) translateY(-2px);
  color: #ff3366 !important;
  border-color: var(--royal-crimson) !important;
  box-shadow: 0 8px 20px rgba(148, 1, 40, 0.25);
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 120%;
  background: #1e293b;
  min-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  z-index: 2000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.user-dropdown.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.user-dropdown a {
  display: block;
  color: #ccc;
  padding: 10px 15px;
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.2s;
  text-align: left;
}

.user-dropdown a:hover {
  background: rgba(148, 1, 40, 0.1);
  color: var(--royal-crimson);
}

/* Auth Modals */
.auth-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  background: #1e293b;
  margin: auto;
  padding: 35px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 90%;
  max-width: 420px;
  border-radius: 20px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.close-modal {
  color: #94a3b8;
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s;
}

.close-modal:hover {
  color: #fff;
}

.auth-title-dark {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #00FF00, #00a651);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.auth-form input {
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  color: white;
  outline: none;
  transition: 0.3s;
  font-size: 1rem;
}

.auth-form input:focus {
  border-color: #00a651;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.2);
}

.auth-form button {
  background: linear-gradient(135deg, #00a651 0%, #008c44 100%);
  color: white;
  padding: 14px;
  margin: 15px 0 10px;
  border: none;
  cursor: pointer;
  width: 100%;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
}

.auth-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 166, 81, 0.4);
}

.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #94a3b8;
}

.auth-links a {
  color: #00a651;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.auth-links a:hover {
  color: #00FF00;
  text-decoration: underline;
}

.reset-status-text {
  color: #94a3b8;
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* HARVEST Design System Utilities */
.main-header-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.header-text-container {
  flex: 1;
  min-width: 300px;
  max-width: 900px;
  text-align: left;
}

.header-title {
  margin-bottom: 0.5rem;
}

.header-subtitle {
  color: #d63384;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  opacity: 1;
  letter-spacing: 0.5px;
}

.akira-gradient-text {
  background: linear-gradient(to bottom, #00FF00, #00a651);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-desc {
  line-height: 1.6;
  font-size: 1.05rem;
  font-style: italic;
}

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

.card-title-lg {
  font-size: 1.5rem;
  color: white;
}

.akira-green {
  color: #00a651;
}

.card-desc-box {
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-footer-flex {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-action-btn {
  color: #00a651;
  font-weight: 600;
}

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

.category-title {
  color: #fff;
  border-left: 5px solid #00a651;
  padding-left: 1rem;
  margin: 0;
}

.sub-grid-title {
  color: #fff;
  border-left: 4px solid #00a651;
  padding-left: 1rem;
  margin: 0;
  font-size: 1.5rem;
}

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

.badge-testing {
  background: rgba(0, 166, 81, 0.1);
  color: #00a651;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.bg-pattern-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(0, 166, 81, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(0, 166, 81, 0.1) 0%, transparent 20%);
  pointer-events: none;
}

.card-icon {
  font-size: 2rem;
}

.home-btn {
  text-decoration: none;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
}

.home-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  color: #00a651;
  border-color: #00a651;
}

/* Sub-grid Accordion Styles */
.sub-grid-header {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: all 0.3s ease;
}

.sub-grid-header:hover {
  opacity: 0.8;
  transform: translateX(5px);
}

.toggle-triangle {
  margin-left: 15px;
  color: #00a651;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  font-size: 1.2rem;
}

.sub-category-section.active .toggle-triangle {
  transform: rotate(90deg);
}

.sub-grid-content {
  display: none;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.4s ease forwards;
}

.sub-category-section.active .sub-grid-content {
  display: grid !important;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Analyzer Specific Utilities */
.stats-requirements-box {
  font-size: 0.9rem;
  margin-top: 1.5rem;
  opacity: 0.8;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(214, 51, 132, 0.2);
}

.btn-template-dl {
  width: auto;
  margin-top: 1.5rem;
  background: #d63384;
  color: white;
  transition: all 0.3s ease;
}

.btn-template-dl:hover {
  background: #c22b72;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 51, 132, 0.3);
}

.error-msg {
  margin-top: 1rem;
  color: #f87171;
  font-size: 0.9rem;
}

.results-header-text {
  color: #d63384;
  margin-bottom: 1rem;
}

.results-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.analyzer-header-content p {
  opacity: 0.7;
  font-size: 0.95rem;
}

/* Normality & Significance Badges */
.normality-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.normality-normal {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.normality-not-normal {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Layout & Atomic Utilities */
.hidden {
  display: none !important;
}

.mt-0-5 {
  margin-top: 0.5rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.opacity-70 {
  opacity: 0.7;
}

.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

.stat-label {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.stat-value-large {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
}

.stat-value-mid {
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
}

.interpretation-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.interpretation-text {
  line-height: 1.6;
  font-style: italic;
  color: #e2e8f0;
}

/* Structural & Atomic Utilities for Analyzers */
.analyzer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2rem;
}

.analyzer-header-content {
  text-align: center;
  flex: 1;
}

.analyzer-title {
  font-size: 2.5rem;
  margin: 0;
  font-weight: 800;
}

.icon-box-sm {
  font-size: 1.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.text-muted-sm {
  font-size: 0.8em;
  opacity: 0.6;
}

.mt-1-5 {
  margin-top: 1.5rem !important;
}

.app-grid-vertical {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.grid-2-col-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  .grid-2-col-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.mt-2 {
  margin-top: 2rem !important;
}

.mb-0-5 {
  margin-bottom: 0.5rem !important;
}

.mb-1-5 {
  margin-bottom: 1.5rem !important;
}

.mb-1 {
  margin-bottom: 1rem !important;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.badge-outline-pink {
  display: block;
  padding: 0.5rem;
  background: rgba(214, 51, 132, 0.1);
  color: #d63384;
  border-radius: 0.5rem;
  text-align: center;
  font-weight: 700;
}

.font-size-sm {
  font-size: 0.8rem;
}

/* Dashboard & Utility Extensions */
.flex-center-gap-1 {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fs-2rem {
  font-size: 2rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.opacity-7 {
  opacity: 0.7 !important;
}

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

.w-full {
  width: 100% !important;
}

.text-center {
  text-align: center !important;
}

.overflow-x-auto {
  overflow-x: auto !important;
}

.w-auto {
  width: auto !important;
}

/* Result Cards Styling - Enhanced */
.result-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.result-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 166, 81, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 166, 81, 0.2);
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #00a651, #008f45);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.result-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value-mid {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Grid Layout for Stats Cards */
.results-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.results-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .results-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-centered {
  max-width: 300px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.btn-auto {
  width: auto !important;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

/* Normality Badges */
.normality-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.normality-normal {
  background: #d1fae5;
  color: #065f46;
}

.normality-not-normal {
  background: #fee2e2;
  color: #991b1b;
}

/* New Utility Classes */
.grid-1col {
  grid-template-columns: 1fr !important;
}

.grid-2col-fixed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Stats Mini Cards */
.stats-card-mini {
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
}

.stats-card-mini label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.stats-card-mini div {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
}

.flex-gap-1 {
  display: flex;
  gap: 1rem;
}

.flex-1 {
  flex: 1;
}

.flex-none {
  flex: none;
}

.flex-column-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.items-stretch {
  align-items: stretch;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-between {
  display: flex !important;
  justify-content: space-between !important;
}


.w-150 {
  width: 150px !important;
}

.fs-1-5 {
  font-size: 1.5rem !important;
}

.fs-0-9 {
  font-size: 0.9rem !important;
}

.lh-1-2 {
  line-height: 1.2 !important;
}

.bg-green-soft {
  background: rgba(0, 166, 81, 0.1) !important;
  border: 1px dashed #00a651 !important;
  color: #00a651 !important;
}

.resp-opts-container {
  height: auto;
  min-height: 100px;
  max-height: 200px;
  overflow-y: auto;
  background-color: #1e293b;
  color: #fff;
}

.config-section label {
  color: #ffffff !important;
}


.btn-glass-report {
  width: auto !important;
  background: rgba(255, 255, 255, 0.1) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  padding: 0.5rem 1rem !important;
}

/* Regression Classes */
.equation-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2rem;
  color: #00a651;
  text-align: center;
  margin-top: 1rem;
  border: 1px solid rgba(0, 166, 81, 0.2);
  word-break: break-all;
}

.multi-select-box {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.multi-select-box label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  color: #ffffff !important;
  margin-bottom: 0 !important;
}

.multi-select-box input[type="checkbox"] {
  width: auto !important;
  cursor: pointer;
}

/* Stability / Breeding Utilities */
.trait-tabs {
  display: flex !important;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trait-tab {
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.trait-tab.active {
  background: #d63384;
  color: white;
}

.sig-star {
  color: #fbbf24;
  font-weight: bold;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

.bg-white {
  background: #ffffff !important;
}

.text-dark {
  color: #1a1a1a !important;
}

.inference-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.stable {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.responsive {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.unstable {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.average {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.text-center {
  text-align: center !important;
}

.btn-centered {
  margin: 0 auto;
  display: block;
}

.fs-0-8 {
  font-size: 0.8rem !important;
}

.opacity-8 {
  opacity: 0.8 !important;
}

.text-danger {
  color: #f87171 !important;
}

.w-max-500 {
  max-width: 500px !important;
}

.mt-3 {
  margin-top: 3rem !important;
}

.mr-0-5 {
  margin-right: 0.5rem !important;
}

.mb-0-2 {
  margin-bottom: 0.2rem !important;
}

.flex-column-gap-0-5 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cursor-pointer {
  cursor: pointer;
}

.loader-ribbon {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(214, 51, 132, 0.1);
  border-top: 4px solid #d63384;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

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

  100% {
    transform: rotate(360deg);
  }
}

.text-white {
  color: #ffffff !important;
}

.px-0-5 {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.py-0-2 {
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
}

.rounded-sm {
  border-radius: 0.375rem !important;
}

.hover-bg-light:hover {
  background: rgba(255, 255, 255, 0.05);
}

.text-accent {
  color: #d63384 !important;
}


/* Response Selection & Results Tab Grid */
.response-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 1200px) {
  .response-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .response-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .response-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checkbox-tab {
  position: relative;
  display: block;
}

.checkbox-tab input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-tab .tab-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  text-align: center;
}

.checkbox-tab:hover .tab-content {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-tab input:checked+.tab-content {
  background: #00a651 !important;
  border-color: #00a651 !important;
  box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
}

/* Results Tab Overrides */
.var-tab-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn-var-tab {
  padding: 0.75rem 0.5rem !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0.75rem !important;
  color: #fff !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  min-height: 48px;
}

.btn-var-tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.btn-var-tab.active {
  background: #00a651 !important;
  border-color: #00a651 !important;
  box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3) !important;
}

/* Premium Precision Stats Cards */
.stats-grid-parallel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .stats-grid-parallel {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .stats-grid-parallel {
    grid-template-columns: 1fr;
  }
}

.premium-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.25rem 0.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.premium-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 166, 81, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.premium-stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 166, 81, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 166, 81, 0.1);
}

.premium-stat-card:hover::before {
  opacity: 1;
}

.premium-stat-card label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
}

.premium-stat-card .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#plot-container {
  overflow: hidden;
  max-width: 100%;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Fixes for three-factor-crd.html */
.position-absolute-top-left {
  position: absolute;
  top: 2rem;
  left: 2rem;
}

.fs-2 {
  font-size: 2rem !important;
}

.text-sm-muted {
  font-size: 0.8em;
  opacity: 0.6;
}

.response-var-container {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
}

.error-box-style {
  color: #f87171;
  margin-top: 1rem;
}

.glass-panel-light {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.overflow-x-auto {
  overflow-x: auto;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-gibed); }
.btn, button, .badge, .status-pill { font-family: var(--font-quizlo); }
.analyzer-header-content p { font-family: var(--font-fonarto); }
.header-desc { font-family: var(--font-fonarto); }
