/* ============================================================
   VILY HUB — HERO HOMEPAGE STYLES v9.3.0
   ============================================================ */

/* --- GLOBAL VARIABLES & DARK MODE --- */
:root {
    --vh-primary: #7c3aed;
    --vh-primary-light: #a855f7;
    --vh-primary-glow: rgba(124, 58, 237, 0.3);
    --vh-bg: #ffffff;
    --vh-bg-alt: #f8fafc;
    --vh-text: #1e293b;
    --vh-text-light: #64748b;
    --vh-border: #e2e8f0;
    --vh-card-bg: #ffffff;
    --vh-radius: 20px;
    --vh-shadow: 0 10px 40px rgba(0,0,0,0.08);
    --vh-shadow-hover: 0 20px 50px rgba(124, 58, 237, 0.15);
}

/* Foxiz Theme Dark Mode Override */
[data-theme="dark"], body.dark-mode, .dark-theme {
    --vh-bg: #0f172a;
    --vh-bg-alt: #1e293b;
    --vh-text: #f8fafc;
    --vh-text-light: #94a3b8;
    --vh-border: #334155;
    --vh-card-bg: #1e293b;
    --vh-shadow: 0 10px 40px rgba(0,0,0,0.4);
    --vh-shadow-hover: 0 20px 50px rgba(168, 85, 247, 0.25);
}

/* --- WRAPPER & BASE --- */
.vh-landing-wrapper {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--vh-text);
    background: var(--vh-bg);
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden; /* Prevents horizontal scrolling glitches */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.vh-landing-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* ============================================================
   HERO SECTION
   ============================================================ */
.vh-hero {
    padding: 60px 0 80px;
    background: var(--vh-bg-alt);
    position: relative;
    overflow: hidden;
}

/* Background Glow */
.vh-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: var(--vh-primary);
    filter: blur(150px);
    opacity: 0.1;
    border-radius: 50%;
    pointer-events: none;
}

.vh-hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 40px;
    position: relative;
    z-index: 2;
}

/* --- Left Side: Text --- */
.vh-hero-text {
    flex: 1;
    max-width: 550px;
}

.vh-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--vh-primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.vh-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--vh-primary);
    border-radius: 50%;
    animation: vhPulse 2s infinite;
}

.vh-hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
    color: var(--vh-text);
}

.vh-highlight {
    background: linear-gradient(135deg, var(--vh-primary), var(--vh-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vh-subtitle {
    font-size: 1.15rem;
    color: var(--vh-text-light);
    margin-bottom: 30px;
    line-height: 1.6;
    max-width: 500px;
}

.vh-bonus-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    margin-bottom: 35px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(253, 230, 138, 0.3);
}

.vh-bonus-banner strong {
    color: #78350f;
}

.vh-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.vh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.vh-btn-primary {
    background: linear-gradient(135deg, var(--vh-primary), var(--vh-primary-light));
    color: white !important;
    box-shadow: 0 8px 25px var(--vh-primary-glow);
}

.vh-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--vh-primary-glow);
}

.vh-btn-ghost {
    background: transparent;
    color: var(--vh-text) !important;
    border: 2px solid var(--vh-border);
}

.vh-btn-ghost:hover {
    border-color: var(--vh-primary);
    color: var(--vh-primary) !important;
    background: rgba(124, 58, 237, 0.05);
}

/* --- Right Side: Persona Slider & Phone Mockup --- */
.vh-hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 500px;
}

/* The Slider Container for Personas */
.vh-mockup-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    padding: 20px 10px 40px 10px;
    width: 100%;
    max-width: 360px;
    position: relative;
    z-index: 3;
}

.vh-mockup-slider::-webkit-scrollbar {
    display: none;
}

.vh-mockup-slide {
    min-width: 100%;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Persona Tag above phone */
.vh-persona-badge {
    background: var(--vh-text);
    color: var(--vh-bg);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    white-space: nowrap;
}

/* Phone Frame */
.vh-phone-mockup {
    width: 100%;
    max-width: 280px;
    background: var(--vh-card-bg);
    border-radius: 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    border: 6px solid #000;
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .vh-phone-mockup, body.dark-mode .vh-phone-mockup {
    border-color: #334155;
}

.vh-phone-header {
    background: linear-gradient(135deg, var(--vh-primary), var(--vh-primary-light));
    color: white;
    padding: 18px;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Phone Body (Scrollable Content) */
.vh-phone-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--vh-bg-alt);
    height: 320px; /* Fixed height to force scroll */
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vh-phone-body::-webkit-scrollbar {
    display: none; /* Hide scrollbar for cleaner look */
}

/* Sample Feed Items */
.vh-sample-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--vh-card-bg);
    border-radius: 14px;
    border: 1px solid var(--vh-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.vh-sample-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.bg-purple { background: #a855f7; }
.bg-pink { background: #ec4899; }
.bg-blue { background: #3b82f6; }
.bg-green { background: #10b981; }

.vh-sample-info {
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

.vh-sample-info strong {
    display: block;
    font-size: 0.8rem;
    color: var(--vh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.vh-sample-info small {
    display: block;
    font-size: 0.7rem;
    color: var(--vh-text-light);
}

.vh-sample-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--vh-text-light);
    flex-shrink: 0;
}

.vh-sample-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Floating Bubbles */
.vh-floating-bubble {
    position: absolute;
    background: var(--vh-card-bg);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 4;
    border: 1px solid var(--vh-border);
}

.vh-bubble-1 {
    bottom: 10%;
    right: -10px;
    color: var(--vh-primary);
    animation: vhFloat 5s ease-in-out infinite 1s;
}

.vh-blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--vh-primary);
    filter: blur(100px);
    opacity: 0.15;
    border-radius: 50%;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================================
   PROBLEM / SOLUTION SECTION (Fixed Overflow)
   ============================================================ */
.vh-solution {
    padding: 80px 0;
    background: var(--vh-bg);
}

.vh-solution-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.vh-box {
    padding: 30px 20px;
    border-radius: var(--vh-radius);
    text-align: center;
    border: 1px solid var(--vh-border);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vh-noise-box {
    background: var(--vh-bg-alt);
    filter: grayscale(100%);
    opacity: 0.8;
}

.vh-solution-box {
    background: rgba(124, 58, 237, 0.05);
    border-color: var(--vh-primary);
    box-shadow: var(--vh-shadow-hover);
}

.vh-noise-icons {
    font-size: 1.5rem;
    color: #9ca3af;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.vh-solution-icons {
    margin-bottom: 15px;
}

.vh-solution-grid h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--vh-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vh-solution-grid p {
    color: var(--vh-text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================
   CATEGORY GRID SECTION
   ============================================================ */
.vh-categories-section {
    padding: 60px 0;
    background: var(--vh-bg-alt);
}

.vh-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.vh-section-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--vh-text);
    margin-bottom: 8px;
}

.vh-section-header p {
    color: var(--vh-text-light);
    font-size: 1rem;
}

.vh-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.vh-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--vh-card-bg);
    border: 1px solid var(--vh-border);
    border-radius: 16px;
    padding: 20px 10px;
    text-decoration: none;
    color: var(--vh-text);
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.vh-cat-card i {
    font-size: 1.8rem;
    color: var(--vh-primary);
    transition: transform 0.3s;
}

.vh-cat-card span {
    font-size: 0.85rem;
    font-weight: 700;
}

.vh-cat-card:hover {
    border-color: var(--vh-primary);
    box-shadow: var(--vh-shadow-hover);
    transform: translateY(-3px);
}

.vh-cat-card:hover i {
    transform: scale(1.1);
}

/* ============================================================
   DYNAMIC POST SLIDERS (Real Data)
   ============================================================ */
.vh-dynamic-content {
    padding: 60px 0;
    background: var(--vh-bg);
}

.vh-slider-section {
    margin-bottom: 50px;
}

.vh-slider-section:last-child {
    margin-bottom: 0;
}

.vh-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.vh-slider-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--vh-text);
    margin: 0;
}

.vh-slider-header a {
    color: var(--vh-primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s;
}

.vh-slider-header a:hover {
    gap: 10px;
}

/* Slider Track */
.vh-slider-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: var(--vh-radius);
}

.vh-slider-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 10px;
    cursor: grab;
}

.vh-slider-track:active {
    cursor: grabbing;
}

.vh-slider-track::-webkit-scrollbar { 
    display: none; 
}

/* Post Cards */
.vh-post-card {
    min-width: 260px;
    max-width: 260px;
    flex-shrink: 0;
    background: var(--vh-card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--vh-border);
    scroll-snap-align: start;
    transition: transform 0.3s, box-shadow 0.3s;
}

.vh-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vh-shadow);
}

.vh-card-img-link {
    display: block;
    text-decoration: none;
}

/* FIXED: Image Display logic */
.vh-card-img {
    height: 160px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative;
    width: 100%;
    display: block;
    background-color: var(--vh-bg-alt); /* Fallback color */
}

.vh-card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vh-card-content {
    padding: 15px;
}

.vh-card-content h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    line-height: 1.4;
    height: 40px; /* Limit title to 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vh-card-content h4 a {
    color: var(--vh-text);
    text-decoration: none;
    transition: color 0.2s;
}

.vh-card-content h4 a:hover {
    color: var(--vh-primary);
}

.vh-card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.vh-likes {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vh-dislikes {
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================================
   FINAL CTA SECTION
   ============================================================ */
.vh-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--vh-primary), var(--vh-primary-light));
    position: relative;
    overflow: hidden;
}

.vh-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
}

.vh-cta-box {
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
}

.vh-cta-box h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 15px;
    color: white;
    font-weight: 900;
}

.vh-cta-box p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.vh-cta-box .vh-btn-primary {
    background: white;
    color: var(--vh-primary) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.vh-cta-box .vh-btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes vhPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
}

@keyframes vhFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 960px) {
    .vh-hero-container {
        flex-direction: column;
        text-align: center;
        padding-top: 20px;
    }
    
    .vh-hero-text {
        max-width: 100%;
    }
    
    .vh-hero-text h1 {
        font-size: 2.8rem;
    }
    
    .vh-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .vh-actions {
        justify-content: center;
    }
    
    .vh-hero-visual {
        order: -1; /* Move phone to top */
        margin-bottom: 40px;
        min-height: 450px;
    }
    
    .vh-floating-bubble {
        display: none;
    }
    
    .vh-solution-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .vh-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .vh-hero {
        padding: 40px 0;
    }
    
    .vh-hero-text h1 {
        font-size: 2.3rem;
    }
    
    .vh-btn {
        width: 100%;
        padding: 15px 20px;
    }
    
    /* FIXED: Keeps "View All" on the right side instead of wrapping */
    .vh-slider-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    
    .vh-slider-header h2 {
        font-size: 1.2rem;
    }
    
    .vh-slider-header a {
        font-size: 0.85rem;
    }
    
    .vh-post-card {
        min-width: 220px;
    }
    
    .vh-card-img {
        height: 140px;
    }
}

/* --- Scroll Reveal Animations (Used by hero.js) --- */
.vh-animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.vh-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}