/* === Background overlay for open panels === */
.mp-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Show overlay when any panel is open */
.is-panel-left-open .mp-panel-overlay,
.is-panel-right-open .mp-panel-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* === Side toggle buttons (left hub & right profile) === */

.mp-side-toggle {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  width: 42px;
  height: 120px;
  border-radius: 0 999px 999px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: linear-gradient(135deg, var(--mp-accent), var(--mp-accent-soft));
  border: 2px solid var(--mp-accent-deep);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
  transition:
    transform 0.35s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
}

.mp-side-toggle--left {
  left: 0;
  border-radius: 0 999px 999px 0;
}

.mp-side-toggle--right {
  right: 0;
  border-radius: 999px 0 0 999px;
}

.mp-side-toggle span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #0b1120;
  font-weight: 600;
}

.mp-side-toggle:hover {
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.75);
}

/* When panel is open, pull button in slightly */
.is-panel-left-open .mp-side-toggle--left {
  transform: translate(-10px, -50%);
  opacity: 0.6;
}

.is-panel-right-open .mp-side-toggle--right {
  transform: translate(10px, -50%);
  opacity: 0.6;
}

/* === Panels === */

.mp-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 320px;
  background: radial-gradient(circle at top, #0b1120 0, #020617 45%, #020617 100%);
  border: 1px solid var(--mp-border-soft);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85);
  z-index: 55;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 90px;
  overflow: visible;
  transition: transform 0.35s ease;
}

.mp-panel--left {
  left: 18px;
  transform: translateX(-100%);
  border-right: none;
}

.mp-panel--right {
  right: 18px;
  transform: translateX(100%);
  border-left: none;
}

/* States when open */
.is-panel-left-open .mp-panel--left {
  transform: translateX(0);
}

.is-panel-right-open .mp-panel--right {
  transform: translateX(0);
}

/* Panel header */

.mp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mp-panel-title {
  font-size: 14px;
  font-weight: 600;
}

.mp-panel-subtitle {
  font-size: 11px;
  color: var(--mp-text-muted);
}

/* Scrollable content in panels (above ad slot) */

.mp-panel-body {
  overflow-y: auto;
  padding-right: 8px;
}

/* === Left panel: Hub sections === */

.mp-hub-section {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.7);
}

.mp-hub-section:last-child {
  border-bottom: none;
}

.mp-hub-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mp-text-muted);
  margin-bottom: 6px;
}

/* Hub quick stats (top row) */

.mp-hub-stats {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mp-hub-stat {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.mp-hub-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.6;
}

.mp-hub-stat-value {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

/* Hub action buttons */

.mp-hub-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mp-hub-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid #1f2937;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  transition:
    background 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.mp-hub-action-btn:hover {
  background: #0b1120;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
}

/* Hub goals */

.mp-hub-goals {
  margin-bottom: 12px;
}

.mp-hub-goal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-hub-goal-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.9;
}

.mp-goal-check {
  width: 14px;
  text-align: center;
  font-size: 11px;
  opacity: 0.8;
}

/* Hub recent activity */

.mp-hub-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-hub-activity-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.mp-activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #38bdf8;
  margin-top: 5px;
}

/* === Premium strip at top of profile panel === */

.mp-premium-strip {
  position: relative;
  padding: 6px 10px;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-bottom: 1px solid rgba(31, 41, 55, 0.7);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.95));
  color: rgba(148, 163, 184, 0.4); /* subtle when not premium */
}

.mp-premium-strip-label {
  position: relative;
}

/* Golden ribbon when user has premium */
.mp-premium-strip--active {
  background: linear-gradient(90deg, #facc15, #f97316);
  color: #111827;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.7);
}

.mp-premium-strip--active .mp-premium-strip-label::before,
.mp-premium-strip--active .mp-premium-strip-label::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 2px;
  background: rgba(17, 24, 39, 0.5);
  transform: translateY(-50%);
}

.mp-premium-strip--active .mp-premium-strip-label::before {
  left: -20px;
}

.mp-premium-strip--active .mp-premium-strip-label::after {
  right: -20px;
}

/* === Right panel: Profile + XP + icons === */

.mp-profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mp-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--mp-accent-soft);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

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

.mp-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-profile-name {
  font-size: 14px;
  font-weight: 600;
}

.mp-profile-level {
  font-size: 11px;
  color: var(--mp-text-muted);
}

.mp-profile-rank {
  font-size: 11px;
  color: var(--mp-accent-soft);
}

/* XP bar tied to GamiPress values */

.mp-xp-bar-wrap {
  margin-top: 12px;
}

.mp-xp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mp-text-muted);
  margin-bottom: 4px;
}

.mp-xp-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #0f172a;
  overflow: hidden;
  box-shadow: inset 0 0 4px rgba(15, 23, 42, 0.9);
}

.mp-xp-bar-fill {
  width: 40%; /* this will eventually be set inline from GamiPress % */
  height: 100%;
  background: linear-gradient(90deg, var(--mp-accent-deep), var(--mp-accent-soft));
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Profile quick stats row */

.mp-profile-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 10px;
}

.mp-profile-stat {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
  padding: 6px 6px 5px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  text-align: center;
}

.mp-profile-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.6;
}

.mp-profile-stat-value {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

/* Profile quick action buttons */

.mp-profile-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mp-profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #1f2937;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  transition:
    background 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.mp-profile-action-btn:hover {
  background: #0b1120;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
}

/* Icons / badges row */

.mp-profile-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.mp-profile-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* === Panel ad slots (bottom) === */

/* Shared base */
.mp-panel-ad-slot {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid var(--mp-border-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LEFT PANEL — IMAGE AD (300x250 style) */
.mp-panel--left .mp-panel-ad-slot--image {
  height: 250px;
}

/* RIGHT PANEL — VIDEO AD (16:9 ratio) */
.mp-panel--right .mp-panel-ad-slot--video {
  height: 160px;
}

/* Ensure media fits */
.mp-panel-ad-slot--image img,
.mp-panel-ad-slot--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Small label overlay if needed */
.mp-panel-ad-label {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--mp-text-muted);
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 6px;
  border-radius: 999px;
}

/* Mobile: panels take more width, toggles smaller */
@media (max-width: 900px) {
  .mp-panel {
    width: 85%;
  }

  .mp-side-toggle {
    height: 90px;
  }
}

/* === Star Rating === */
.mp-rating {
  display: flex;
  gap: 4px;
  margin-top: 14px;
}

.mp-rating-star {
  font-size: 18px;
  color: #1e3a8a; /* dark base star */
  text-shadow: 0 0 6px rgba(56,189,248,.4);
  cursor: pointer;
  transition: color .15s ease, text-shadow .15s ease;
}

.mp-rating-star.active {
  color: #38bdf8; /* bright filled star */
  text-shadow: 0 0 10px rgba(56,189,248,.8);
}

.mp-rating-star:hover {
  color: #60a5fa;
  text-shadow: 0 0 12px rgba(96,165,250,.85);
}

/* Make sure rating stars on dashboard use a normal UI font */
.mp-dashboard .mp-stars,
.mp-dashboard .mp-star,
.mp-dashboard .mp-rating-text {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

/* Just in case something else overrides display */
.mp-dashboard .mp-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
