/* =========================================================
   CouponsArena – Home page (welcome.css)
   ========================================================= */
:root {
    /* 1. Brand */
    --brand-primary: #7e22ce;
    --brand-primary-dark: #4c1d95;
    --brand-primary-light: #a855f7;
    --brand-accent: #ec4899;
    --brand-deep-purple: #3b0764;

    /* 2. Backgrounds */
    --bg-body: #f9fafb;
    --bg-surface: #ffffff;
    --bg-dark: #0a0a0a;
    --bg-dark-accent: #1a0b2e;

    /* 3. Text */
    --text-main: #111827;
    --text-body: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #ffffff;
    --text-light-muted: #d1d5db;

    /* 4. Borders */
    --border-light: #e5e7eb;
    --border-dark: #2d2d2d;

    /* 5. Gradients */
    --gradient-brand: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    --gradient-dark-bg: linear-gradient(180deg, #0a0a0a 0%, #3b0764 100%);

    /* 6. Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-brand: 0 4px 14px 0 rgba(126, 34, 206, 0.3);

    /* Shape */
    --radius: 16px;
    --radius-sm: 10px;

    /* Legacy aliases (so other partials using the old names keep working) */
    --primary-color: var(--brand-primary);
    --secondary-color: var(--brand-accent);
    --text-dark: var(--text-main);
    --text-light-old: var(--text-muted);
    --border-radius: var(--radius);
    --shadow: var(--shadow-md);
}

.home-page { background: var(--bg-body); color: var(--text-body); }

/* ---------- Shared helpers ---------- */
.badge-cat {
    display: inline-block;
    background: rgba(126, 34, 206, 0.1);
    color: var(--brand-primary);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: capitalize;
    padding: .3rem .7rem;
    border-radius: 999px;
}

.section-head { margin-bottom: 2rem; }
.section-head--center { text-align: center; }
.section-head .eyebrow {
    display: inline-block;
    color: var(--brand-accent);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: .4rem;
}
.section-head h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 .35rem;
    letter-spacing: -.02em;
}
.section-head p { color: var(--text-body); margin: 0; }
.section-head--center h2::after,
.section-head--bar h2::after {
    content: '';
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 4px;
    background: var(--gradient-brand);
    margin-top: .6rem;
}
.section-head--center h2::after { margin-left: auto; margin-right: auto; }

.btn-brand {
    background: var(--gradient-brand);
    color: var(--text-light);
    border: 0;
    font-weight: 600;
    border-radius: 999px;
    padding: .8rem 1.8rem;
    box-shadow: var(--shadow-brand);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-brand:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 8px 22px rgba(126,34,206,.4); }

.btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: 1.5px solid rgba(255,255,255,.35);
    font-weight: 600;
    border-radius: 999px;
    padding: .8rem 1.8rem;
    transition: all .2s ease;
}
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,.12); border-color: var(--brand-primary-light); }

.btn-outline-brand {
    border: 1.5px solid var(--brand-primary);
    color: var(--brand-primary);
    background: transparent;
    font-weight: 600;
    border-radius: 999px;
    padding: .4rem 1.1rem;
    font-size: .85rem;
    transition: all .2s ease;
}
.btn-outline-brand:hover { background: var(--brand-primary); color: #fff; }

.meta { font-size: .8rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .35rem; }

.card-link { color: inherit; text-decoration: none; }
.card-link:hover { color: var(--brand-primary); }

/* ---------- Hero ---------- */
.hero-banner {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(60% 60% at 80% 0%, rgba(236,72,153,.28) 0%, transparent 60%),
        radial-gradient(50% 60% at 10% 100%, rgba(168,85,247,.35) 0%, transparent 60%),
        var(--gradient-dark-bg);
    color: var(--text-light);
    padding: 4.5rem 0 5.5rem;
    margin-bottom: 4rem;
}
.hero-banner::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }

.hero-pill {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    color: var(--text-light-muted);
    padding: .4rem 1rem;
    border-radius: 999px;
    font-size: .82rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}
.hero-pill i { color: var(--brand-accent); }

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #fff;
}
.hero-content h1 span {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-content .lead {
    max-width: 620px;
    margin: 0 auto 2.2rem;
    color: var(--text-light-muted);
    font-size: 1.15rem;
}

/* Search */
.search-pill {
    display: flex;
    align-items: center;
    max-width: 640px;
    margin: 0 auto;
    padding: .4rem .4rem .4rem 1.3rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.search-pill:focus-within {
    background: rgba(255,255,255,.16);
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 4px rgba(168,85,247,.25);
}
.search-pill > i { color: var(--text-light-muted); margin-right: .8rem; }
.search-pill input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 1rem;
    padding: .7rem 0;
    min-width: 0;
}
.search-pill input::placeholder { color: rgba(255,255,255,.6); }
.search-pill button { padding: .7rem 1.6rem; white-space: nowrap; }

/* Top picks */
.top-picks { margin-top: 4rem; }
.top-picks .picks-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: .25rem; }
.top-picks .picks-sub { color: var(--text-light-muted); margin-bottom: 1.8rem; }

.top-blog-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: transform .3s ease, background .3s ease, border-color .3s ease;
}
.top-blog-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,.13);
    border-color: var(--brand-primary-light);
}
.top-blog-rank {
    position: absolute; top: 1rem; right: 1.2rem;
    font-size: 2.6rem; font-weight: 800; line-height: 1;
    color: rgba(255,255,255,.1);
}
.top-blog-badge {
    align-self: flex-start;
    background: var(--gradient-brand);
    color: #fff;
    font-size: .7rem; font-weight: 700; letter-spacing: .06em;
    padding: .3rem .8rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}
.top-blog-title { font-size: 1.1rem; font-weight: 700; color: #fff; line-height: 1.4; margin-bottom: .7rem; }
.top-blog-excerpt { flex: 1; font-size: .9rem; line-height: 1.6; color: var(--text-light-muted); margin-bottom: 1.2rem; }
.top-blog-meta {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12);
    font-size: .82rem; color: var(--text-light-muted);
}
.top-blog-read-more {
    color: #fff; font-weight: 600; text-decoration: none;
    display: inline-flex; align-items: center; gap: .4rem; transition: gap .2s ease, color .2s ease;
}
.top-blog-read-more:hover { color: var(--brand-accent); gap: .7rem; }

/* ---------- Featured ---------- */
.featured-articles { margin-bottom: 5rem; }

.featured-card {
    display: flex; flex-direction: column;
    height: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.featured-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg), var(--shadow-brand); border-color: var(--brand-primary-light); }

.featured-image { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--border-light); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.featured-card:hover .featured-image img { transform: scale(1.07); }
.featured-image::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(10,10,10,.35) 100%);
    pointer-events: none;
}
.featured-badge {
    position: absolute; top: 14px; left: 14px; z-index: 2;
    background: var(--gradient-brand);
    color: #fff; font-size: .75rem; font-weight: 700;
    padding: .3rem .85rem; border-radius: 999px;
    box-shadow: var(--shadow-brand);
}
.featured-content { display: flex; flex-direction: column; flex: 1; padding: 1.4rem; }
.featured-title { font-size: 1.1rem; font-weight: 700; line-height: 1.45; margin: .8rem 0 1rem; color: var(--text-main); }
.featured-title a { color: inherit; text-decoration: none; transition: color .2s ease; }
.featured-title a:hover { color: var(--brand-primary); }
.featured-meta {
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; border-top: 1px solid var(--border-light);
}

/* ---------- Trending + sidebar ---------- */
.trending-featured { margin-bottom: 5rem; }

.trending-card {
    display: flex; gap: 1rem; align-items: center;
    height: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: .9rem;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.trending-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-primary-light); }

.trending-thumb {
    position: relative; flex: 0 0 96px; width: 96px; height: 96px;
    border-radius: var(--radius-sm); overflow: hidden; background: var(--border-light);
}
.trending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trending-index {
    position: absolute; left: 6px; top: 6px;
    min-width: 24px; height: 24px; padding: 0 6px;
    display: grid; place-items: center;
    background: var(--gradient-brand); color: #fff;
    font-size: .72rem; font-weight: 700; border-radius: 8px;
}
.trending-content { min-width: 0; }
.trending-content h4 { font-size: .98rem; font-weight: 700; line-height: 1.4; margin: .5rem 0; }
.trending-content h4 a { color: var(--text-main); text-decoration: none; }
.trending-content h4 a:hover { color: var(--brand-primary); }

.categories-sidebar {
    position: sticky; top: 100px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
}
.sidebar-title { font-size: 1.3rem; font-weight: 800; color: var(--text-main); margin: 0 0 .5rem; }
.header-accent { width: 44px; height: 4px; border-radius: 4px; background: var(--gradient-brand); margin-bottom: 1.2rem; }

.category-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem .9rem;
    margin-bottom: .35rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.category-item .cat-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: rgba(126,34,206,.09); color: var(--brand-primary);
    margin-right: .8rem; transition: all .2s ease;
}
.category-item .cat-arrow { color: var(--text-muted); font-size: .75rem; transition: transform .2s ease, color .2s ease; }
.category-item:hover { background: rgba(126,34,206,.06); color: var(--brand-primary); }
.category-item:hover .cat-icon { background: var(--gradient-brand); color: #fff; }
.category-item:hover .cat-arrow { transform: translateX(4px); color: var(--brand-primary); }

.newsletter-card {
    margin-top: 1.6rem;
    padding: 1.4rem;
    border-radius: var(--radius);
    background: var(--bg-dark-accent);
    color: var(--text-light);
    position: relative; overflow: hidden;
}
.newsletter-card::before {
    content: ''; position: absolute; width: 180px; height: 180px; right: -60px; top: -60px;
    background: var(--gradient-brand); opacity: .35; filter: blur(40px); border-radius: 50%;
}
.newsletter-card > * { position: relative; }
.newsletter-card h5 { font-weight: 700; margin-bottom: .5rem; }
.newsletter-card p { color: var(--text-light-muted); font-size: .85rem; margin-bottom: 1rem; }
.newsletter-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.newsletter-form input {
    flex: 1 1 140px; min-width: 0;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff; border-radius: 999px; padding: .6rem 1rem; outline: 0;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.55); }
.newsletter-form input:focus { border-color: var(--brand-primary-light); }
.newsletter-form .btn-brand { padding: .6rem 1.2rem; font-size: .9rem; }

/* ---------- Category sections ---------- */
.category-sections { margin-bottom: 5rem; }
.category-section + .category-section { margin-top: 4rem; }
.category-section .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }

.latest-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.latest-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--brand-primary-light); }
.latest-image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--border-light); }
.latest-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.latest-card:hover .latest-image img { transform: scale(1.06); }
.latest-content { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.2rem 1.2rem; }
.latest-content h4 { font-size: .98rem; font-weight: 700; line-height: 1.45; margin: .7rem 0 1rem; }
.latest-content h4 a { color: var(--text-main); text-decoration: none; }
.latest-content h4 a:hover { color: var(--brand-primary); }
.latest-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.read-link { color: var(--brand-primary); font-weight: 600; font-size: .88rem; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; transition: gap .2s ease; }
.read-link:hover { color: var(--brand-primary-dark); gap: .7rem; }

.empty-state {
    text-align: center; padding: 2.5rem 1rem;
    background: var(--bg-surface);
    border: 1.5px dashed var(--border-light);
    border-radius: var(--radius);
    color: var(--text-muted);
}
.empty-state i { font-size: 1.8rem; color: var(--brand-primary-light); margin-bottom: .6rem; display: block; }

/* ---------- CTA ---------- */
.cta-banner {
    position: relative; overflow: hidden;
    margin-bottom: 5rem;
    border-radius: 24px;
    padding: 4.5rem 2rem;
    text-align: center;
    color: var(--text-light);
    background:
        radial-gradient(50% 80% at 90% 0%, rgba(236,72,153,.35) 0%, transparent 60%),
        var(--gradient-dark-bg);
    box-shadow: var(--shadow-lg);
}
.cta-banner h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem; }
.cta-banner p.lead { color: var(--text-light-muted); max-width: 620px; margin: 0 auto 2rem; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 720px; margin: 0 auto; }
.stat {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    padding: 1.4rem 1rem;
}
.stat strong {
    display: block; font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.1;
    background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat span { color: var(--text-light-muted); font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .categories-sidebar { position: static; }
}
@media (max-width: 768px) {
    .hero-banner { padding: 3rem 0 4rem; }
    .search-pill button span { display: none; }
    .stats { grid-template-columns: 1fr; }
    .category-section .section-head { align-items: flex-start; flex-direction: column; }
}

/* ---------- Motion ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.featured-card, .trending-card, .latest-card, .top-blog-card { animation: fadeInUp .6s ease both; }
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}