/* ========================================
   VIRAL WAITING LIST - THREADBASE
   Modern, Eye-Catching Design
   ======================================== */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --success: #10b981;
    --success-light: #d1fae5;
    --background: #0f0f1a;
    --surface: #1a1a2e;
    --surface-light: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --border: rgba(255, 255, 255, 0.1);
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-2: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-3: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    position: relative;
}

/* ========================================
   ANIMATED BACKGROUND
   ======================================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(0, 50px) scale(0.9); }
    75% { transform: translate(-50px, -25px) scale(1.05); }
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(to bottom, rgba(15, 15, 26, 0.9), transparent);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
    animation: bounce 2s infinite;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-stats {
    display: flex;
    align-items: center;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.stat-number {
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */
.page {
    display: none;
    min-height: 100vh;
    padding: 100px 20px 40px;
    position: relative;
    z-index: 1;
}

.page.active {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   HERO PAGE
   ======================================== */
.hero-container {
    max-width: 800px;
    margin: auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 20px;
}

.hero-cta {
    margin-bottom: 48px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button.primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-glow);
}

.cta-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.5);
}

.cta-button .arrow {
    transition: transform 0.3s ease;
}

.cta-button:hover .arrow {
    transform: translateX(4px);
}

.cta-hint {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Social Proof */
.social-proof {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--background);
    margin-left: -12px;
    background: var(--surface);
    object-fit: cover;
}

.avatar-stack .avatar:first-child {
    margin-left: 0;
}

.avatar-stack .avatar.more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    font-size: 12px;
    font-weight: 600;
}

.social-proof-text {
    font-size: 15px;
    color: var(--text-secondary);
}

.social-proof-text strong {
    color: var(--text-primary);
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    margin: auto;
    position: relative;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.signup-card {
    max-width: 520px;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.back-btn:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

/* ========================================
   HEADER
   ======================================== */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    gap: 16px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.icon {
    margin-right: 4px;
}

.required {
    color: var(--accent);
    margin-left: 2px;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b6b7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

select option {
    background: var(--surface);
    color: var(--text-primary);
}

/* Benefits Preview */
.benefits-preview {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.benefits-preview h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-light);
}

.benefits-preview ul {
    list-style: none;
    display: grid;
    gap: 8px;
}

.benefits-preview li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.benefits-preview .check {
    color: var(--success);
    font-weight: 700;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: block;
}

/* ========================================
   DASHBOARD PAGE
   ======================================== */
.dashboard-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Success Card */
.success-card {
    text-align: center;
    padding: 48px 40px;
}

.success-animation {
    margin-bottom: 24px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: scaleIn 0.5s ease-out;
}

.checkmark {
    font-size: 40px;
    color: white;
    font-weight: 700;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-card h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.success-message {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.position-highlight {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2em;
}

/* Progress Section */
.progress-section {
    text-align: left;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.referral-count {
    color: var(--accent);
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--surface-light);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.progress-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.progress-hint strong {
    color: var(--accent);
}

/* Referral Card */
.referral-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.referral-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.referral-link-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.referral-link-box input {
    flex: 1;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: monospace;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
}

/* Share Buttons */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 32px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.share-icon {
    font-size: 18px;
    font-weight: 700;
}

.share-btn.twitter:hover { background: #000; border-color: #000; }
.share-btn.linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.share-btn.email:hover { background: #ea4335; border-color: #ea4335; }
.share-btn.whatsapp:hover { background: #25d366; border-color: #25d366; }

/* Rewards */
.rewards-preview h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.rewards-grid {
    display: grid;
    gap: 12px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.reward-item.unlocked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border-color: var(--success);
}

.reward-icon {
    font-size: 24px;
}

.reward-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reward-tier {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reward-name {
    font-weight: 600;
}

.reward-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--surface);
    color: var(--text-muted);
}

.reward-item.unlocked .reward-status {
    background: var(--success);
    color: white;
}

/* ========================================
   LEADERBOARD
   ======================================== */
.leaderboard-card {
    padding: 0;
    overflow: hidden;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.leaderboard-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.leaderboard-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-light);
    padding: 4px;
    border-radius: 100px;
}

.tab {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* Leaderboard List */
.leaderboard-list {
    padding: 8px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.rank-item:hover {
    background: var(--surface-light);
}

.rank-item.top-1 .rank-position { color: #ffd700; }
.rank-item.top-2 .rank-position { color: #c0c0c0; }
.rank-item.top-3 .rank-position { color: #cd7f32; }

.rank-position {
    width: 32px;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
}

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-light);
}

.rank-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rank-name {
    font-weight: 600;
    font-size: 14px;
}

.rank-company {
    font-size: 12px;
    color: var(--text-muted);
}

.rank-score {
    text-align: right;
}

.score-number {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.score-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Your Rank Section */
.your-rank {
    padding: 0 8px 16px;
}

.rank-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 16px 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rank-divider::before,
.rank-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.rank-item.you {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    border: 1px solid var(--success);
    padding: 14px 24px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--success);
    font-weight: 700;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 640px) {
    .navbar {
        padding: 16px 20px;
    }

    .nav-stats {
        display: none;
    }

    .page {
        padding: 80px 16px 24px;
    }

    .card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .hero-features {
        gap: 16px;
    }

    .feature-item {
        font-size: 14px;
    }

    .cta-button {
        padding: 16px 32px;
        font-size: 16px;
    }

    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .referral-link-box {
        flex-direction: column;
    }

    .copy-btn {
        justify-content: center;
    }

    .leaderboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .rewards-grid {
        gap: 8px;
    }

    .reward-item {
        padding: 12px;
    }

    .reward-icon {
        font-size: 20px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--surface) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Error States */
.error {
    border-color: #ef4444 !important;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
}
