/* ═══════════════════════════════════════════════════════════════
   PROBLEM SECTION: "Crystal Prison vs. Open Portal"
   Adapted from Stitch reference → Vanilla CSS + BEM
   ═══════════════════════════════════════════════════════════════ */

/* ── Section Container ── */
.problem-section {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Section Header ── */
.problem-section__header {
  text-align: center;
  margin: 0 0 5rem;
}

.problem-section__header h2 {
  font-size: clamp(2.5rem, 5vw + 1rem, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1.5rem;
  color: var(--landing-text-main);
  white-space: nowrap;
}

.problem-section__header h2 span {
  color: #ffffff;
}

.problem-section__header p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--landing-text-muted);
  font-weight: 500;
  margin: 0;
}

/* ── 3D Perspective Container ── */
.problem-section__container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6rem;
  width: 100%;
  perspective: 1000px;
}

/* ══════════════════════════════════════════
   PHONE CARD: Base Component
   ══════════════════════════════════════════ */
.phone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transform: rotateY(var(--y-rotation, 0deg)) rotateX(var(--x-rotation, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}

/* ── Phone Frame (shared) ── */
.phone-card__frame {
  position: relative;
  width: 280px;
  height: 580px;
  border-radius: 3rem;
  overflow: hidden;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.phone-card__frame:hover {
  transform: scale(1.05);
}

/* ── Notch (shared) ── */
.phone-card__notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10rem;
  height: 1.75rem;
  background: #000000;
  border-radius: 0 0 0.75rem 0.75rem;
  z-index: 20;
}

/* ── Screen (shared) ── */
.phone-card__screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Caption (shared) ── */
.phone-card__caption {
  margin-top: 2rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 1rem;
}

.phone-card__caption--error {
  color: var(--landing-text-muted);
}

.phone-card__caption--success {
  color: #4ade80;
  font-weight: 700;
}

/* ══════════════════════════════════════════
   PHONE CARD: --bad (Villain / Login Wall)
   ══════════════════════════════════════════ */
.phone-card--bad {
  --y-rotation: 15deg;
  --x-rotation: 5deg;
}

.phone-card--bad .phone-card__frame {
  background: #1f2937;
  border: 4px solid #374151;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.phone-card--bad .phone-card__frame:hover {
  transform: scale(1.05);
}

.phone-card--bad .phone-card__screen {
  background: #9ca3af;
}

/* ── Browser Bar ── */
.login-wall__browser-bar {
  height: 3.5rem;
  background: #6b7280;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #4b5563;
}

.login-wall__browser-bar span {
  font-size: 0.75rem;
  color: #d1d5db;
}

/* ── Ghost Video Player (Blocked Content) ── */
.login-wall__ghost-player {
  position: absolute;
  top: 6rem;
  left: 1rem;
  right: 1rem;
  aspect-ratio: 16 / 9;
  background: #1f2937;
  border-radius: 0.5rem;
  filter: blur(3px);
  opacity: 0.5;
  overflow: hidden;
}

.login-wall__ghost-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 33%;
  height: 0.25rem;
  background: #dc2626;
}

/* ── Login Overlay ── */
.login-wall__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* ── Login Modal ── */
.login-wall__modal {
  background: rgba(31, 41, 55, 0.9);
  border-radius: 1rem;
  padding: 1.5rem;
  width: 14rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid #4b5563;
}

.login-wall__icon {
  font-size: 2.25rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.login-wall__title {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 0.25rem;
}

.login-wall__subtitle {
  color: #9ca3af;
  font-size: 0.75rem;
  text-align: center;
  margin: 0 0 0.75rem;
}

/* ══════════════════════════════════════════
   PHONE CARD: --good (Hero / YouTube)
   ══════════════════════════════════════════ */
.phone-card--good {
  --y-rotation: -15deg;
  --x-rotation: 5deg;
}

.phone-card--good .phone-card__frame {
  background: #0f0f0f;
  border: 1px solid #1f2937;
  z-index: 10;
}

.phone-card--good .phone-card__frame:hover {
  transform: scale(1.05);
}

/* ── Aurora Glow Behind Good Phone ── */
.phone-card__glow-bg {
  position: absolute;
  inset: -50px;
  background: radial-gradient(circle at 50% 50%, var(--glow-primary) 0%, transparent 40%);
  animation: aurora-glow 10s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes aurora-glow {
  0%   { transform: translate(20px, -15px) rotate(0deg); }
  50%  { transform: translate(-20px, 20px) rotate(180deg); }
  100% { transform: translate(20px, -15px) rotate(360deg); }
}

/* ── Glass Sheen Overlay ── */
.phone-card__glass-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, rgba(255, 255, 255, 0.05), transparent);
  pointer-events: none;
  z-index: 30;
  border-radius: 3rem;
}

.phone-card--good .phone-card__screen {
  background: #0f0f0f;
}

/* ── YouTube UI ── */
.youtube-ui {
  padding: 3.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}


/* ── Video Player (Glass Effect) ── */
.youtube-ui__video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Play Button Overlay ── */
.youtube-ui__play-button {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.youtube-ui__play-button-circle {
  width: 3rem;
  height: 3rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.youtube-ui__play-button-circle svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: #ffffff;
  margin-left: 2px; /* Optical centering */
}

/* ── Progress Bar ── */
.youtube-ui__progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0.25rem;
  background: #4b5563;
}

.youtube-ui__progress-fill {
  width: 33%;
  height: 100%;
  background: #dc2626;
  box-shadow: 0 0 5px #dc2626;
}

/* ── Video Info ── */
.youtube-ui__info {
  margin-top: 0.875rem;
  padding: 0 0.25rem;
}

.youtube-ui__video-title {
  color: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.youtube-ui__view-count {
  color: #6b7280;
  font-size: 0.65rem;
  margin: 0;
}

/* ── Channel Row ── */
.youtube-ui__channel-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0 0.25rem;
}

.youtube-ui__channel-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #374151;
  flex-shrink: 0;
}

.youtube-ui__channel-name {
  color: #9ca3af;
  font-size: 0.7rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.youtube-ui__subscribe-btn {
  background: #ffffff;
  color: #000000;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Action Icons Bar ── */
.youtube-ui__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding: 0 0.25rem;
}

.youtube-ui__action {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: #1f2937;
  border-radius: 99px;
  padding: 0.25rem 0.5rem;
}

.youtube-ui__action--likedislike {
  gap: 0;
}

.youtube-ui__action--likedislike svg:first-child,
.youtube-ui__action--likedislike span:first-of-type {
  margin-right: 0.15rem;
}

.youtube-ui__action--likedislike svg:last-child {
  margin-left: 0.15rem;
}

.youtube-ui__action-divider {
  width: 1px;
  height: 0.85rem;
  background: #4b5563;
  flex-shrink: 0;
}

.youtube-ui__action svg {
  width: 0.7rem;
  height: 0.7rem;
  fill: #9ca3af;
  flex-shrink: 0;
}

.youtube-ui__action span:not(.youtube-ui__action-divider) {
  color: #9ca3af;
  font-size: 0.55rem;
  font-weight: 500;
}

/* ── Comments Module ── */
.youtube-ui__comments {
  margin-top: 0.6rem;
  padding: 0.5rem;
  background: #111827;
  border-radius: 0.5rem;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.youtube-ui__comments-header {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.youtube-ui__comments-title {
  color: #e5e7eb;
  font-size: 0.65rem;
  font-weight: 600;
}

.youtube-ui__comments-count {
  color: #6b7280;
  font-size: 0.6rem;
}

.youtube-ui__comment {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.youtube-ui__comment-avatar {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #374151;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.youtube-ui__comment-text {
  color: #9ca3af;
  font-size: 0.55rem;
  line-height: 1.4;
  margin: 0;
}

/* ══════════════════════════════════════════
   RESPONSIVE: Mobile (<768px)
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .problem-section {
    padding: 3rem 1rem;
  }

  .problem-section__header {
    margin-bottom: 3rem;
  }

  .problem-section__header h2 {
    white-space: normal;
  }

  .problem-section__container {
    flex-direction: column;
    gap: 3rem;
    perspective: none;
  }

  /* Flatten 3D on mobile */
  .phone-card {
    transform: none !important;
    --y-rotation: 0deg;
    --x-rotation: 0deg;
  }

  .phone-card__frame:hover {
    transform: scale(1.02) !important;
  }

  .phone-card__frame {
    width: 260px;
    height: 540px;
  }
}
