/* ===========================================================
   AffiliateHub – Bio Link Landing Page Stylesheet
   Pure CSS, no framework dependency. Mobile-first design.
   =========================================================== */

/* ---- CSS Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- CSS Variables / Design Tokens ---- */
:root {
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Theme: Violet Glow (default) ---- */
.theme-violet-glow {
    --bg-base: #0a0612;
    --primary: #7c3aed;
    --primary-rgb: 124, 58, 237;
    --accent: #ec4899;
    --accent-rgb: 236, 72, 153;
    --secondary: #4f46e5;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(236, 72, 153, 0.3);
    --card-hover-bg: rgba(255, 255, 255, 0.08);
    --text-title: #ffffff;
    --text-body: #cbd5e1;
    --text-muted: #64748b;
    --glow: rgba(124, 58, 237, 0.25);
}

/* ---- Theme: Sunset Glow ---- */
.theme-sunset-glow {
    --bg-base: #0f0702;
    --primary: #ea580c;
    --primary-rgb: 234, 88, 12;
    --accent: #f43f5e;
    --accent-rgb: 244, 63, 94;
    --secondary: #e11d48;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-hover-border: rgba(244, 63, 94, 0.3);
    --card-hover-bg: rgba(255, 255, 255, 0.07);
    --text-title: #fff;
    --text-body: #f1f5f9;
    --text-muted: #94a3b8;
    --glow: rgba(234, 88, 12, 0.25);
}

/* ---- Theme: Neon Forest ---- */
.theme-neon-forest {
    --bg-base: #020b07;
    --primary: #059669;
    --primary-rgb: 5, 150, 105;
    --accent: #10b981;
    --accent-rgb: 16, 185, 129;
    --secondary: #06b6d4;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-hover-border: rgba(16, 185, 129, 0.35);
    --card-hover-bg: rgba(255, 255, 255, 0.07);
    --text-title: #fff;
    --text-body: #e2e8f0;
    --text-muted: #8892b0;
    --glow: rgba(5, 150, 105, 0.25);
}

/* ---- Theme: Midnight Gold ---- */
.theme-midnight-gold {
    --bg-base: #060606;
    --primary: #d97706;
    --primary-rgb: 217, 119, 6;
    --accent: #f59e0b;
    --accent-rgb: 245, 158, 11;
    --secondary: #78350f;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(245, 158, 11, 0.25);
    --card-hover-bg: rgba(255, 255, 255, 0.06);
    --text-title: #fff;
    --text-body: #f3f4f6;
    --text-muted: #9ca3af;
    --glow: rgba(217, 119, 6, 0.2);
}

/* ---- Body ---- */
body {
    background-color: var(--bg-base);
    font-family: var(--font-sans);
    color: var(--text-body);
    min-height: 100vh;
    padding-bottom: 4rem;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease;
}

/* ---- Utility: hidden ---- */
.hidden-el { display: none !important; }

/* ---- Gradient Glow Background Orbs ---- */
.glow-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.glow-orb-1 {
    width: 380px; height: 380px;
    top: -120px; left: -100px;
    background-color: var(--primary);
    opacity: 0.25;
    animation: orbFloat 12s ease-in-out infinite alternate;
}

.glow-orb-2 {
    width: 340px; height: 340px;
    top: 35%; right: -130px;
    background-color: var(--accent);
    opacity: 0.2;
    animation: orbFloat 15s ease-in-out infinite alternate-reverse;
}

.glow-orb-3 {
    width: 300px; height: 300px;
    bottom: -100px; left: 20%;
    background-color: var(--secondary);
    opacity: 0.2;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.1); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ---- Main Container ---- */
.landing-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 1rem 1rem;
    position: relative;
    z-index: 1;
}

/* ---- Profile Header ---- */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar-container {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: 1rem;
}

.avatar-glow {
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.75;
    z-index: 0;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

.avatar-img {
    position: relative;
    z-index: 1;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(0, 0, 0, 0.4);
}

.creator-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-title);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.creator-bio {
    font-size: 0.875rem;
    color: var(--text-body);
    max-width: 360px;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ---- Social Icons Row ---- */
.socials-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-body);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.social-icon-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--glow);
    border-color: var(--primary);
}

.social-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ---- Search Bar ---- */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.9rem 2.5rem 0.9rem 3rem;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    font-size: 0.875rem;
    color: #ffffff;
    font-family: var(--font-sans);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15), 0 4px 16px rgba(0, 0, 0, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 0;
}

.clear-search-btn:hover {
    color: #ffffff;
}

.clear-icon {
    width: 16px;
    height: 16px;
}

/* ---- Categories ---- */
.categories-wrapper {
    overflow-x: auto;
    margin: 0 -1rem 1.5rem;
    padding: 0 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-wrapper::-webkit-scrollbar {
    display: none;
}

.categories-scroll {
    display: flex;
    gap: 0.5rem;
    min-width: max-content;
    padding-bottom: 4px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    white-space: nowrap;
    font-family: var(--font-sans);
}

.category-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--glow);
    font-weight: 600;
}

.category-pill:hover:not(.active) {
    border-color: var(--primary);
    background-color: var(--card-hover-bg);
    color: #ffffff;
}

/* ---- Product Cards ---- */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.product-card {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s var(--ease-out-expo);
}

.product-card:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--card-hover-border);
    background-color: var(--card-hover-bg);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), 0 0 20px var(--glow);
}

.product-card:active {
    transform: translateY(-1px) scale(0.995);
}

.product-image-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 100%);
    color: var(--primary);
}

.product-placeholder-icon svg {
    width: 28px;
    height: 28px;
}

.product-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    min-width: 0;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-title);
    font-family: var(--font-display);
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.shop-name {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.shop-name svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.commission-badge {
    background-color: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.product-price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.45rem;
}

.price-tag {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-display);
}

.buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.4rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 10px var(--glow);
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.buy-btn svg {
    width: 13px;
    height: 13px;
}

.product-card:hover .buy-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35);
}

/* ---- Empty State ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.empty-icon {
    width: 28px;
    height: 28px;
}

.empty-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- Footer ---- */
.landing-footer {
    margin-top: 4rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}

.footer-link {
    color: var(--text-body);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-link-icon {
    width: 11px;
    height: 11px;
}

/* ---- Animations ---- */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-out-expo) forwards;
}

.stagger-item {
    opacity: 0;
    transform: translateY(18px);
    animation: slideUpFade 0.55s var(--ease-out-expo) forwards;
}

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

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .fade-in, .stagger-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .glow-orb { animation: none; }
    .avatar-glow { animation: none; }
}
