/* ==========================================================================
    The Precision Medicine Institute - Contemporary Components
   ========================================================================== */

/* Glassmorphic Container & Cards */
.glass-card {
  background: var(--glass-card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-cyan), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

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

/* Header & Fixed Navigation - Full Page Width */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-normal), border-color var(--transition-normal);
  box-sizing: border-box;
}

.nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none !important;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-cyan), var(--color-emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 15px var(--color-cyan-glow);
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-cyan);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  list-style: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 768px) {
  .nav-links {
    position: static;
    transform: none;
    margin: 0 auto;
  }
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: 0.35rem 0.2rem;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-cyan);
  text-decoration: none;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-cyan);
  border-radius: var(--radius-full);
}

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

/* Theme Toggle Button */
.theme-toggle {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--color-cyan);
  background: var(--bg-surface-hover);
  color: var(--color-cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  text-decoration: none !important;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-cyan), #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--color-cyan-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--color-emerald), #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--color-emerald-glow);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  background: var(--color-cyan-bg);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Badges & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-cyan {
  background: var(--color-cyan-bg);
  color: var(--color-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-emerald {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-violet {
  background: var(--color-violet-bg);
  color: var(--color-violet);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 3px var(--color-cyan-glow);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper .form-input {
  padding-left: 2.6rem;
}

/* Contemporary Omics Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

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

.omics-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-medium);
}

.omics-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.omics-table tr:hover td {
  background: var(--bg-surface-hover);
}

.gene-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-cyan);
  font-size: 0.95rem;
}

/* AI Diagnostics Simulator Layout */
.diagnostic-simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 960px) {
  .diagnostic-simulator-grid {
    grid-template-columns: 1fr;
  }
}

.risk-score-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1rem 0;
}

.risk-number {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}

.risk-number.high {
  color: var(--color-rose);
  text-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}

.risk-number.moderate {
  color: var(--color-amber);
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.risk-number.low {
  color: var(--color-emerald);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.risk-progress-bar {
  height: 10px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.risk-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.shap-factor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-canvas);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.35rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  pointer-events: auto;
  transform: translateY(10px);
  opacity: 0;
  animation: toastIn 0.25s forwards;
}

.toast.success {
  border-left: 4px solid var(--color-emerald);
}

.toast.error {
  border-left: 4px solid var(--color-rose);
}

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