/**
 * ⚡ QuickTools — Earn Section Pages CSS
 * ========================================
 * Matches tool page design (tool-layout.php).
 * SVG icons only — zero emojis.
 * Mobile-first, dark mode, RTL-ready.
 *
 * Location: assets/css/earn-section.css
 * Version: 2.0 — 2026-02-26
 */

/* ═══ PAGE CONTAINER ═══ */
.earn-section-page {
    min-height: calc(100vh - 140px);
    padding: var(--space-4) var(--space-4) var(--space-8);
}
.earn-section-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ═══ SECTION HEADER ═══ */
.es-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.es-header__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.es-header__back:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.es-header__info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.es-header__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}
.es-header__icon svg {
    width: 24px;
    height: 24px;
}

/* Icon color variants — matches earn-landing.css palette */
.es-header__icon--mine       { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); color: #7C3AED; }
.es-header__icon--passive    { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); color: #10B981; }
.es-header__icon--watch      { background: linear-gradient(135deg, #CFFAFE, #A5F3FC); color: #0891B2; }
.es-header__icon--read       { background: linear-gradient(135deg, #F3E8FF, #E9D5FF); color: #9333EA; }
.es-header__icon--tasks      { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #D97706; }
.es-header__icon--offerwalls { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #D97706; }
.es-header__icon--surveys    { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #2563EB; }
.es-header__icon--games      { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #059669; }
.es-header__icon--lottery     { background: linear-gradient(135deg, #FFE4E6, #FECDD3); color: #E11D48; }
.es-header__icon--giftcards  { background: linear-gradient(135deg, #FFE4E6, #FECDD3); color: #E11D48; }
.es-header__icon--withdraw   { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #2563EB; }
.es-header__icon--referral   { background: linear-gradient(135deg, #FEF9C3, #FEF08A); color: #CA8A04; }

/* Dark mode icon variants */
[data-theme="dark"] .es-header__icon--mine       { background: rgba(139,92,246,0.15);  color: #A78BFA; }
[data-theme="dark"] .es-header__icon--passive    { background: rgba(16,185,129,0.15);  color: #6EE7B7; }
[data-theme="dark"] .es-header__icon--watch      { background: rgba(6,182,212,0.15);   color: #22D3EE; }
[data-theme="dark"] .es-header__icon--read       { background: rgba(147,51,234,0.15);  color: #C084FC; }
[data-theme="dark"] .es-header__icon--tasks      { background: rgba(245,158,11,0.15);  color: #FBBF24; }
[data-theme="dark"] .es-header__icon--offerwalls { background: rgba(245,158,11,0.15);  color: #FBBF24; }
[data-theme="dark"] .es-header__icon--surveys    { background: rgba(59,130,246,0.15);  color: #60A5FA; }
[data-theme="dark"] .es-header__icon--games      { background: rgba(16,185,129,0.15);  color: #34D399; }
[data-theme="dark"] .es-header__icon--lottery     { background: rgba(225,29,72,0.15);   color: #FB7185; }
[data-theme="dark"] .es-header__icon--giftcards  { background: rgba(225,29,72,0.15);   color: #FB7185; }
[data-theme="dark"] .es-header__icon--withdraw   { background: rgba(59,130,246,0.15);  color: #60A5FA; }
[data-theme="dark"] .es-header__icon--referral   { background: rgba(202,138,4,0.15);   color: #FACC15; }

.es-header__title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Balance chip */
.es-header__balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--mine-bg, rgba(245,158,11,0.06));
    border: 1px solid var(--mine-border, rgba(245,158,11,0.2));
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--coin-gold-dark, #D97706);
    flex-shrink: 0;
    transition: all var(--transition-base);
}
[data-theme="dark"] .es-header__balance {
    color: var(--coin-gold-light, #FCD34D);
}
.es-header__balance:hover {
    border-color: var(--coin-gold, #F59E0B);
    box-shadow: 0 0 12px rgba(245,158,11,0.2);
}
.es-header__balance svg {
    color: #F59E0B;
}
.es-header__balance-amount {
    font-family: var(--font-mono);
    font-weight: 700;
}
.es-header__balance-label {
    font-weight: 500;
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

/* ═══ QUICK NAV PILLS ═══ */
.es-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    margin-bottom: var(--space-5);
}
.es-nav::-webkit-scrollbar { display: none; }

.es-nav__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.es-nav__pill svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}
.es-nav__pill:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.es-nav__pill:hover svg { opacity: 1; }

.es-nav__pill--active {
    background: var(--accent-bg, rgba(139,92,246,0.08));
    color: var(--accent);
    font-weight: 600;
    border-color: var(--accent);
}
.es-nav__pill--active svg {
    opacity: 1;
    color: var(--accent);
}

/* ═══ AUTH WALL ═══ */
.es-auth-wall {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    margin-top: var(--space-6);
}
.es-auth-wall__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    border-radius: var(--radius-xl);
    background: var(--accent-bg);
    color: var(--accent);
}
.es-auth-wall h2 {
    font-size: var(--font-size-xl);
    margin: 0 0 var(--space-2);
}
.es-auth-wall p {
    color: var(--text-secondary);
    margin: 0 0 var(--space-6);
    font-size: var(--font-size-sm);
}
.es-auth-wall__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* ═══ ERROR / COMING SOON ═══ */
.es-error {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    margin-top: var(--space-6);
}
.es-error__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-5);
    border-radius: var(--radius-xl);
    background: var(--warning-bg, rgba(245,158,11,0.1));
    color: var(--warning, #D97706);
}
.es-error h2 {
    font-size: var(--font-size-xl);
    margin: 0 0 var(--space-2);
}
.es-error p {
    color: var(--text-secondary);
    margin: 0 0 var(--space-6);
    font-size: var(--font-size-sm);
}

/* ═══ SECTION CONTENT ═══ */
.es-content {
    animation: esFadeIn 0.3s ease;
}
@keyframes esFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ RTL SUPPORT ═══ */
[dir="rtl"] .es-header__back svg {
    transform: scaleX(-1);
}
[dir="rtl"] .es-header {
    flex-direction: row-reverse;
}
[dir="rtl"] .es-nav {
    direction: rtl;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 640px) {
    .earn-section-page {
        padding: var(--space-3) var(--space-3) var(--space-6);
    }
    .es-header {
        gap: var(--space-2);
    }
    .es-header__back {
        width: 36px;
        height: 36px;
    }
    .es-header__icon {
        width: 36px;
        height: 36px;
    }
    .es-header__icon svg {
        width: 20px;
        height: 20px;
    }
    .es-header__title {
        font-size: var(--font-size-lg);
    }
    .es-header__balance {
        padding: 4px 10px;
        font-size: var(--font-size-xs);
    }
    .es-nav__pill {
        padding: 6px 10px;
        font-size: 11px;
    }
    .es-nav__pill span {
        display: none;
    }
    .es-nav__pill svg {
        width: 16px;
        height: 16px;
    }
    .es-nav__pill--active span {
        display: inline;
    }
    .es-auth-wall,
    .es-error {
        padding: var(--space-8) var(--space-4);
    }
}

/* ═══ OVERRIDE TEMPLATE EMOJIS → hide if SVG present ═══ */
/* Templates still using emojis for section titles — override with icon */
.games-section__title,
.survey-section__title,
.offers-featured__title,
.passive-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
}
