/* 
 * VisaPathway - Professional Design System
 * Inspired by NerdWallet, Healthline, Investopedia
 * Unified styling for all pages
 */

/* ========================================
   CSS RESET & VARIABLES
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Brand Colors - Trust & Authority */
    --brand-primary: #0f172a;      /* Deep navy - authority */
    --brand-secondary: #1e40af;    /* Blue - trust */
    --brand-accent: #0ea5e9;       /* Sky blue - modern */
    
    /* Semantic Colors */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);
    
    /* Max Widths */
    --max-width-content: 720px;
    --max-width-wide: 1100px;
    --max-width-full: 1400px;
}

/* ========================================
   BASE STYLES
   ======================================== */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

a {
    color: var(--brand-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

/* ========================================
   LAYOUT CONTAINERS
   ======================================== */
.container {
    width: 100%;
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-narrow {
    max-width: var(--max-width-content);
}

.container-wide {
    max-width: var(--max-width-full);
}

/* ========================================
   HEADER - UNIFIED ACROSS ALL PAGES
   ======================================== */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: var(--space-lg);
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-decoration: none;
}

.site-logo:hover {
    color: var(--brand-secondary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--brand-secondary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-secondary);
    border-radius: var(--radius-full);
}

.nav-cta {
    background: var(--brand-secondary);
    color: white !important;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.nav-cta:hover {
    background: var(--brand-primary);
    color: white !important;
}

/* Mobile-only elements */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 1;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 80px 24px 24px;
        gap: var(--space-sm);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        transition: right 0.3s ease;
        z-index: 1000;
        display: flex;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: var(--radius-md);
        transition: background 0.2s;
    }
    
    .nav-links a:hover {
        background: var(--bg-secondary);
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .site-nav {
        gap: var(--space-md);
    }
    
    .nav-cta {
        display: none;
    }
    
    /* Add CTA to mobile menu */
    .nav-links .mobile-cta {
        display: block;
        margin-top: auto;
        padding: 14px 20px;
        background: var(--brand-primary);
        color: white !important;
        text-align: center;
        border-radius: var(--radius-md);
        font-weight: 600;
    }
}

/* ========================================
   READING PROGRESS BAR
   ======================================== */
.reading-progress {
    position: fixed;
    top: 64px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-secondary), var(--brand-accent));
    z-index: 999;
    transition: width 0.1s linear;
}

/* ========================================
   PAGE HERO
   ======================================== */
.page-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #1e3a5f 100%);
    color: white;
    padding: var(--space-3xl) var(--space-md);
    text-align: center;
}

.page-hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.page-hero p {
    color: rgba(255,255,255,0.85);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    border: 1px solid rgba(255,255,255,0.2);
}

/* ========================================
   ARTICLE LAYOUT
   ======================================== */
.article-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
}

.article-header {
    margin-bottom: var(--space-xl);
}

.article-category {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--brand-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--space-md);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Article Content */
.article-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.article-content h2 {
    margin: var(--space-2xl) 0 var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
    color: var(--brand-primary);
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    margin: var(--space-xl) 0 var(--space-md);
    color: var(--text-primary);
}

.article-content ul,
.article-content ol {
    margin: 0 0 var(--space-lg) var(--space-lg);
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: var(--space-sm);
}

/* ========================================
   INFO BOXES
   ======================================== */
.info-box {
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
}

.info-box.tip {
    background: #ecfdf5;
    border-left: 4px solid var(--success);
}

.info-box.warning {
    background: #fffbeb;
    border-left: 4px solid var(--warning);
}

.info-box.danger {
    background: #fef2f2;
    border-left: 4px solid var(--danger);
}

.info-box.info {
    background: #eff6ff;
    border-left: 4px solid var(--info);
}

.info-box strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: var(--space-sm);
}

/* ========================================
   QUIZ SECTION
   ======================================== */
.quiz-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
}

.quiz-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.quiz-header h3 {
    color: var(--brand-primary);
    margin-bottom: var(--space-xs);
}

.quiz-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.quiz-question {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
}

.quiz-question > p {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.quiz-option:hover {
    border-color: var(--brand-secondary);
    background: var(--bg-secondary);
}

.quiz-option.selected {
    border-color: var(--brand-secondary);
    background: #eff6ff;
}

.quiz-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: var(--space-lg) auto 0;
    padding: var(--space-md) var(--space-xl);
    background: var(--brand-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quiz-btn:hover {
    background: var(--brand-primary);
}

.quiz-result {
    display: none;
    background: #ecfdf5;
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    text-align: center;
}

.quiz-result.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.card.featured {
    border-color: var(--brand-secondary);
    background: linear-gradient(to right, #eff6ff, var(--bg-primary));
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
    gap: var(--space-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.card-badge {
    background: var(--brand-secondary);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.card-stat {
    background: var(--bg-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
}

.card-stat .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-stat .value {
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TABLES
   ======================================== */
.table-wrapper {
    overflow-x: auto;
    margin: var(--space-lg) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

th, td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--brand-primary);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background: var(--bg-secondary);
}

/* ========================================
   FAQ ACCORDION
   ======================================== */
.faq-section {
    margin: var(--space-xl) 0;
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question span {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: var(--space-lg);
}

/* ========================================
   ADS - Mobile Optimized
   ======================================== */
.ad-container {
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-xl) 0;
    text-align: center;
    min-height: 100px;
}

.ad-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

/* Mobile sticky bottom ad */
.mobile-sticky-ad {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 8px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 900;
    text-align: center;
}

.mobile-sticky-ad .ad-label {
    font-size: 0.625rem;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .mobile-sticky-ad {
        display: block;
    }
    
    /* Add padding to body so content isn't hidden behind sticky ad */
    body {
        padding-bottom: 100px;
    }
    
    /* Make in-content ads more prominent on mobile */
    .ad-container {
        margin: var(--space-lg) -16px;
        border-radius: 0;
        padding: var(--space-md) var(--space-sm);
        border-left: none;
        border-right: none;
    }
    
    /* Ensure ads have good visibility */
    .ad-container ins {
        min-height: 250px;
    }
}

/* In-article native ad style */
.ad-native {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.ad-native .ad-label {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* ========================================
   CTA BOX
   ======================================== */
.cta-box {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #1e3a5f 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    margin: var(--space-2xl) 0;
}

.cta-box h3 {
    color: white;
    margin-bottom: var(--space-sm);
}

.cta-box p {
    color: rgba(255,255,255,0.85);
    margin-bottom: var(--space-lg);
}

.cta-box .btn {
    display: inline-block;
    background: white;
    color: var(--brand-primary);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform 0.2s ease;
}

.cta-box .btn:hover {
    transform: translateY(-2px);
    color: var(--brand-secondary);
}

/* ========================================
   RELATED ARTICLES
   ======================================== */
.related-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-2xl);
}

.related-section h3 {
    margin-bottom: var(--space-md);
}

.related-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-section li {
    margin-bottom: var(--space-sm);
}

.related-section a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-weight: 500;
}

.related-section a::before {
    content: '→';
    color: var(--brand-secondary);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--brand-primary);
    color: rgba(255,255,255,0.85);
    padding: var(--space-2xl) var(--space-md);
    margin-top: var(--space-3xl);
}

.footer-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.footer-section h4 {
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-sm);
}

.footer-section a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9375rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-lg);
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
}

.footer-disclaimer {
    margin-top: var(--space-md);
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   BLOG INDEX
   ======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.blog-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.blog-card-content {
    padding: var(--space-lg);
}

.blog-card-category {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.blog-card-category.immigration { background: #dbeafe; color: #1e40af; }
.blog-card-category.finance { background: #d1fae5; color: #047857; }
.blog-card-category.remote { background: #ede9fe; color: #7c3aed; }
.blog-card-category.education { background: #fef3c7; color: #92400e; }
.blog-card-category.tech { background: #e0e7ff; color: #4338ca; }
.blog-card-category.insurance { background: #fce7f3; color: #be185d; }

.blog-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.blog-card h3 a {
    color: var(--text-primary);
}

.blog-card h3 a:hover {
    color: var(--brand-secondary);
}

.blog-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.blog-card-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.section-title {
    font-size: 1.25rem;
    color: var(--brand-primary);
    margin: var(--space-2xl) 0 var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--brand-secondary);
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

/* ========================================
   ENGAGEMENT BOOSTERS - Keep users on page
   ======================================== */

/* Hook Banner - Grabs attention immediately */
.hook-banner {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.hook-banner.urgent {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.hook-banner .hook-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.hook-banner .hook-text {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
}

.hook-banner .hook-text span {
    display: block;
    font-weight: 400;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 4px;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(5, 150, 105, 0.5); }
}

/* Scroll Reward - Shows after scrolling */
.scroll-reward {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: var(--brand-secondary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    z-index: 800;
    transform: translateX(200px);
    transition: transform 0.3s ease;
}

.scroll-reward.show {
    transform: translateX(0);
}

/* Table of Contents - Sticky sidebar on desktop */
.toc-sticky {
    position: sticky;
    top: 80px;
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.toc-sticky h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.toc-sticky ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sticky li {
    margin: 8px 0;
}

.toc-sticky a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.toc-sticky a:hover, .toc-sticky a.active {
    background: var(--brand-secondary);
    color: white;
}

/* Quick Stats Bar - Above the fold engagement */
.quick-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.quick-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.quick-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-secondary);
}

.quick-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Highlight Box - Key information */
.highlight-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: var(--space-lg);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin: var(--space-lg) 0;
}

.highlight-box.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #059669;
}

.highlight-box.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #2563eb;
}

.highlight-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Exit Intent Modal */
.exit-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.exit-modal.show {
    display: flex;
}

.exit-modal-content {
    background: white;
    max-width: 400px;
    width: 100%;
    padding: 40px 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    position: relative;
    animation: modalBounce 0.4s ease;
}

@keyframes modalBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.exit-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--brand-primary);
}

.exit-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.exit-modal-content .btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.exit-modal .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Reading Progress with Milestone */
.progress-milestone {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 8px 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 899;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.progress-milestone.show {
    transform: translateY(0);
}

.progress-milestone .milestone-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-milestone .milestone-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.progress-milestone .milestone-text {
    font-weight: 600;
    white-space: nowrap;
}

/* Inline CTA - Mid-article conversion */
.inline-cta {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    margin: var(--space-xl) 0;
    text-align: center;
}

.inline-cta h3 {
    color: white;
    margin-bottom: 8px;
}

.inline-cta p {
    color: rgba(255,255,255,0.85);
    margin-bottom: var(--space-md);
}

.inline-cta .btn {
    background: white;
    color: var(--brand-primary);
    font-weight: 700;
}

.inline-cta .btn:hover {
    background: var(--bg-tertiary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    :root {
        --space-2xl: 32px;
        --space-3xl: 48px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
    
    .page-hero {
        padding: var(--space-xl) var(--space-md);
    }
    
    .page-hero h1 {
        font-size: 1.75rem;
    }
    
    .article-content {
        padding: var(--space-lg);
    }
    
    .quick-stats {
        gap: 8px;
    }
    
    .quick-stat {
        min-width: 80px;
        padding: 8px;
    }
    
    .quick-stat .stat-value {
        font-size: 1.25rem;
    }
    
    .scroll-reward {
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .hook-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .toc-sticky {
        display: none;
    }
}

/* ========================================
   BOUNCE RATE REDUCTION ELEMENTS
   ======================================== */

/* Sticky Read Next Bar - Appears after 40% scroll */
.read-next-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    transition: bottom 0.4s ease;
}

.read-next-bar.visible {
    bottom: 0;
}

.read-next-bar .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.read-next-bar .title {
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
}

.read-next-bar .arrow {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    color: white;
    transition: background 0.2s;
}

.read-next-bar .arrow:hover {
    background: rgba(255,255,255,0.3);
}

.read-next-bar .close-bar {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
}

.read-next-bar .close-bar:hover {
    opacity: 1;
}

/* Inline Article Card - Eye-catching internal link */
.inline-article-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.inline-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14,165,233,0.2);
}

.inline-article-card .card-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.inline-article-card .card-content {
    flex: 1;
}

.inline-article-card .card-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0284c7;
    font-weight: 600;
    margin-bottom: 4px;
}

.inline-article-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.inline-article-card .card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.inline-article-card .card-arrow {
    font-size: 1.5rem;
    color: #0ea5e9;
}

/* Popular Articles Grid - End of article */
.popular-articles {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    margin: 40px 0;
}

.popular-articles h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.popular-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.popular-article-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.popular-article-item:hover {
    border-color: var(--brand-secondary);
    box-shadow: 0 4px 12px rgba(30,64,175,0.1);
}

.popular-article-item .item-icon {
    font-size: 1.75rem;
}

.popular-article-item .item-content {
    flex: 1;
}

.popular-article-item .item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.3;
}

.popular-article-item .item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Mid-Article CTA Banner */
.mid-article-cta {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin: 32px 0;
    text-align: center;
}

.mid-article-cta h4 {
    color: #92400e;
    font-size: 1rem;
    margin-bottom: 8px;
}

.mid-article-cta p {
    color: #78350f;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.mid-article-cta .btn {
    background: #f59e0b;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

.mid-article-cta .btn:hover {
    background: #d97706;
}

/* Continue Reading Prompt */
.continue-reading {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--brand-secondary);
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
}

.continue-reading p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.continue-reading a {
    color: var(--brand-secondary);
    font-weight: 600;
    text-decoration: none;
}

.continue-reading a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .read-next-bar {
        flex-wrap: wrap;
        padding: 10px 16px;
    }
    
    .read-next-bar .title {
        order: 2;
        width: 100%;
        font-size: 0.85rem;
        margin-top: 4px;
    }
    
    .read-next-bar .label {
        flex: 1;
    }
    
    .inline-article-card {
        flex-direction: column;
        text-align: center;
    }
    
    .inline-article-card .card-arrow {
        display: none;
    }
    
    .popular-articles {
        padding: 20px;
    }
    
    .popular-articles-grid {
        grid-template-columns: 1fr;
    }
}
