/* ==========================================================================
   SWEET TASK - UNIFIED PAGE HEADER & HERO DESIGN SYSTEM
   Universal Header for: home, task, task-details, wallet, referral, 
   subscription, achievements, profile, user-profile, promote-task
   ========================================================================== */

/* ─── 0. Universal Main-Content Clearance Standardization ─────────────────── */
/* Generous top clearance ensuring fixed top navbar NEVER covers the page header */
.main-content {
    min-height: calc(100vh - 80px);
    padding-top: 7.25rem;
    padding-bottom: 2.5rem;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
}

/* ─── 1. Universal Page Header & Hero Container ──────────────────────────── */
.page-header,
.subscription-page-header,
.welcome-header,
.achievements-hero,
.task-header,
.promote-page-header,
.hero,
.profile-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 0 !important;
    margin-bottom: 1.75rem;
    background: linear-gradient(135deg, rgba(15, 32, 67, 0.98) 0%, rgba(10, 20, 42, 0.98) 60%, rgba(6, 11, 24, 0.98) 100%);
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 18px;
    padding: 1.4rem 1.85rem;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(37, 99, 235, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header::before,
.subscription-page-header::before,
.welcome-header::before,
.achievements-hero::before,
.task-header::before,
.promote-page-header::before,
.hero::before,
.profile-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 50%, #ec4899 100%);
    opacity: 0.9;
    border-radius: 18px 18px 0 0;
}

/* Radial ambient glow behind header */
.page-header::after,
.subscription-page-header::after,
.welcome-header::after,
.achievements-hero::after,
.task-header::after,
.promote-page-header::after,
.hero::after,
.profile-hero::after {
    content: '';
    position: absolute;
    top: -60px;
    right: 10%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
    filter: blur(30px);
}

/* ─── 2. Header Content & Text ───────────────────────────────────────────── */
.header-content,
.welcome-content,
.hero-body,
.header-text {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.page-title,
.welcome-title {
    font-size: clamp(1.25rem, 3.2vw, 1.65rem);
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
}

.hero-h1 {
    font-size: clamp(1.25rem, 3.2vw, 1.65rem);
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 0.35rem 0;
    display: block !important;
    letter-spacing: -0.02em;
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
    width: 100%;
}

.hero-h1 .ac {
    background: var(--gradient-text-metallic, linear-gradient(135deg, #ffffff 15%, #f0f9ff 50%, #93c5fd 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(37, 99, 235, 0.35));
}

.page-title i,
.welcome-title i {
    font-size: 1.35rem;
    color: #38bdf8;
    text-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
    flex-shrink: 0;
}

.page-subtitle,
.welcome-subtitle,
.hero-p,
.hero-desc {
    font-size: clamp(0.78rem, 1.8vw, 0.86rem);
    color: var(--text-muted, #94a3b8);
    margin: 0;
    line-height: 1.5;
}

.page-subtitle strong,
.welcome-subtitle strong,
.hero-p strong {
    color: #38bdf8;
    font-weight: 700;
}

/* Hero Badge (like "Milestones & Badges 🏆" or "Hello User 👋") */
.hero-hi {
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(56, 189, 248, 0.12);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Hero Art Illustration */
.hero-art,
.profile-hero-art {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-art svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
}

.btn-explore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-btn-primary, linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #06b6d4 100%));
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
    white-space: nowrap;
    margin-top: 0.5rem;
}

.btn-explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.65), 0 0 15px rgba(56, 189, 248, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* ─── 3. Header Actions & Buttons ────────────────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* ─── 4. Specialized Task-Details Header Elements ───────────────────────── */
.task-header .task-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(37, 99, 235, 0.4);
    color: #f1f5f9;
    margin-bottom: 0.65rem;
}

.task-header .task-category.survey {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(6, 182, 212, 0.4));
}

.task-header .task-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

.task-header .meta-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #cbd5e1;
    font-size: 0.76rem;
}

.task-header .meta-item i {
    color: #38bdf8;
    font-size: 0.82rem;
}

.task-header .task-reward {
    text-align: center;
    background: rgba(18, 25, 39, 0.85);
    padding: 1rem 1.35rem;
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    min-width: 120px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 12px rgba(56, 189, 248, 0.15);
}

.task-header .reward-amount {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 0.20rem;
    letter-spacing: -0.02em;
}

.task-header .reward-label {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

/* ─── 5. Specialized Back Link Navigation & Category Badges ───────────────── */
.promote-back-wrap,
.back-link-container,
.user-profile-back {
    margin-top: 0 !important;
    margin-bottom: 1.15rem;
    position: relative;
    z-index: 10;
}

.task-categories {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0 !important;
    margin-bottom: 1.15rem;
    flex-wrap: wrap;
}

.task-categories .back-link-container {
    margin-bottom: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.50rem 0.95rem;
    border-radius: 10px;
    background: var(--bg-card, #0f1c34);
    border: 1px solid var(--border-cyber-subtle, rgba(37, 99, 235, 0.25));
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-link:hover {
    color: var(--text-white, #ffffff);
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(37, 99, 235, 0.2);
    transform: translateX(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.back-link.active {
    background: rgba(37, 99, 235, 0.25);
    border-color: rgba(56, 189, 248, 0.55);
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}

.back-link i {
    font-size: 0.8rem;
    color: #38bdf8;
}

/* ══════════════════════════════════════════════════════════════════════════
   6. RESPONSIVE CLEARANCE & MARGIN-TOP ARCHITECTURE (320px – 920px+)
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Desktop / Wide Screen (> 1180px) ─── */
@media (min-width: 1181px) {
    .main-content {
        padding-top: 7.25rem !important;
        padding-bottom: 2.5rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1.75rem;
        padding: 1.4rem 1.85rem;
        border-radius: 18px;
    }
}

/* ─── 1. Laptop / Small Desktop (921px – 1180px) ─── */
@media (max-width: 1180px) {
    .main-content {
        padding-top: 7.0rem !important;
        padding-bottom: 2.25rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1.5rem;
        padding: 1.35rem 1.65rem;
        border-radius: 18px;
    }

    .hero-art {
        width: 135px;
    }
}

/* ─── 2. Tablet Portrait (769px – 920px) ─── */
@media (max-width: 920px) {
    .main-content {
        padding-top: 7.25rem !important;
        padding-bottom: 2rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1.35rem;
        padding: 1.25rem 1.45rem;
        border-radius: 16px;
        gap: 1.25rem;
    }

    .hero-art {
        width: 120px;
    }

    .promote-back-wrap,
    .back-link-container,
    .user-profile-back,
    .task-categories {
        margin-top: 0 !important;
        margin-bottom: 0.95rem;
    }
}

/* ─── 3. Large Mobile / Phablet (681px – 768px) ─── */
@media (max-width: 768px) {
    .main-content {
        padding-top: 7.75rem !important;
        padding-bottom: 1.75rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1.25rem;
        padding: 1.15rem 1.25rem;
        border-radius: 15px;
        gap: 1rem;
    }

    .hero-art {
        display: none;
    }

    .hero-body {
        max-width: 100%;
        width: 100%;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-header .task-reward {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .task-header .reward-amount {
        margin-bottom: 0;
    }

    .promote-back-wrap,
    .back-link-container,
    .user-profile-back,
    .task-categories {
        margin-top: 0 !important;
        margin-bottom: 0.85rem;
    }
}

/* ─── 4. Standard Mobile Landscape (541px – 680px) ─── */
@media (max-width: 680px) {
    .main-content {
        padding-top: 7.25rem !important;
        padding-bottom: 1.5rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1.15rem;
        padding: 1.05rem 1.15rem;
        border-radius: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

    .hero-art {
        display: none;
    }

    .hero-body {
        max-width: 100%;
        width: 100%;
    }

    .header-actions {
        width: 100%;
        display: flex;
        justify-content: stretch;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .promote-back-wrap,
    .back-link-container,
    .user-profile-back,
    .task-categories {
        margin-top: 0 !important;
        margin-bottom: 0.75rem;
    }
}

/* ─── 5. Standard Mobile (481px – 540px) ─── */
@media (max-width: 540px) {
    .main-content {
        padding-top: 7.0rem !important;
        padding-bottom: 1.35rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1.05rem;
        padding: 0.95rem 1.05rem;
        border-radius: 13px;
        gap: 0.75rem;
    }

    .page-title,
    .welcome-title {
        font-size: 1.20rem;
    }

    .hero-h1 {
        font-size: 1.20rem;
        display: block !important;
        line-height: 1.28;
    }

    .hero-h1 br,
    .hero-desktop-br {
        display: none !important;
    }
}

/* ─── 6. Compact Mobile (381px – 480px) ─── */
@media (max-width: 480px) {
    .main-content {
        padding-top: 6.5rem !important;
        padding-bottom: 1.25rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 1rem;
        padding: 0.88rem 0.95rem;
        border-radius: 12px;
        gap: 0.65rem;
    }

    .hero-art,
    .profile-hero-art {
        display: none;
    }

    .hero-hi {
        font-size: 0.68rem;
        padding: 2px 7px;
        margin-bottom: 0.30rem;
    }

    .page-title,
    .welcome-title {
        font-size: 1.12rem;
        gap: 0.45rem;
        margin-bottom: 0.25rem;
    }

    .hero-h1 {
        font-size: 1.12rem;
        display: block !important;
        line-height: 1.30;
        margin-bottom: 0.25rem;
    }

    .hero-h1 br,
    .hero-desktop-br {
        display: none !important;
    }

    .page-title i,
    .welcome-title i {
        font-size: 1.15rem;
    }

    .page-subtitle,
    .welcome-subtitle,
    .hero-p,
    .hero-desc {
        font-size: 0.72rem;
        line-height: 1.38;
    }

    .promote-back-wrap,
    .back-link-container,
    .user-profile-back,
    .task-categories {
        margin-top: 0 !important;
        margin-bottom: 0.60rem;
    }

    .back-link {
        font-size: 0.72rem;
        padding: 0.38rem 0.70rem;
    }
}

/* ─── 7. Ultra-Compact Mobile (320px – 380px) ─── */
@media (max-width: 380px) {
    .main-content {
        padding-top: 5.85rem !important;
        padding-bottom: 1rem;
    }

    .page-header,
    .subscription-page-header,
    .welcome-header,
    .achievements-hero,
    .task-header,
    .promote-page-header,
    .hero {
        margin-top: 0 !important;
        margin-bottom: 0.85rem;
        padding: 0.78rem 0.82rem;
        border-radius: 11px;
        gap: 0.55rem;
    }

    .hero-hi {
        font-size: 0.62rem;
        padding: 2px 6px;
        margin-bottom: 0.20rem;
    }

    .page-title,
    .welcome-title {
        font-size: 1.02rem;
        gap: 0.40rem;
        margin-bottom: 0.20rem;
    }

    .hero-h1 {
        font-size: 1.00rem;
        display: block !important;
        line-height: 1.28;
        margin-bottom: 0.20rem;
    }

    .hero-h1 br,
    .hero-desktop-br {
        display: none !important;
    }

    .page-title i,
    .welcome-title i {
        font-size: 1.05rem;
    }

    .page-subtitle,
    .welcome-subtitle,
    .hero-p,
    .hero-desc {
        font-size: 0.68rem;
        line-height: 1.35;
    }

    .promote-back-wrap,
    .back-link-container,
    .user-profile-back,
    .task-categories {
        margin-top: 0 !important;
        margin-bottom: 0.50rem;
    }

    .back-link {
        font-size: 0.68rem;
        padding: 0.32rem 0.60rem;
    }

    .user-id-chip,
    .wallet-account-id-chip {
        padding: 1.5px 5.5px !important;
        font-size: 0.52rem !important;
        gap: 3px !important;
        margin-top: 2px !important;
    }

    .user-id-chip strong,
    .wallet-account-id-chip strong {
        font-size: 0.58rem !important;
    }

    .user-id-chip i,
    .wallet-account-id-chip i {
        font-size: 0.48rem !important;
    }
}

/* Universal User ID Chip Styles */
.user-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin-top: 4px;
    width: fit-content;
}

.user-id-chip:hover {
    background: rgba(56, 189, 248, 0.20);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
}

.user-id-chip strong {
    color: #38bdf8;
    font-family: monospace, inherit;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
}

.user-id-chip .copy-icon {
    font-size: 0.65rem;
    color: #94a3b8;
}

@media (max-width: 480px) {
    .user-id-chip {
        padding: 2px 7px;
        font-size: 0.58rem;
        gap: 4px;
        margin-top: 3px;
        border-radius: 12px;
    }

    .user-id-chip strong {
        font-size: 0.64rem;
    }

    .user-id-chip i {
        font-size: 0.54rem;
    }

    .user-id-chip .copy-icon {
        font-size: 0.50rem;
    }

    .recipient-preview-card {
        padding: 6px 9px;
        gap: 8px;
        border-radius: 10px;
        margin-top: 6px;
    }

    .recipient-preview-avatar {
        width: 30px;
        height: 30px;
        border-width: 1.5px;
    }

    .recipient-preview-name {
        font-size: 0.72rem;
        gap: 4px;
        line-height: 1.2;
    }

    .recipient-preview-id-badge {
        font-size: 0.64rem;
    }

    .recipient-preview-handle {
        font-size: 0.60rem;
    }

    .recipient-preview-kyc {
        font-size: 0.54rem;
        padding: 1px 5px;
        gap: 3px;
        margin-top: 2px;
        border-radius: 6px;
    }

    .recipient-preview-kyc i {
        font-size: 0.48rem;
    }

    .recipient-preview-warning {
        font-size: 0.58rem;
        margin-top: 3px;
        gap: 3px;
    }

    .recipient-preview-error {
        padding: 5px 8px;
        font-size: 0.64rem;
        border-radius: 7px;
    }
}


