/* -----------------------------
   GLOBAL FAN HOME LAYOUT
----------------------------- */

body.ms-dark {
  background: #0a0a0f;
  color: #fff;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* -----------------------------
   HEADER (if used)
----------------------------- */

.fan-header {
  width: 100%;
  padding: 18px 30px;
  background: rgba(20, 15, 35, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 999;
}

.fan-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fan-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fan-logo-mark {
  background: #a854ff;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.fan-logo-text {
  font-size: 14px;
  opacity: 0.8;
}

.fan-top-nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #cfc8ff;
  font-size: 14px;
  transition: 0.2s;
}
.fan-top-nav a:hover { color: #fff; }
.fan-logout-link { color: #ff6e99 !important; }

/* -----------------------------
   HERO SECTION
----------------------------- */

.fan-main {
  padding: 30px;
  max-width: 1400px;
  margin: auto;
}

.fan-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.fan-hello {
  font-size: 26px;
  font-weight: 600;
  margin: 0;
}

.fan-subtitle {
  font-size: 15px;
  opacity: 0.8;
  margin: 6px 0 0;
}

.fan-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fan-chip-btn {
  background: #2a2140;
  color: #cfc8ff;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #3b2a55;
  cursor: pointer;
}
.fan-chip-btn:hover { background: #3a2a5d; }

/* -----------------------------
   QUICK STATS
----------------------------- */

.fan-quick-stats {
  display: flex;
  gap: 40px;
  margin: 25px 0;
  flex-wrap: wrap;
}

.fan-stat-label {
  display: block;
  opacity: 0.7;
  font-size: 13px;
}

.fan-stat-value {
  margin-top: 4px;
  font-weight: bold;
  font-size: 20px;
}

/* -----------------------------
   GRID LAYOUT
----------------------------- */

.fan-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

/* Columns (optional hooks if used) */
.fan-left-col { min-width: 0; }
.fan-right-col { min-width: 0; }

/* -----------------------------
   CARD STYLING
----------------------------- */

.fan-card {
  background: rgba(25, 18, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 25px;
}

.fan-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
}

.fan-card-header h2 {
  font-size: 20px;
  margin: 0;
}

.fan-link-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  color: #cfc8ff;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  opacity: .9;
}
.fan-link-btn:hover { opacity: 1; }

/* -----------------------------
   CONTINUE WATCHING ROW
----------------------------- */

.fan-horizontal-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.scene-card {
  background: #1a1326;
  border-radius: 14px;
  padding: 10px;
  width: 210px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.06);
}

.scene-card img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: 10px;
}

.scene-card h4 {
  margin: 8px 0 4px;
  font-size: 15px;
}

.scene-meta {
  font-size: 12px;
  opacity: 0.7;
}

/* Play button */
.play-btn {
  width: 100%;
  margin-top: 8px;
  background: #a854ff;
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}
.play-btn:hover { background: #bf74ff; }

/* -----------------------------
   LIBRARY GRID
----------------------------- */

.fan-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.lib-card {
  background: #1a1326;
  border-radius: 14px;
  overflow: hidden;
  padding-bottom: 10px;
  border: 1px solid rgba(255,255,255,.06);
}

.lib-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.lib-info {
  padding: 10px;
}

.lib-tag {
  background: #3e2d59;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  display: inline-block;
  margin-bottom: 5px;
}

.playlist-btn {
  width: 100%;
  background: transparent;
  margin-top: 6px;
  border: 1px solid #553c84;
  color: #cfc8ff;
  padding: 6px;
  border-radius: 10px;
  cursor: pointer;
}
.playlist-btn:hover { background: #2c2144; }

/* -----------------------------
   RIGHT COLUMN: PLAYLISTS
----------------------------- */

.fan-playlist-list .playlist-item {
  padding: 14px;
  background: #221832;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.06);
}

.fan-playlist-detail-body {
  padding: 10px;
}

/* =======================
   UPGRADED VIDEO MODAL
   ======================= */

.fan-modal {
  display: none;               /* JS sets to flex */
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.25s ease forwards;
}

.fan-modal-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(14px);
  background: rgba(0, 0, 0, 0.85);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fan-modal-content.video.upgraded {
  position: relative;
  width: 92%;
  max-width: 900px;
  background: rgba(20, 0, 40, 0.65);
  border-radius: 16px;
  padding: 22px;
  z-index: 2;
  box-shadow: 0 0 50px rgba(180, 70, 255, 0.6);
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.fan-video-wrapper {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 40px rgba(180, 70, 255, 0.35);
}

#fan-video-player {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.fan-modal-title {
  text-align: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: #e6d0ff;
  text-shadow: 0 0 12px rgba(160, 60, 255, 0.8);
}

/* Close button (✅ fixed) */
.fan-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: #ff4ec8;
  color: #1a001f;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 90, 200, 0.7);
  transition: 0.18s;
}
.fan-modal-close:hover { transform: scale(1.08); }

/* -----------------------------
   RESPONSIVE
----------------------------- */

@media (max-width: 980px) {
  .fan-layout-grid { grid-template-columns: 1fr; }
  .fan-main { padding: 18px; }
}

@media (max-width: 520px) {
  .fan-hello { font-size: 22px; }
  .fan-quick-stats { gap: 18px; }
  .scene-card { width: 190px; }
}