/* === RapidCore Bio Research Toolkit === */
/* Dark clinical aesthetic — deep blue to charcoal gradient */

:root {
  --deep-blue: #0a1628;
  --ocean-blue: #005eb8;
  --trust-blue: #007bff;
  --charcoal: #1a1a1a;
  --slate: #4a4a4a;
  --light-slate: #8a9ab0;
  --white: #ffffff;
  --off-white: #e8eef4;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;
  --glass-bg: rgba(20, 35, 60, 0.85);
  --glass-border: rgba(0, 123, 255, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, var(--deep-blue) 0%, var(--charcoal) 100%);
  color: var(--off-white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 80px;
}

/* === HEADER === */
.app-header {
  padding: 20px 16px 12px;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--ocean-blue), var(--trust-blue));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: var(--white);
  box-shadow: 0 2px 12px rgba(0, 94, 184, 0.4);
}

.header-brand h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--white);
}

.header-brand .highlight {
  color: var(--trust-blue);
  font-weight: 600;
}

.header-tagline {
  font-size: 11px; color: var(--light-slate);
  text-transform: uppercase; letter-spacing: 2px;
  margin-top: 4px;
}

/* === TAB BAR === */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  z-index: 100;
  padding: 6px 0 16px;
}

.tab-btn {
  flex: 1;
  background: none; border: none;
  color: var(--light-slate);
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: 4px 0;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--trust-blue);
}

.tab-icon { font-size: 20px; }
.tab-label { font-size: 10px; font-weight: 500; }

/* === TAB PANELS === */
.tab-panel {
  display: none;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === SEARCH === */
.search-bar {
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--white);
  font-size: 15px;
  outline: none;
}

.search-bar input::placeholder { color: var(--slate); }

.search-bar input:focus {
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

/* === COMPOUND GRID === */
.compound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compound-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.compound-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ocean-blue), var(--trust-blue));
  opacity: 0;
  transition: opacity 0.2s;
}

.compound-card:hover::before, .compound-card:active::before {
  opacity: 1;
}

.compound-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.compound-icon {
  font-size: 32px; margin-bottom: 8px;
}

.compound-name {
  font-size: 14px; font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.compound-dose {
  font-size: 11px; color: var(--light-slate);
}

.compound-tag {
  display: inline-block;
  font-size: 9px; padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.tag-peptide {
  background: rgba(0, 123, 255, 0.15);
  color: var(--trust-blue);
}

.tag-nonpeptide {
  background: rgba(142, 68, 173, 0.15);
  color: #bb8fce;
}

.tag-water {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
}

/* === DETAIL PANEL === */
.detail-panel {
  padding-top: 8px;
}

.back-btn {
  background: none; border: none;
  color: var(--trust-blue); font-size: 15px;
  padding: 8px 0 16px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}

.detail-content h2 {
  font-size: 24px; font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.detail-subtitle {
  color: var(--light-slate); font-size: 13px;
  margin-bottom: 20px;
}

.detail-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.detail-section h3 {
  font-size: 15px; font-weight: 600;
  color: var(--white);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}

.detail-section p, .detail-section li {
  font-size: 13px; line-height: 1.7;
  color: var(--off-white);
}

.detail-section ul { padding-left: 18px; }

.detail-section li { margin-bottom: 4px; }

.fact-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}

.fact-row:last-child { border: none; }

.fact-label { color: var(--light-slate); }

.fact-value { color: var(--white); font-weight: 500; }

/* === CALCULATOR === */
.calc-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 16px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--light-slate);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--white);
  font-size: 15px;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

.form-row {
  display: flex; gap: 12px;
}

.form-row .half { flex: 1; }

.unit-suffix {
  position: absolute; right: 14px; top: 42px;
  font-size: 13px; color: var(--light-slate);
}

.form-group.half { position: relative; }

.calc-result {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid var(--trust-blue);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.result-value {
  font-size: 32px; font-weight: 700;
  color: var(--trust-blue);
}

.result-unit {
  font-size: 14px; color: var(--light-slate);
  margin-left: 4px;
}

.calc-detail {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 12px;
  color: var(--light-slate);
  line-height: 1.6;
}

/* === BUTTONS === */
.primary-btn {
  background: linear-gradient(135deg, var(--ocean-blue), var(--trust-blue));
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
}

.primary-btn:hover {
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

.primary-btn.full { width: 100%; }

.add-btn {
  background: none;
  border: 1px solid var(--trust-blue);
  color: var(--trust-blue);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}

/* === TRACKER / VIAL LIST === */
.tracker-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.tracker-header h2 { font-size: 20px; color: var(--white); }

.vial-list { display: flex; flex-direction: column; gap: 10px; }

.vial-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  position: relative;
}

.vial-status {
  width: 4px; height: 100%;
  border-radius: 2px;
  position: absolute; left: 0; top: 0; bottom: 0;
}

.status-good { background: var(--success); }
.status-warning { background: var(--warning); }
.status-expired { background: var(--danger); }

.vial-info { flex: 1; }

.vial-name {
  font-size: 15px; font-weight: 600;
  color: var(--white);
}

.vial-meta {
  font-size: 12px; color: var(--light-slate);
  margin-top: 2px;
}

.vial-badge {
  font-size: 10px; padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-lyophilized {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
}

.badge-mixed {
  background: rgba(39, 174, 96, 0.15);
  color: var(--success);
}

.badge-expiring {
  background: rgba(243, 156, 18, 0.15);
  color: var(--warning);
}

.badge-expired {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }

.empty-state p {
  color: var(--light-slate); font-size: 14px;
  margin-bottom: 16px;
}

/* === FORM CARD === */
.form-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 12px;
}

/* === TOOLS GRID === */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.tool-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-card:hover {
  border-color: var(--trust-blue);
  transform: translateY(-1px);
}

.tool-icon { font-size: 28px; margin-bottom: 10px; }

.tool-card h3 {
  font-size: 16px; font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.tool-card p {
  font-size: 13px; color: var(--light-slate);
  line-height: 1.5;
}

/* === STORAGE GRID === */
.storage-grid {
  display: flex; flex-direction: column;
  gap: 10px; margin-top: 16px;
}

.storage-row {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
}

.storage-compound {
  padding: 12px 14px;
  font-weight: 600; font-size: 14px;
  color: var(--white);
  min-width: 100px;
}

.storage-info {
  flex: 1; padding: 10px 14px;
  border-left: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 4px;
}

.storage-temp {
  font-size: 12px; color: var(--light-slate);
}

.storage-window {
  font-size: 11px; color: var(--slate);
}

/* === BLOG FEED === */
.blog-feed {
  display: flex; flex-direction: column;
  gap: 12px; margin-top: 16px;
}

.blog-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-card h3 {
  font-size: 15px; font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.blog-card p {
  font-size: 13px; color: var(--light-slate);
  line-height: 1.5;
}

.blog-date {
  font-size: 11px; color: var(--slate);
  margin-top: 8px;
}

.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--light-slate);
  font-size: 14px;
}

/* === INSTALL BANNER === */
.install-banner {
  position: fixed; bottom: 72px; left: 12px; right: 12px;
  background: linear-gradient(135deg, var(--ocean-blue), var(--trust-blue));
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

.install-banner span {
  flex: 1; font-size: 13px; color: var(--white);
}

.install-banner button {
  background: var(--white); color: var(--ocean-blue);
  border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}

.install-banner .dismiss {
  background: none; color: var(--white);
  padding: 4px; font-size: 16px;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate); border-radius: 2px; }

/* === RESPONSIVE === */
@media (min-width: 500px) {
  .compound-grid { grid-template-columns: repeat(3, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}


/* === CTA STYLES (Compound Detail Page) === */

.detail-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--trust-blue);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.detail-cta-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-cta-row .full {
  flex: 1;
  text-align: center;
}

.shop-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--ocean-blue), var(--trust-blue));
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.shop-btn:hover {
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
  transform: translateY(-1px);
}

.shop-icon {
  font-size: 16px;
}

.track-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--off-white);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.track-btn:hover {
  border-color: var(--trust-blue);
  background: rgba(0, 123, 255, 0.08);
}

.calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 123, 255, 0.08);
  color: var(--trust-blue);
  border: 1px solid var(--trust-blue);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 12px;
}

.calc-btn:hover {
  background: rgba(0, 123, 255, 0.15);
}

/* === BATCH VERIFICATION CTA === */
.batch-verify-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-verify-cta:hover {
  border-color: var(--trust-blue);
  background: rgba(0, 123, 255, 0.05);
}

.batch-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.batch-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-text strong {
  font-size: 14px;
  color: var(--white);
  font-weight: 600;
}

.batch-text span {
  font-size: 12px;
  color: var(--light-slate);
}

.batch-arrow {
  font-size: 20px;
  color: var(--light-slate);
  font-weight: 300;
}

/* === CONVERTER RESULT === */
.conv-result {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}
