:root {
    --primary: #4361ee;
    --primary-hover: #3a56d4;
    --secondary: #7209b7;
    --success: #00b894;
    --danger: #ef4444;
    --warning: #f1c40f;
    --dark: #2b2d42;
    --text-main: #4a5568;
    --text-light: #a0aec0;
    --bg-body: #f5f7ff;
    --bg-card: #ffffff;
    --border-radius: 16px;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 60px rgba(67, 97, 238, 0.15);
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --transition: all 0.3s ease;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

a { text-decoration: none; transition: var(--transition); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   1. INDEX HERO SECTION
   ========================================= */
.offers-hero {
    background: var(--dark);
    position: relative;
    padding: 100px 0 140px; /* Extra padding bottom for overlap */
    overflow: hidden;
    text-align: center;
    color: white;
}

.offers-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0.9;
    z-index: 1;
}

.offers-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Search Overlap Fix */
.search-card-wrapper {
    margin-top: -60px; /* Pulls search up into hero */
    position: relative;
    z-index: 10;
}

.search-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.2);
}

.search-input-lg {
    width: 100%;
    padding: 18px 60px 18px 25px;
    font-size: 1.1rem;
    border: 2px solid #f0f2f5;
    border-radius: 14px;
    background-color: #f8f9fc;
    color: var(--dark);
    transition: var(--transition);
}

.search-input-lg:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
}

.search-btn-abs {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn-abs:hover { background: var(--secondary); }

/* =========================================
   2. FILTERS & CARDS
   ========================================= */
.filters-card {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin: 30px 0 40px;
    border: 1px solid #eef2f6;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: var(--dark);
}

/* Offer Card */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
}

.offer-card-new {
    background: white;
    border-radius: 20px;
    border: 1px solid #fff;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 15px 0 15px 0;
}

.offer-card-new:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.offer-header-new {
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.offer-img-new {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    object-fit: contain;
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 5px;
    flex-shrink: 0;
}

.offer-info-new { flex: 1; }
.offer-title-new {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    display: block;
    margin-bottom: 5px;
    line-height: 1.3;
}
.offer-desc-new {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-bottom: 15px;
}

.btn-create-flow {
    padding: 8px 20px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.btn-create-flow:hover { background: var(--primary); color: white; }

/* Badges */
.offer-badges { position: absolute; top: 0; right: 0; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; }
.offer-badge { padding: 4px 12px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: white; border-bottom-left-radius: 10px; }
.badge-exclusive { background: var(--secondary); }
.badge-hot { background: var(--danger); }
.badge-top { background: var(--warning); color: #212529; }
.badge-new { background: var(--success); }

/* Card Stats */
.card-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid #f0f2f5;
    background: #fafbfc;
    padding: 15px;
}
.stat-box { text-align: center; border-right: 1px solid #eee; }
.stat-box:last-child { border: none; }
.stat-label { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; font-weight: 700; display: block; }
.stat-value { font-size: 1rem; font-weight: 800; color: var(--dark); }

/* Geo Table in Card */
.offer-geo-table { padding: 15px 25px; }
.offer-geo-table table { width: 100%; font-size: 0.9rem; }
.offer-geo-table td { padding: 6px 0; border-bottom: 1px solid #f8f9fa; }
.text-success { color: var(--success) !important; }


/* =========================================
   3. SHOW PAGE (DETAILS) - THE "CANDY" STYLE
   ========================================= */

/* Top Navigation */
.offer-breadcrumbs {
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}
.offer-breadcrumbs a { color: var(--text-main); }
.offer-breadcrumbs a:hover { color: var(--primary); }

/* Layout Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* Left Column: Main Content */
.offer-main-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.detail-header {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
}
.detail-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    border: 1px solid #eee;
    padding: 10px;
    object-fit: contain;
}
.detail-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
    line-height: 1.1;
}
.detail-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tag-pill {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-main);
}
.tag-pill i { margin-right: 5px; color: var(--primary); }

/* Stats Row inside Main Card */
.detail-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 40px;
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
}
.kpi-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kpi-label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-light); font-weight: 700; margin-bottom: 5px; }
.kpi-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); }

/* Section Titles */
.section-head { font-size: 1.25rem; font-weight: 700; color: var(--dark); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.section-head i { color: var(--secondary); }

/* Geo Table */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th { text-align: left; color: var(--text-light); font-size: 0.8rem; text-transform: uppercase; padding-bottom: 15px; border-bottom: 2px solid #f1f5f9; }
.detail-table td { padding: 15px 0; border-bottom: 1px solid #f1f5f9; color: var(--dark); font-weight: 500; }
.flag-icon { margin-right: 8px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Sources Grid */
.sources-list { display: flex; flex-wrap: wrap; gap: 10px; }
.source-badge { padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.source-allowed { background: #dcfce7; color: #166534; }
.source-denied { background: #fee2e2; color: #991b1b; }

/* Right Column: Sticky Sidebar */
.sticky-sidebar { position: sticky; top: 20px; }

.cta-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(67, 97, 238, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: var(--gradient);
}

.payout-label { font-size: 0.9rem; color: var(--text-light); text-transform: uppercase; font-weight: 700; }
.payout-amount { font-size: 2.5rem; font-weight: 800; color: var(--success); margin: 5px 0 20px; }

.btn-block { display: block; width: 100%; padding: 15px; border-radius: 12px; font-weight: 700; text-align: center; margin-bottom: 10px; font-size: 1rem; }
.btn-cta { background: var(--gradient); color: white; box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3); transition: transform 0.2s; }
.btn-cta:hover { transform: translateY(-3px); color: white; }
.btn-login-outline { border: 2px solid #e2e8f0; color: var(--text-main); background: transparent; }
.btn-login-outline:hover { border-color: var(--primary); color: var(--primary); }

.info-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}
.info-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.9rem; }
.info-label { color: var(--text-light); }
.info-val { font-weight: 600; color: var(--dark); }

/* Landing Previews */
.landing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.landing-item {
    background: #f8f9fa; border-radius: 12px; padding: 15px; text-align: center; transition: var(--transition); border: 1px solid #eee;
}
.landing-item:hover { border-color: var(--primary); transform: translateY(-3px); }
.landing-icon { font-size: 2rem; color: #cbd5e0; margin-bottom: 10px; }
.landing-name { font-size: 0.85rem; font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive */
@media (max-width: 992px) {
    .details-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.2rem; }
}
@media (max-width: 576px) {
    .offers-grid { grid-template-columns: 1fr; }
    .detail-kpi-grid { grid-template-columns: 1fr 1fr; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .landing-grid { grid-template-columns: 1fr; }
}
