/* ==========================================================================
   Google Material Design 3 (M3) System for SGCB Research Platform
   Authoritative Clinical Research & Molecular Genetics Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Google+Sans+Text:wght@400;500;700&family=Roboto:wght@300;400;500;700&family=Roboto+Mono:wght@400;500;600&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

:root {
  /* M3 Primary (Google Clinical Blue) */
  --md-sys-color-primary: #0b57d0;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d3e3fd;
  --md-sys-color-on-primary-container: #041e49;
  --md-sys-color-primary-hover: #0842a0;

  /* M3 Secondary (Clinical Teal) */
  --md-sys-color-secondary: #006874;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #cce8ed;
  --md-sys-color-on-secondary-container: #051f23;

  /* M3 Tertiary (Genomics Violet) */
  --md-sys-color-tertiary: #595992;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #e2dfff;
  --md-sys-color-on-tertiary-container: #15164b;

  /* M3 Error / Warning */
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-warning: #b26a00;
  --md-sys-color-warning-container: #ffe082;
  --md-sys-color-on-warning-container: #261600;

  /* M3 Neutral Surfaces */
  --md-sys-color-surface: #ffffff;
  --md-sys-color-surface-dim: #ded8e1;
  --md-sys-color-surface-bright: #f8fafd;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f8fafd;
  --md-sys-color-surface-container: #f0f4f9;
  --md-sys-color-surface-container-high: #e9eef6;
  --md-sys-color-surface-container-highest: #dde3ea;

  /* M3 Text & Outline */
  --md-sys-color-on-surface: #1f1f1f;
  --md-sys-color-on-surface-variant: #444746;
  --md-sys-color-outline: #747775;
  --md-sys-color-outline-variant: #c4c7c5;

  /* Fonts */
  --font-headline: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Google Sans Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

body {
  font-family: var(--font-body);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  letter-spacing: -0.01em;
  color: var(--md-sys-color-on-surface);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Material Symbols Outlined Configuration */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* ==========================================================================
   M3 Component Styles
   ========================================================================== */

/* Top App Bar */
.m3-top-app-bar {
  background-color: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-surface-container-highest);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.08);
}

/* M3 Tab Navigation */
.m3-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.m3-tab-link:hover {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

.m3-tab-link.active {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 600;
}

/* M3 Cards */
.m3-card {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-surface-container-highest);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.06);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.m3-card:hover {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 4px 14px 0 rgba(11, 87, 208, 0.12);
  transform: translateY(-2px);
}

.m3-card-flat {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-surface-container-highest);
  border-radius: 16px;
  padding: 24px;
}

/* M3 Buttons */
.m3-btn-filled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 9999px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 3px 0 rgba(11, 87, 208, 0.2);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.m3-btn-filled:hover {
  background-color: var(--md-sys-color-primary-hover);
  box-shadow: 0 2px 6px 0 rgba(11, 87, 208, 0.35);
  color: #ffffff;
}

.m3-btn-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 9999px;
  background-color: transparent;
  color: var(--md-sys-color-primary);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.m3-btn-outlined:hover {
  background-color: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-primary);
}

.m3-btn-tonal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 9999px;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.m3-btn-tonal:hover {
  background-color: #c2e7ff;
}

/* M3 Chips */
.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.4;
}

.m3-chip-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.m3-chip-secondary {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.m3-chip-tertiary {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.m3-chip-neutral {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-surface-container-highest);
}

.m3-chip-error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.m3-chip-warning {
  background-color: #fef7e0;
  color: #5c3800;
  border: 1px solid #f9ab00;
}

/* M3 Callout Containers */
.m3-callout-info {
  background-color: var(--md-sys-color-surface);
  border-left: 4px solid var(--md-sys-color-primary);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.05);
}

.m3-callout-warning {
  background-color: #fff9ea;
  border-left: 4px solid #f9ab00;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  color: #3e2723;
}

.m3-callout-danger {
  background-color: #fff4f4;
  border-left: 4px solid var(--md-sys-color-error);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  color: #410002;
}

/* M3 Tables */
.m3-table-container {
  overflow-x: auto;
  border: 1px solid var(--md-sys-color-surface-container-highest);
  border-radius: 14px;
  background-color: var(--md-sys-color-surface);
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.05);
}

.m3-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.m3-table th {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--md-sys-color-surface-container-highest);
}

.m3-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

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

.m3-table tbody tr:hover td {
  background-color: var(--md-sys-color-surface-container-low);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--md-sys-color-surface-container-low);
}
::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-outline);
}
