/* matches.css — match card design 2026-08-01
   All selectors prefixed .m- to avoid conflicts with styles.css */

@keyframes m-enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes m-why-flash {
  0%   { background-color: oklch(38% 0.09 75); }
  100% { background-color: oklch(24% 0.045 75); }
}
@keyframes m-star-glow {
  0%, 100% { opacity: 0.75; }
  50%       { opacity: 1; }
}

/* Card wrapper — handles entry animation and stagger */
.m-wrap {
  margin-bottom: 20px;
  animation: m-enter 420ms ease-out both;
}
.m-wrap:nth-child(1) { animation-delay: 0ms; }
.m-wrap:nth-child(2) { animation-delay: 120ms; }
.m-wrap:nth-child(3) { animation-delay: 240ms; }
.m-wrap:nth-child(4) { animation-delay: 360ms; }
.m-wrap:nth-child(5) { animation-delay: 480ms; }
.m-wrap:nth-child(n+6) { animation-delay: 600ms; }

/* Stagger why-flash to match card entry */
.m-wrap:nth-child(1) .m-why { animation-delay: 0ms; }
.m-wrap:nth-child(2) .m-why { animation-delay: 120ms; }
.m-wrap:nth-child(3) .m-why { animation-delay: 240ms; }
.m-wrap:nth-child(4) .m-why { animation-delay: 360ms; }
.m-wrap:nth-child(5) .m-why { animation-delay: 480ms; }
.m-wrap:nth-child(n+6) .m-why { animation-delay: 600ms; }

/* Card surface */
.m-card {
  background: oklch(19% 0.007 60);
  border: 1px solid oklch(28% 0.008 60);
  border-radius: 20px;
  padding: 28px;
  transition: transform 260ms ease-out, box-shadow 260ms ease-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.m-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
}

/* Header row: avatar + name/meta + badge */
.m-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.m-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: oklch(28% 0.03 75);
  color: oklch(78% 0.11 75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 19px;
  flex-shrink: 0;
  transition: transform 280ms ease-out;
}
.m-card:hover .m-avatar {
  transform: scale(1.08);
}
.m-info {
  flex: 1;
  min-width: 0; /* enables ellipsis on children */
}
.m-name {
  font-weight: 600;
  font-size: 17px;
  color: oklch(92% 0.005 60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-meta {
  font-size: 13px;
  color: oklch(62% 0.008 60);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-badge {
  flex-shrink: 0;
  background: oklch(24% 0.01 60);
  color: oklch(78% 0.01 60);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

/* "Why this match" block — hidden when match_reason is null (element not rendered) */
.m-why {
  background: oklch(24% 0.045 75);
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: m-why-flash 900ms ease-out both;
}
.m-star {
  color: oklch(78% 0.11 75);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 1px;
  display: inline-block;
  animation: m-star-glow 3.6s ease-in-out infinite;
}
.m-why-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: oklch(78% 0.11 75);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.m-why-text {
  font-size: 14px;
  line-height: 1.55;
  color: oklch(88% 0.005 60);
}

/* "Ищет:" line */
.m-looking {
  margin-top: 14px;
  font-size: 14px;
  color: oklch(62% 0.008 60);
}
.m-looking-val {
  color: oklch(88% 0.005 60);
  font-weight: 500;
}

/* Action row */
.m-actions {
  display: flex;
  align-items: center;
  margin-top: 22px;
}
.m-btn {
  background: oklch(74% 0.13 75);
  color: oklch(18% 0.02 75);
  border: 1px solid oklch(74% 0.13 75);
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 260ms ease-out, color 260ms ease-out, border-color 260ms ease-out;
}
.m-btn:hover {
  background: oklch(78% 0.14 75);
  border-color: oklch(78% 0.14 75);
}

/* Mobile scroll snap */
@media (max-width: 640px) {
  #matchesContainerB2B,
  #matchesContainerB2C {
    scroll-snap-type: y proximity;
  }
  .m-wrap {
    scroll-snap-align: start;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .m-wrap,
  .m-why,
  .m-star {
    animation: none !important;
  }
  .m-card,
  .m-avatar,
  .m-btn {
    transition: none !important;
  }
}
