/* Global Demo Layout Styles */
:root {
    --demo-bg: #e2e8f0;
    --demo-phone-bg: #ffffff;
    --demo-text: #0f172a;
    --demo-accent: #3b82f6;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--demo-bg);
    font-family: var(--font-sans);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
}

.demo-wrapper {
    display: flex;
    gap: 40px;
    align-items: center;
    max-width: 1000px;
    width: 100%;
}

.demo-sidebar {
    flex: 1;
    max-width: 400px;
}

.demo-sidebar h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
    line-height: 1.2;
}

.demo-sidebar p {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.demo-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
}

.demo-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}

.demo-nav a:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.demo-nav a.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 24px;
    font-weight: 500;
}

.btn-back:hover {
    color: #0f172a;
}

/* Phone Mockup Frame */
.phone-frame {
    width: 375px;
    height: 812px;
    /* iPhone Pro dimensions roughly */
    background: var(--demo-phone-bg);
    border-radius: 44px;
    box-shadow:
        0 0 0 10px #0f172a,
        0 20px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: #0f172a;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 100;
}

/* Base "Link in Bio" Page Styles inside the frame */
.bio-page {
    height: 100%;
    width: 100%;
    padding: 60px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--demo-text);
    position: relative;
}

.bio-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin-bottom: 16px;
    /* Uses a placeholder background for now, replaced by specific themes */
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--demo-accent);
}

.bio-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
}

.bio-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 32px;
    text-align: center;
}

.bio-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bio-link {
    display: block;
    width: 100%;
    padding: 16px;
    text-align: center;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
    transition: transform 0.2s, background 0.2s;
    backdrop-filter: blur(8px);
}

.bio-link:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Theme: Adult (OnlyFans style) ─────────────────────── */
body.theme-adult {
    --demo-bg: #1f0d23;
}

.theme-adult .phone-frame {
    --demo-phone-bg: linear-gradient(180deg, #1f0119 0%, #000000 100%);
    --demo-text: #ffffff;
    --demo-accent: #ec4899;
}

.theme-adult .bio-link {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
}

.theme-adult .demo-sidebar h1,
.theme-adult .demo-sidebar p,
.theme-adult .btn-back {
    color: #ffffff;
}

.theme-adult .demo-sidebar p {
    color: rgba(255, 255, 255, 0.8);
}

.theme-adult .demo-nav a {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(236, 72, 153, 0.3);
}

.theme-adult .demo-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-adult .demo-nav a.active {
    background: #ec4899;
    border-color: #ec4899;
}

/* ─── Theme: Fitness ────────────────────────────────────── */
body.theme-fitness {
    --demo-bg: #0f172a;
}

.theme-fitness .phone-frame {
    --demo-phone-bg: #000000;
    --demo-text: #ffffff;
    --demo-accent: #22c55e;
}

.theme-fitness .bio-page {
    background-image: radial-gradient(circle at top, rgba(34, 197, 94, 0.15), transparent 60%);
}

.theme-fitness .demo-sidebar h1,
.theme-fitness .demo-sidebar p,
.theme-fitness .btn-back {
    color: #ffffff;
}

.theme-fitness .demo-sidebar p {
    color: rgba(255, 255, 255, 0.8);
}

.theme-fitness .demo-nav a {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(34, 197, 94, 0.3);
}

.theme-fitness .demo-nav a.active {
    background: #22c55e;
    border-color: #22c55e;
}

.theme-fitness .bio-link {
    background: #111;
    border-color: #333;
}

.theme-fitness .bio-link.highlight {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

/* ─── Theme: Finance ────────────────────────────────────── */
body.theme-finance {
    --demo-bg: #020617;
}

.theme-finance .phone-frame {
    --demo-phone-bg: #020617;
    --demo-text: #ffffff;
    --demo-accent: #eab308;
}

.theme-finance .bio-link {
    background: rgba(234, 179, 8, 0.05);
    border-color: rgba(234, 179, 8, 0.2);
}

.theme-finance .bio-title {
    font-family: monospace;
    letter-spacing: -0.05em;
}

.theme-finance .demo-sidebar h1,
.theme-finance .demo-sidebar p,
.theme-finance .btn-back {
    color: #ffffff;
}

.theme-finance .demo-sidebar p {
    color: rgba(255, 255, 255, 0.8);
}

.theme-finance .demo-nav a {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(234, 179, 8, 0.3);
}

.theme-finance .demo-nav a.active {
    background: #eab308;
    border-color: #eab308;
}

/* ─── Theme: Agency/Course ──────────────────────────────── */
body.theme-agency {
    --demo-bg: #e0e7ff;
}

.theme-agency .phone-frame {
    --demo-phone-bg: #f8fafc;
    --demo-text: #0f172a;
    --demo-accent: #2563eb;
}

.theme-agency .bio-link {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* ─── Theme: Artist ─────────────────────────────────────── */
body.theme-artist {
    --demo-bg: #fce7f3;
}

.theme-artist .phone-frame {
    --demo-phone-bg: linear-gradient(135deg, #fdf4ff, #fae8ff);
    --demo-text: #4a044e;
    --demo-accent: #a855f7;
}

.theme-artist .bio-link {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    font-weight: 700;
}

/* ─── Loading State for Auth ────────────────────────────── */
.demo-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
    z-index: 9999;
}

/* Responsiveness */
@media (max-width: 800px) {
    .demo-wrapper {
        flex-direction: column;
    }
}