:root {
  --bg-light: #F0F4F8;
  --bg-white: #FFFFFF;
  --glass-border: rgba(200, 210, 220, 0.5);
  --shadow-soft: rgba(100, 120, 140, 0.12);
  --header-gradient: linear-gradient(135deg, #4facfe 0%, #667eea 50%, #764ba2 100%);
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --header-height: 115px;
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

/* =========================
   HEADER & ANIMATION
   ========================= */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  padding: 0 48px;
  background: linear-gradient(90deg, #4facfe 0%, #667eea 35%, #764ba2 65%, #f093fb 100%);
  background-size: 200% 100%;
  animation: shimmer 40s ease infinite;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  overflow: hidden;
  z-index: 100;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.header-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  animation: float 6s ease-in-out infinite;
}

.shape-1 { width: 90px; height: 90px; top: -25px; left: 10%; }
.shape-2 { width: 60px; height: 60px; top: 20px; left: 30%; animation-delay: 1.5s; }
.shape-3 { width: 45px; height: 45px; bottom: -10px; left: 50%; animation-delay: 3s; }
.shape-4 { width: 80px; height: 80px; top: -20px; right: 25%; animation-delay: 2s; }
.shape-5 { width: 35px; height: 35px; bottom: 5px; right: 12%; animation-delay: 4s; }

@keyframes float {
  0%,100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-8px); opacity: .8; }
}

.header-brand { display: flex; align-items: center; gap: 14px; font-family: 'Space Grotesk', sans-serif; color: #fff; }
.brand-icon { width: 48px; height: 48px; min-width: 48px; background: rgba(255,255,255,0.25); border-radius: 8px; border: 1px solid rgba(255,255,255,0.35); }
.header-title { font-size: 2.2rem; font-weight: 700; line-height: 1.2; }
.header-tagline { font-size: 1.5rem; font-weight: 500; text-align: center; color: rgba(255,255,255,0.95); white-space: nowrap; }
.header-user { display: flex; align-items: center; margin-left: auto; }
.avatar { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.4); display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; }

.hamburger { display: none; background: none; border: none; font-size: 2rem; color: #fff; cursor: pointer; z-index: 200; }

/* =========================
   SIDEBAR & MAIN
   ========================= */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-white);
  border-right: 1px solid var(--glass-border);
  padding: 12px 10px;
  z-index: 50;
  transition: transform .3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

.nav-menu { list-style: none; padding: 0; margin: 0; }
.nav-item { margin-bottom: 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 6px 18px; font-size: 1.15rem; border-radius: 8px; color: var(--text-secondary); text-decoration: none; transition: background .25s ease, color .25s ease; }
.nav-link:hover { background: rgba(102,126,234,.08); color: var(--text-primary); }
.nav-link.active { background: rgba(102,126,234,.12); color: #667eea; }

.main { margin-left: var(--sidebar-width); margin-top: var(--header-height); padding: 32px; }

/* =========================
   CUSTOM DASHBOARD CARD (BANNER BOX)
   ========================= */
.pr-content {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex !important;
    flex-direction: column !important;
    width: 80% !important;
    max-width: 1400px !important;
    margin: 30px auto !important;
    padding: 30px 40px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    box-sizing: border-box;
    text-align: left !important;
}

/* My Affiliate Link - Bigger & White */
.pr-dashboard .pr-main .pr-content h2,
.pr-content h2 {
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    margin-bottom: 12px !important;
    text-align: left !important;
}

.pr-affiliate-box {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start !important;
    gap: 15px;
    width: 100%;
    margin-top: 5px;
}

/* URL Input (White Box) */
.pr-content .pr-affiliate-box input[type="text"] {
    flex: 0 0 auto !important;
    width: auto !important;
    font-family: monospace !important; 
    padding: 10px 5px 10px 15px !important; 
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

/* Copy Button */
.copy-btn {
    flex: 0 0 auto !important;
    width: fit-content !important; 
    padding: 6px 5px !important; 
    font-size: 11px !important;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

/* Share your link text - Smaller & Spaced */
.pr-banner-subtext {
    color: #ffffff !important;
    font-size: 13px !important;
    margin-top: 25px !important; 
    margin-bottom: 0 !important;
    display: block !important;
    text-align: left !important;
    opacity: 0.90;
    font-weight: 400 !important;
}

/* =========================
   RESPONSIVE QUERIES
   ========================= */

@media (max-width: 1023px) {
  :root { --sidebar-width: 200px; }
  .nav-link { font-size: 1rem; padding: 6px 14px; }
}

@media (max-width: 1024px) {
    .pr-content {
        /* Swap the background to the mobile-specific image */
        background-image: var(--bg-mobile) !important;
        
        /* Set it to cover so it fills the taller mobile box perfectly */
        background-size: cover !important;
        background-position: center !important;
        
        width: 95% !important;
        padding: 25px 20px !important;
    }

    .pr-content h2 {
        font-size: 22px !important; /* Slightly smaller for tablets */
    }

    .pr-affiliate-box {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }

    .pr-content .pr-affiliate-box input[type="text"] {
        width: 100% !important;
    }

    .pr-banner-subtext {
        margin-top: 15px !important;
    }
}

@media (max-width: 767px) {
  :root { --header-height: 85px; }
  .header { display: grid; grid-template-columns: auto 1fr auto 60px; padding: 0 15px; gap: 12px; }
  .header-brand { grid-column: 1; gap: 8px; }
  .brand-icon { width: 35px; height: 35px; min-width: 35px; }
  .header-title { display: none; }
  .header-tagline { grid-column: 2; display: block !important; text-align: left; font-size: 0.95rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-user { grid-column: 3; display: flex; justify-content: center; }
  .avatar { width: 38px; height: 38px; font-size: 0.9rem; }
  .hamburger { grid-column: 4; display: block; justify-self: end; font-size: 1.8rem; background: rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 4px 8px; }
  .header-shapes { grid-column: 1 / span 4; grid-row: 1; }
  .sidebar { transform: translateX(-100%); top: var(--header-height); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; margin-top: var(--header-height); padding: 20px; }
}
/* Desktop default background */
.pr-content {
    background-image: var(--aff-bg-desktop) !important;
}

/* Mobile image swap */
@media (max-width: 1024px) {
    .pr-content {
        background-image: var(--aff-bg-mobile) !important;
        background-size: cover !important;
        background-position: center !important;
    }
}
/* ======================================================
   HEADER + LAYOUT STABILIZATION PATCH (SAFE)
   Purpose:
   - Protect fixed header from Elementor stacking contexts
   - Prevent content from overlaying header
   - Normalize main content flow
   ====================================================== */

/* 1️⃣ Lock header ABOVE all Elementor content */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  isolation: isolate;           /* CRITICAL: blocks Elementor overlay */
  z-index: 9999;                /* Above Elementor + widgets */
}

/* 2️⃣ Ensure main content always clears header */
.main {
  position: relative;
  z-index: 1;
  margin-top: var(--header-height);
}

/* 3️⃣ Normalize members-area containers */
.members-area {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
}

/* 4️⃣ Prevent Elementor containers from hijacking layout */
.elementor,
.elementor-section,
.elementor-container,
.elementor-widget,
.elementor-widget-container {
  position: relative;
  z-index: 1;
}

/* 5️⃣ Mobile header height sync (already defined, reinforced) */
@media (max-width: 767px) {
  .header {
    height: var(--header-height);
  }

  .main {
    margin-top: var(--header-height);
  }
}

html, body {
    width: 100% !important;
    max-width: 100% !important;
}
.ast-container, .entry-content {
    max-width: 100% !important;
}
/* Force sidebar toggle on mobile - ADD AT BOTTOM */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%) !important;
    z-index: 9999 !important;
  }
  
  .sidebar.open {
    transform: translateX(0) !important;
  }
  
  /* Force hamburger clickable on mobile */
@media (max-width: 767px) {
  .hamburger {
    position: relative !important;
    z-index: 10001 !important; /* above everything */
  }
}
}