/* ── Movie Card ─────────────────────────────────────────────── */
.movie-card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
}

.movie-card:active { cursor: grabbing; }

/* Background card (depth) */
.movie-card.card-behind {
  transform: scale(0.95) translateY(12px);
  z-index: 0;
  pointer-events: none;
  filter: brightness(0.7);
}

/* Active card */
.movie-card:not(.card-behind) { z-index: 1; }

/* ── Poster wrap ─────────────────────────────────────────────── */
.card-poster-wrap {
  position: relative;
  width: 100%;
  height: 60%;
  flex-shrink: 0;
  background: #111;
}

/* ── Poster ─────────────────────────────────────────────────── */
.card-poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-poster--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  font-size: 4rem;
  width: 100%;
  height: 100%;
}

/* ── Language pill (inline after title, square outline) ─────── */
.card-lang {
  border: 1px solid rgba(255,255,255,0.55);
  color: #fff;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  flex-shrink: 0;
  align-self: flex-start;
}

/* ── Trailer button ─────────────────────────────────────────── */
.trailer-btn {
  position: absolute; bottom: 12px; right: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,179,0,0.9); color: #000;
  border: none; font-size: 1.1rem; cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.trailer-btn:hover { background: rgba(244,157,0,0.95); }

/* ── Overlays ───────────────────────────────────────────────── */
.overlay-like,
.overlay-nope {
  position: absolute;
  top: 28px;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 4px solid;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transition: none;
}

.overlay-like {
  left: 20px;
  color: #2dc653;
  border-color: #2dc653;
  transform: rotate(-15deg);
}

.overlay-nope {
  right: 20px;
  color: #e63946;
  border-color: #e63946;
  transform: rotate(15deg);
}

/* ── Info Panel ─────────────────────────────────────────────── */
.card-info {
  padding: 12px 16px 14px;
  background: var(--surface);
  height: 40%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

/* ── Title row (title + lang pill + rating badge) ───────────── */
.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 0 1 auto;
}

/* ── Rating badge ───────────────────────────────────────────── */
.card-rating-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 50px;
  flex-shrink: 0;
  white-space: nowrap;
}
.card-rating-badge.good { background: rgba(45,198,83,0.2);  color: #2dc653; }
.card-rating-badge.ok   { background: rgba(255,196,0,0.2);  color: #ffc400; }
.card-rating-badge.weak { background: rgba(230,57,70,0.2);  color: #e63946; }

/* ── Meta row (year · rating · genre pills) ─────────────────── */
.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 2px 0;
}

.card-year {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-genre-pill {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 2px 8px;
  color: var(--text-muted);
}

/* ── Synopsis — 2 lines ─────────────────────────────────────── */
.card-overview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ── Cast avatars ───────────────────────────────────────────── */
.card-cast-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: auto;
  padding-top: 4px;
}

.cast-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.cast-group-avatars {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.cast-group-label {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cast-divider {
  color: var(--border);
  font-size: 1.2rem;
  align-self: center;
  margin: 0 6px;
  flex-shrink: 0;
}

.cast-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cast-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cast-avatar--director .cast-avatar-circle {
  border-color: #FFB300;
}

.cast-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-avatar-initials {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cast-avatar-name {
  font-size: 0.52rem;
  color: var(--text-muted);
  text-align: center;
  white-space: normal;
  word-break: break-word;
  max-width: 48px;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Synopsis expand/collapse ───────────────────────────────── */
.card-overview-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.movie-card.card-expanded {
  bottom: auto;
  min-height: 100%;
  overflow: visible;
  z-index: 2;
}

.movie-card.card-expanded .card-info {
  height: auto;
  overflow: visible;
}

.card-overview--expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.overview-expand-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  font-weight: 600;
  text-align: left;
}
