/* ── AlmazovHub — Medical-Tech Custom Styles ────────────────────────────── */

:root {
  /* ── Фирменная палитра НМИЦ им. В.А. Алмазова ── */
  --blue-deep:   #1E418C;   /* Тёмно-синий (основной) */
  --blue-mid:    #005250;   /* Тёмно-бирюзовый (вторичный) */
  --blue-light:  #E8EDF7;   /* Светлый тон синего */
  --cyan:        #F0AF00;   /* Золотой акцент */
  --cyan-light:  #FDF5DC;   /* Светлый тон золотого */
  --gold:        #F0AF00;
  --gold-light:  #FDF5DC;
  --teal:        #005250;
  --teal-light:  #E0EEEE;
  --burgundy:    #930D43;   /* Бордовый (медицинский акцент) */
  --burgundy-light: #F5E0E8;
  --beige:       #F2CFB1;   /* Бежевый */
  --steel-blue:  #96B9D2;   /* Стальной голубой */
  --near-black:  #0F1920;   /* Почти чёрный */
  --white:       #FFFFFF;
  --gray-50:     #F8FAFC;
  --gray-100:    #F1F5F9;
  --gray-200:    #E2E8F0;
  --gray-400:    #94A3B8;
  --gray-600:    #475569;
  --gray-800:    #0F1920;
  --red-alert:   #930D43;
  --green-ok:    #10B981;
  --amber:       #F0AF00;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--blue-mid); border-radius: 3px; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.hub-header {
  background: linear-gradient(135deg, var(--blue-deep) 0%, #162f6a 60%, var(--near-black) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 74, 153, 0.35);
}

.logo-pulse::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(0, 198, 215, 0.3);
  animation: pulse-ring 2.5s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.8; }
  70%  { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

.search-bar {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 198, 215, 0.2);
}
.search-bar input { background: transparent; outline: none; color: #fff; }
.search-bar input::placeholder { color: rgba(255, 255, 255, 0.55); }

/* ── Stats Bar ─────────────────────────────────────────────────────────────── */
.stats-bar {
  background: linear-gradient(90deg, var(--blue-mid) 0%, var(--blue-deep) 100%);
}

/* Desktop: spread items evenly across full width */
@media (min-width: 1024px) {
  .stats-bar .stats-inner {
    justify-content: space-around;
    overflow-x: visible;
    max-width: 960px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
  }
  /* Hide trailing spacer on desktop — not needed */
  .stats-bar .stats-inner::after { display: none; }
}

.stat-item {
  position: relative;
  transition: transform 0.2s;
}
.stat-item:hover { transform: translateY(-1px); }

/* stat-number: size only — color is set per-instance in HTML */
.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Quick Action Cards ────────────────────────────────────────────────────── */
.action-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-deep), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 74, 153, 0.15);
  border-color: var(--blue-mid);
}
.action-card:hover::before { transform: scaleX(1); }

.action-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}

/* ── Innovation Feed Cards ─────────────────────────────────────────────────── */
.feed-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
}

.feed-card:hover {
  box-shadow: 0 8px 24px rgba(0, 74, 153, 0.12);
  border-color: rgba(0, 74, 153, 0.3);
}

.feed-card-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--blue-deep), var(--cyan));
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue-deep);
  border: 1px solid rgba(0, 74, 153, 0.15);
  transition: background 0.15s;
}
.tag-pill:hover { background: #d0dff7; cursor: pointer; }

.phase-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.phase-research  { background: #FDF5DC; color: #7A5800; }
.phase-preclin   { background: #F5E0E8; color: #930D43; }
.phase-clinical  { background: #E0EEEE; color: #005250; }
.phase-valid     { background: #E8EDF7; color: #1E418C; }

/* ── Community Board Cards ─────────────────────────────────────────────────── */
.match-card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s, transform 0.2s;
}
.match-card:hover {
  box-shadow: 0 6px 20px rgba(0, 74, 153, 0.1);
  transform: translateX(3px);
}

.match-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.type-partnership { background: var(--gold-light);     color: #7A5800; }
.type-collab      { background: var(--burgundy-light); color: var(--burgundy); }
.type-data        { background: #E0EEEE;               color: var(--teal); }
.type-student     { background: var(--blue-light);     color: var(--blue-deep); }

.urgent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red-alert);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Bottom Navigation ─────────────────────────────────────────────────────── */
.bottom-nav {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 20px rgba(0, 74, 153, 0.08);
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 90;
  height: 64px;
}

.nav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  flex: 1;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 8px 4px;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.nav-item.active {
  color: var(--blue-deep);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--cyan);
}
.nav-item:hover:not(.active) { color: var(--blue-mid); background: var(--blue-light); }

/* ── Modal / Overlay ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 29, 74, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 20px;
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 29, 74, 0.3);
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { transform: scale(0.94) translateY(10px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* ── Section Headers ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--blue-deep);
  color: #fff;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover {
  background: var(--blue-mid);
  box-shadow: 0 4px 14px rgba(0, 74, 153, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--blue-deep);
  border: 1.5px solid var(--blue-deep);
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-outline:hover { background: var(--blue-light); }

.btn-cyan {
  background: var(--cyan);
  color: var(--blue-deep);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-cyan:hover { opacity: 0.88; transform: translateY(-1px); }

.like-btn { transition: transform 0.15s, color 0.15s; cursor: pointer; }
.like-btn:hover  { transform: scale(1.2); color: #930D43; }
.like-btn.liked  { color: #930D43; }

/* ── Views (SPA routing) ───────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Skeleton Loader ───────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr !important; }
  .four-col { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-number { font-size: 1.2rem; }
  .hide-mobile { display: none !important; }
}

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ── Notification Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px; right: 16px;
  background: var(--gray-800);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transform: translateY(20px); opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 300;
  display: flex; align-items: center; gap: 8px;
  border-left: 4px solid var(--cyan);
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (min-width: 1024px) {
  .toast { bottom: 24px; }
}

/* ── No-scrollbar utility ──────────────────────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Trailing spacer so last item doesn't clip at the scroll edge on mobile */
.stats-bar .stats-inner::after {
  content: '';
  min-width: 1rem;
  flex-shrink: 0;
}
