/*
 * TrendMap analysis card — shell and video only.
 * This file must not contain Reel preview-card styles.
 */

.tm-analysis-card {
  --tm-analysis-panel: #101611;
  --tm-analysis-panel-secondary: #151d16;
  --tm-analysis-card-bg: #1a231b;
  --tm-analysis-border: rgba(255, 255, 255, 0.11);
  --tm-analysis-border-strong: rgba(255, 255, 255, 0.18);
  --tm-analysis-text: #f4f7f3;
  --tm-analysis-text-secondary: #b7c0b8;
  --tm-analysis-text-muted: #7f8b81;
  --tm-analysis-green: #68d453;
  --tm-analysis-green-soft: rgba(104, 212, 83, 0.12);

  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--tm-analysis-text);
  font-family: "Manrope", "Rubik", Arial, sans-serif;
}

body.tm-analysis-card-open {
  overflow: hidden;
}

.tm-analysis-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tm-analysis-card__panel {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--tm-analysis-border-strong);
  border-radius: 24px;
  background: var(--tm-analysis-panel);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72);
  scrollbar-color: #465048 #111712;
  scrollbar-width: thin;
}

.tm-analysis-card__panel::-webkit-scrollbar {
  width: 10px;
}

.tm-analysis-card__panel::-webkit-scrollbar-track {
  background: #111712;
}

.tm-analysis-card__panel::-webkit-scrollbar-thumb {
  border: 2px solid #111712;
  border-radius: 999px;
  background: #465048;
}

.tm-analysis-card__close {
  position: fixed;
  top: 28px;
  right: 30px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 1px solid var(--tm-analysis-border-strong);
  border-radius: 50%;
  background: rgba(20, 27, 21, 0.94);
  color: var(--tm-analysis-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.tm-analysis-card__close:hover {
  background: #253128;
}

.tm-analysis-card__close:focus-visible {
  outline: 2px solid rgba(104, 212, 83, 0.55);
  outline-offset: 2px;
}

.tm-analysis-card__grid {
  display: grid;
  grid-template-columns: minmax(360px, min(44vw, 610px)) minmax(0, 1fr);
  align-items: start;
  min-height: 100%;
}

.tm-analysis-card__media-column {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: calc(100dvh - 26px);
  padding: 18px;
  border-right: 1px solid var(--tm-analysis-border);
  background: radial-gradient(circle at 50% 20%, #162119 0, #080c09 58%);
}

.tm-analysis-card__video-shell {
  --tm-video-ratio: 0.5625;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, calc((100dvh - 62px) * var(--tm-video-ratio)));
  max-width: 100%;
  max-height: calc(100dvh - 62px);
  aspect-ratio: var(--tm-video-ratio);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 17px;
  background: #000;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

.tm-analysis-card__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.tm-analysis-card__video-status {
  position: absolute;
  right: 12px;
  bottom: 52px;
  left: 12px;
  display: none;
  padding: 11px 13px;
  border: 1px solid rgba(255, 130, 130, 0.32);
  border-radius: 10px;
  background: rgba(70, 12, 12, 0.88);
  color: #ffd7d7;
  font-size: 12px;
  line-height: 1.45;
}

.tm-analysis-card__video-status.is-visible {
  display: block;
}

.tm-analysis-card__video-empty {
  width: min(360px, 90%);
  padding: 18px;
  color: var(--tm-analysis-text-muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.tm-analysis-card__content {
  min-width: 0;
  padding: 48px 48px 64px;
  background: var(--tm-analysis-panel);
}
