:root {
    --bg-main: #060913;
    --bg-card: rgba(20, 25, 40, 0.6);
    --border-light: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-muted: #94a3b8;
    
    --accent-blue: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --accent-emerald: #10b981;
    
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Blobs for depth */
.blob-bg {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(29,78,216,0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(60px);
}
.blob-2 {
    top: 50%;
    left: 80%;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, rgba(0,0,0,0) 70%);
}

/* Typography & Core */
h1 { font-size: 4rem; line-height: 1.1; font-weight: 600; letter-spacing: -1px; }
h2 { font-size: 2.2rem; font-weight: 600; }
h3 { font-size: 1.5rem; }
.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 1.5rem auto;
    font-weight: 300;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: white;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5); }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: white; }

.btn-text {
    background: transparent;
    color: var(--text-muted);
}
.btn-text:hover { color: white; }
.btn-full { width: 100%; justify-content: center; }
.btn-large { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}
.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.hidden { display: none !important; }

/* ── User Dropdown ── */
.user-dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 30px;
    transition: background 0.2s;
    user-select: none;
}
.dropdown-trigger:hover {
    background: rgba(255,255,255,0.06);
}
.dropdown-trigger #nav-username {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}
.dropdown-trigger .ph-caret-down {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.25s;
}
.user-dropdown.open .ph-caret-down {
    transform: rotate(180deg);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    animation: dropIn 0.15s ease;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.user-dropdown.open .dropdown-content {
    display: block;
}

.dropdown-info {
    padding: 10px 12px 12px;
}
.token-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--accent-emerald);
    font-weight: 600;
}

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

.dropdown-btn {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.dropdown-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}
.dropdown-btn.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Phone & OTP Specific */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}
.country-code {
    padding: 0 12px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-weight: 600;
    border-right: 1px solid var(--border-light);
    height: 100%;
    display: flex;
    align-items: center;
}
.phone-input-wrapper input {
    border: none;
    background: transparent;
}
.phone-input-wrapper input:focus {
    box-shadow: none;
}

.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 1.5rem 0;
}
.otp-box {
    width: 42px;
    height: 54px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
}

.resend-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}
.link {
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
}

/* App Views Container */
#app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
    position: relative;
}
.view {
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
}
.view.active { display: block; }

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

/* Landing specific */
.hero {
    text-align: center;
    padding: 6rem 0;
}
.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}
.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 30px;
    color: #60a5fa;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-light);
}
.stat-card p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Forms & Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}
.form-container {
    max-width: 500px;
    margin: 2rem auto;
}
.form-header { text-align: center; margin-bottom: 2rem; }
.form-header p { color: var(--text-muted); margin-top: 5px; }

.input-group { margin-bottom: 1.5rem; text-align: left; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
input, select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
select option { background: var(--bg-main); }

/* Dashboard Specific */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
}
.greeting { color: var(--text-muted); font-weight: 300; font-size: 1.5rem; }
#dash-name { color: white; font-weight: 600; }
.dashboard-header p { color: var(--text-muted); margin-top: 5px; }

.filter-dropdown {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0 16px;
}
.filter-dropdown i { color: var(--text-muted); }
.filter-dropdown select { border: none; background: transparent; padding-left: 8px; }
.filter-dropdown select:focus { box-shadow: none; }

/* Leads List (1 per row) */
.leads-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 2rem;
    align-items: center;
}

.lead-info-section {
    display: flex;
    flex-direction: column;
}

.lead-action-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    border-left: 1px solid var(--border-light);
    padding-left: 2rem;
}
.lead-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.lead-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.lead-badge.hot {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
.lead-time { color: var(--text-muted); font-size: 0.8rem; }

.lead-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.3;}
.lead-budget { font-size: 1.4rem; color: var(--accent-emerald); font-weight: 700; margin-bottom: 1rem; }

.lead-details {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}
.detail-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.9rem; }
.detail-item i { color: white; }

.lead-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 0;
}
.lead-cost { display: flex; align-items: center; gap: 4px; font-weight: 600; color: #fbbf24; }
.btn-buy {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-light);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-buy:hover { background: white; color: black; }

/* Purchased State */
.lead-card.purchased {
    border-color: var(--accent-emerald);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-card) 100%);
}
.contact-info {
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.contact-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.contact-row i { color: var(--accent-emerald); }

/* Recharge UI Styles */
.recharge-options {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.rs-chip {
    flex: 1;
    padding: 12px 8px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.95rem;
}

.rs-chip:hover {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
    color: white;
}

.rs-chip.selected {
    background: var(--primary);
    color: var(--dark-bg);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

#custom-recharge-amt {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 14px;
}
/* Footer Styles */
.app-footer {
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid var(--border-light);
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
}
.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}
.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}
.footer-links {
    display: flex;
    gap: 4rem;
}
.footer-col h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: var(--primary);
}
.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; flex-direction: column; gap: 2rem; }
    .hero-cta { flex-direction: column; align-items: center; }
    .hero-cta .btn { width: 80%; }
}
