/* ============================================================
   AMBASSADOR PORTAL — CSS
   Extends the existing design system (style.css)
   ============================================================ */

/* ── Landing Hero ── */
.amb-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
    position: relative;
    overflow: hidden;
}

.amb-hero-content {
    max-width: 650px;
    text-align: center;
    z-index: 2;
    animation: fadeUp 0.8s ease both;
}

.amb-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary-color);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 25px;
    animation: pulse-badge 3s infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

.amb-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.amb-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.amb-hero-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Floating stat cards on hero */
.hero-float-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 60px;
}

.hero-float-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 28px;
    text-align: center;
    min-width: 140px;
    animation: floatCard 4s ease-in-out infinite alternate;
    transition: transform 0.3s ease;
}

.hero-float-card:nth-child(2) { animation-delay: 0.7s; }
.hero-float-card:nth-child(3) { animation-delay: 1.4s; }
.hero-float-card:nth-child(4) { animation-delay: 2.1s; }

.hero-float-card:hover { transform: translateY(-8px) scale(1.04); }

@keyframes floatCard {
    from { transform: translateY(0px); }
    to   { transform: translateY(-12px); }
}

.hero-float-card .hfc-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    margin-bottom: 4px;
}

.hero-float-card .hfc-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Form Sections (Apply / Login) ── */
.amb-section {
    display: none;
    max-width: 600px;
    margin: 0 auto;
    padding: 100px 20px 80px;
    animation: fadeUp 0.5s ease both;
}

.amb-section.active { display: block; }

.amb-form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
}

.amb-form-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.amb-form-card p.sub {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.amb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.amb-form-grid .full { grid-column: 1 / -1; }

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 12px 15px;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    width: 100%;
}

.dark-theme .form-field input,
.dark-theme .form-field select,
.dark-theme .form-field textarea {
    background: rgba(255,255,255,0.05);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-field textarea { resize: vertical; min-height: 90px; }

.form-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: none;
}

.form-status.success { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.form-status.error   { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* ── Dashboard Layout ── */
.amb-dashboard {
    display: none;
    min-height: 100vh;
    padding-top: 80px;
}

.amb-dashboard.active { display: flex; }

.amb-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.amb-sidebar-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin: 0 auto 10px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.amb-sidebar-name {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
}

.amb-sidebar-id {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.amb-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 auto;
}

.amb-status-badge.active-status { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.amb-status-badge.disabled-status { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

.amb-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(37, 99, 235, 0.04);
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 10px;
    font-size: 0.85rem;
}

.amb-info-row span:first-child { color: var(--text-secondary); }
.amb-info-row span:last-child { font-weight: 600; color: var(--text-primary); }

.amb-ref-code-box {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}

.amb-ref-code-box .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.amb-ref-code-box .code {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--primary-color);
    font-family: monospace;
}

/* ── Dashboard Main ── */
.amb-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.amb-main-header {
    margin-bottom: 30px;
}

.amb-main-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.amb-main-header p { color: var(--text-secondary); }

/* Analytics Cards Grid */
.amb-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.amb-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.amb-stat-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.07;
}

.amb-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
}

.amb-stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.amb-stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.amb-stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Referral Share Box */
.amb-share-box {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
}

.amb-share-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.amb-link-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.amb-link-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-btn:hover { transform: translateY(-2px); }

.share-btn.copy    { background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.25); color: var(--primary-color); }
.share-btn.wa      { background: rgba(37,211,102,0.1); border-color: rgba(37,211,102,0.3); color: #25d366; }
.share-btn.tg      { background: rgba(0,136,204,0.1); border-color: rgba(0,136,204,0.3); color: #0088cc; }
.share-btn.li      { background: rgba(0,119,181,0.1); border-color: rgba(0,119,181,0.3); color: #0077b5; }

/* Referral Table */
.amb-table-box {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
}

.amb-table-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.amb-table-wrapper { overflow-x: auto; }

.amb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.amb-table th {
    padding: 12px 14px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
}

.amb-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
    color: var(--text-primary);
}

.dark-theme .amb-table td { border-bottom-color: rgba(255,255,255,0.05); }

.amb-table tr:hover td { background: rgba(37, 99, 235, 0.03); }

.amb-table tr:last-child td { border-bottom: none; }

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-pill.paid { background: rgba(16,185,129,0.12); color: #10b981; }
.status-pill.pending { background: rgba(245,158,11,0.12); color: #f59e0b; }

/* ── Toast Notification ── */
.amb-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.amb-toast.show { transform: translateY(0); opacity: 1; }

/* ── Back Link ── */
.amb-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 25px;
    transition: color 0.2s;
}

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

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .amb-hero h1 {
        font-size: 2.2rem !important;
    }
    
    .amb-hero p {
        font-size: 1rem !important;
        margin-bottom: 25px !important;
    }

    .amb-dashboard.active { flex-direction: column; }

    .amb-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .amb-form-grid { grid-template-columns: 1fr; }

    .amb-stats-grid { grid-template-columns: repeat(2, 1fr); }

    .amb-main { padding: 20px 15px; }

    .hero-float-cards { gap: 12px; }

    .hero-float-card { min-width: 100px; padding: 15px 18px; }
}

@media (max-width: 480px) {
    .amb-stats-grid { grid-template-columns: 1fr !important; }
    .amb-link-row { flex-direction: column; }
    .share-btns { justify-content: center; }
    .amb-form-card { padding: 20px !important; }
    
    .hero-float-cards {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-top: 40px !important;
    }
    .hero-float-card {
        min-width: auto !important;
        padding: 12px !important;
    }
    .hero-float-card .hfc-value {
        font-size: 1.4rem !important;
    }
    .hero-float-card .hfc-label {
        font-size: 0.72rem !important;
    }
}
