/* ==========================================================================
   BIODOSIER PREMIUM DESIGN SYSTEM
   Theme: Biotech Laboratory Dark (Teal, Slate, Indigo & Signal Accents)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap');

:root {
  /* Color Palette - Core */
  --bg-main: #090d16;          /* Deepest lab slate/black */
  --bg-surface: #0f172a;       /* Sleek slate blue surface */
  --bg-surface-glass: rgba(15, 23, 42, 0.65); /* Translucent glass */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(20, 184, 166, 0.3); /* Subtle teal glow */

  /* Primary, Secondary, & Accents */
  --color-primary: #14b8a6;      /* Vibrant lab teal */
  --color-primary-hover: #0d9488;
  --color-secondary: #6366f1;    /* DNA helix indigo */
  --color-secondary-hover: #4f46e5;
  --color-muted: #64748b;        /* Cool grey text */
  --color-text: #f8fafc;         /* High contrast white-grey */
  --color-text-bright: #ffffff;

  /* Biotech Research Status Indicators (Signal Colors) */
  --status-new: #38bdf8;         /* Sky Blue */
  --status-researching: #a855f7; /* Amethyst Purple */
  --status-watchlist: #f59e0b;   /* Amber Yellow */
  --status-high-interest: #f43f5e; /* Coral Crimson */
  --status-owned: #10b981;       /* Bio Green */
  --status-avoid: #ef4444;       /* Warning Red */
  --status-archived: #64748b;    /* Inactive Slate */

  /* Font System */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', monospace;

  /* Shadow & Blur effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-blur: blur(12px);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-base, 100%);
  transition: font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-color: var(--bg-main);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(20, 184, 166, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.03) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Crisp tabular numbers for financial tick rates & clinical metrics */
span, td, .numeric-data {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
}

/* Custom Slim Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-bright);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

h1 { font-size: 1.875rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; margin-bottom: 1rem; }

p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

strong {
  color: var(--color-text-bright);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  background-color: rgba(9, 13, 22, 0.85);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--glass-blur);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text-bright);
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text-bright);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  border-left: 3px solid var(--color-primary);
  background-color: rgba(20, 184, 166, 0.08);
  color: var(--color-primary);
}

/* Main Content Area */
.app-main {
  padding: 2rem;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ==========================================================================
   Premium Glassmorphism & Cards
   ========================================================================== */
.card-glass {
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card-glass:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(20, 184, 166, 0.05);
}

.card-glass-interactive {
  cursor: pointer;
}

/* Dashboard Metric Card Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-bright);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Badge Design System (Tickers, Indication & Phases)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

/* Research Status Badges */
.badge-new { background: rgba(56, 189, 248, 0.1); color: var(--status-new); border-color: rgba(56, 189, 248, 0.2); }
.badge-researching { background: rgba(168, 85, 247, 0.1); color: var(--status-researching); border-color: rgba(168, 85, 247, 0.2); }
.badge-watchlist { background: rgba(245, 158, 11, 0.1); color: var(--status-watchlist); border-color: rgba(245, 158, 11, 0.2); }
.badge-high-interest { background: rgba(244, 63, 94, 0.1); color: var(--status-high-interest); border-color: rgba(244, 63, 94, 0.2); }
.badge-owned { background: rgba(16, 185, 129, 0.1); color: var(--status-owned); border-color: rgba(16, 185, 129, 0.2); }
.badge-avoid { background: rgba(239, 68, 68, 0.1); color: var(--status-avoid); border-color: rgba(239, 68, 68, 0.2); }
.badge-archived { background: rgba(100, 116, 139, 0.1); color: var(--status-archived); border-color: rgba(100, 116, 139, 0.2); }

/* Ticker Badge */
.badge-ticker {
  background: rgba(20, 184, 166, 0.1);
  color: var(--color-primary);
  border-color: rgba(20, 184, 166, 0.3);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
}

/* Modality/Phase Badges */
.badge-phase {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-secondary);
  border-color: rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Clinical Pipeline Grid (Assets Tab)
   ========================================================================== */
.pipeline-visual-track {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  border-radius: 8px;
}

.pipeline-step {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-muted);
  border: 1px solid transparent;
}

.pipeline-step.active {
  background: rgba(20, 184, 166, 0.15);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.pipeline-step.completed {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}

/* ==========================================================================
   Data Table Styling (Trials, Sources, Companies)
   ========================================================================== */
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.lab-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.lab-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--color-text-bright);
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.lab-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
}

/* ==========================================================================
   Form Fields, Inputs & Validation
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-bright);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.15);
}

/* Modern clean state validation styling */
.form-control:user-valid:not(:placeholder-shown) {
  border-color: var(--status-owned);
}

.form-control:user-invalid {
  border-color: var(--status-avoid);
}

/* ==========================================================================
   Header and Tab Navigation (Company Detail Page)
   ========================================================================== */
.company-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tab-nav-container {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-nav {
  list-style: none;
  display: flex;
  gap: 1rem;
  padding-bottom: 1px;
}

.tab-button {
  background: none;
  border: none;
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--color-text-bright);
}

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Split Pane Grid for Thesis Tab */
.thesis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .thesis-grid {
    grid-template-columns: 1fr;
  }
  .app-container {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    display: none; /* In v1 simpler responsive header can toggle dashboard sidebar */
  }
}

/* ==========================================================================
   2026 PREMIUM UI/UX ANIMATIONS & INTERACTIVE GLOW EFFECTS
   ========================================================================== */

/* Fade In Up Entrance Animation for view-panels */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-panel {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Shimmer & Glow Hover Effects on Glassmorphism Cards */
.card-glass {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.card-glass:hover {
  border-color: rgba(20, 184, 166, 0.35) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 0 25px 3px rgba(20, 184, 166, 0.1) !important;
  transform: translateY(-2px);
}

/* Slick Sidebar Nav Transitions & Pulsing Active Indicators */
@keyframes pulse-teal-border {
  0%, 100% {
    border-left-color: var(--color-primary);
  }
  50% {
    border-left-color: #2dd4bf; /* Lighter glowing teal */
  }
}

.nav-link {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
  transform: translateX(4px);
}

.nav-link.active {
  animation: pulse-teal-border 2s infinite ease-in-out;
}

/* Elegant glowing table rows on hover */
.lab-table tr {
  transition: all 0.2s ease;
}

.lab-table tr:hover td {
  background-color: rgba(20, 184, 166, 0.05) !important;
  color: var(--color-text-bright) !important;
  border-bottom-color: rgba(20, 184, 166, 0.2) !important;
}

/* Pulsating Red Danger Glow for Low Cash Runway Badges */
@keyframes pulse-red-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    background: rgba(239, 68, 68, 0.1);
  }
}

.badge-avoid {
  animation: pulse-red-glow 2s infinite ease-in-out !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

/* Add custom focus indicator styling */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   FLOATING ACTION BUTTON (FAB) & GLASSMORPHIC MODAL STYLING
   ========================================================================== */

.fab-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.15);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(20, 184, 166, 0.2);
  backdrop-filter: var(--glass-blur);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.fab-btn:hover {
  transform: scale(1.1) rotate(90deg);
  background: var(--color-primary);
  color: var(--bg-main);
  box-shadow: 0 0 30px rgba(20, 184, 166, 0.5);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.25s ease forwards;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  position: relative;
  padding: 2.25rem !important;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--status-avoid);
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-list li {
  font-size: 0.95rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s ease;
}

.progress-list li .step-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.progress-list li.completed {
  color: var(--status-owned);
}

.progress-list li.active {
  color: var(--color-primary);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(20, 184, 166, 0.2);
}

.progress-list li.active .step-icon {
  transform: scale(1.2);
}

/* ==========================================================================
   SETTINGS PANEL & THEME SELECTION BUTTON GROUPS
   ========================================================================== */

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-btn-group, .font-btn-group {
  display: flex;
  gap: 0.15rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.15rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.setting-btn {
  background: none;
  border: none;
  color: var(--color-muted);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.setting-btn:hover {
  color: var(--color-text-bright);
}

.setting-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-primary) !important;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   ACCESSIBLE LABORATORY LIGHT THEME DEFINITIONS
   ========================================================================== */

body.light-theme {
  --bg-main: #f1f5f9;          /* Crisp light slate gray */
  --bg-surface: #ffffff;       /* Pure solid white cards */
  --bg-surface-glass: rgba(255, 255, 255, 0.75); /* Frosted glass */
  --border-color: rgba(15, 23, 42, 0.07); /* Highly visible light borders */
  --border-color-hover: rgba(15, 23, 42, 0.15);
  --border-accent: rgba(13, 148, 136, 0.4);

  /* Primary, Secondary, & Accents */
  --color-primary: #0d9488;      /* Deep legible laboratory teal */
  --color-primary-hover: #0f766e;
  --color-secondary: #4f46e5;    /* DNA indigo */
  --color-secondary-hover: #4338ca;
  --color-muted: #475569;        /* High-contrast slate grey */
  --color-text: #1e293b;         /* Readable charcoal black */
  --color-text-bright: #0f172a;  /* Absolute black headers */

  /* Light theme shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -1px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
}

body.light-theme {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(13, 148, 136, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.03) 0%, transparent 40%);
  color: var(--color-text);
}

body.light-theme .app-sidebar {
  background-color: rgba(255, 255, 255, 0.85);
  border-right: 1px solid var(--border-color);
}

body.light-theme .nav-link:hover, body.light-theme .nav-link.active {
  background-color: rgba(15, 23, 42, 0.04) !important;
}

body.light-theme .nav-link.active {
  background-color: rgba(13, 148, 136, 0.06) !important;
  color: var(--color-primary);
}

body.light-theme .lab-table th {
  background: rgba(15, 23, 42, 0.03);
  color: var(--color-muted);
}

body.light-theme .lab-table tr:hover td {
  background-color: rgba(13, 148, 136, 0.04) !important;
  color: var(--color-text-bright) !important;
  border-bottom-color: rgba(13, 148, 136, 0.2) !important;
}

body.light-theme .form-control {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-text-bright);
}

body.light-theme .theme-btn-group, body.light-theme .font-btn-group {
  background: rgba(15, 23, 42, 0.05);
}

body.light-theme .setting-btn.active {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  color: var(--color-primary) !important;
}

body.light-theme .pipeline-step {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .pipeline-step.completed {
  background: rgba(0, 0, 0, 0.06);
}



