/* ===== Benjir MLM - Custom Styles ===== */

body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
    50%      { box-shadow: 0 8px 30px rgba(13,110,253,0.35); }
}
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.animate-in { animation: fadeInUp .55s ease both; }
.animate-fade { animation: fadeIn .6s ease both; }

/* ---- Admin layout ---- */
.admin-body { background: #f0f4fb; min-height: 100vh; }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1e3a8a 0%, #312e81 45%, #4c1d95 100%);
    color: #fff;
}
.admin-main { min-width: 0; }
.sidebar-brand { font-size: 1.2rem; font-weight: 800; }
.admin-sidebar .nav-link {
    color: #d1d5ff;
    border-radius: 10px;
    padding: 10px 14px;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}
.admin-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: translateX(4px);
}
.admin-sidebar .nav-link.active {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.45);
}
.admin-sidebar .nav-link i { transition: transform .2s ease; }
.admin-sidebar .nav-link:hover i { transform: scale(1.2); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

/* Sidebar becomes a fixed column on desktop (lg+) */
@media (min-width: 992px) {
    .admin-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
    .admin-main { flex: 1; }
}

/* Force tables to scroll horizontally on small screens */
.table-responsive { -webkit-overflow-scrolling: touch; }
.card-body.p-0 { overflow-x: auto; }
.card .table { margin-bottom: 0; }

/* ---- Stat cards (colorful + animated) ---- */
.stat-card {
    border-radius: 18px;
    padding: 22px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transition: transform .25s ease, box-shadow .25s ease;
    cursor: pointer;
}
.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0,0,0,0.20);
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: translateX(-100%);
    animation: shimmer 3.2s ease-in-out infinite;
}
.stat-blue    { background: linear-gradient(135deg, #4facfe 0%, #00c6fb 100%); }
.stat-green   { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); }
.stat-purple  { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); }
.stat-orange  { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.stat-pink    { background: linear-gradient(135deg, #f472b6 0%, #db2777 100%); }
.stat-cyan    { background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%); }
.stat-icon {
    font-size: 2.3rem;
    background: rgba(255,255,255,0.22);
    width: 60px; height: 60px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-info { min-width: 0; }
.stat-info h3 { font-size: 1.75rem; font-weight: 800; margin: 0; line-height: 1.1; }
.stat-info span { font-size: 0.84rem; opacity: 0.95; }

/* ---- Pending action cards ---- */
.action-card {
    border-radius: 16px;
    border: none;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.action-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.12); }
.action-card .icon-bubble {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.action-card.warning .icon-bubble { background: #fef3c7; color: #d97706; }
.action-card.danger  .icon-bubble { background: #fee2e2; color: #dc2626; }
.action-card.info    .icon-bubble { background: #e0f2fe; color: #0284c7; }

/* ---- Cards / tables polish ---- */
.card { border: none; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-radius: 14px; }
.card-header { border-bottom: 1px solid #eef2f7; font-weight: 700; }

/* ---- Auth ---- */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card { border: none; border-radius: 16px; }

/* ---- Home ---- */
.home-body { background: #0f172a; }
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #123 50%, #0f172a 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.plan-card {
    background: #1a2332;
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    border-radius: 16px;
    transition: transform .2s, border-color .2s;
}
.plan-card:hover { transform: translateY(-4px); border-color: #0dcaf0; }
.plan-card .text-muted { color: #94a3b8 !important; }

/* ---- Binary tree ---- */
.tree-container { overflow-x: auto; padding: 20px 0; }
.tree-node { display: inline-flex; flex-direction: column; align-items: center; }
.tree-branches { display: flex; justify-content: center; gap: 30px; }
.tree-branch { display: flex; flex-direction: column; align-items: center; padding-top: 12px; position: relative; }
.tree-branch::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 2px; height: 12px;
    background: #cbd5e1;
}
.tree-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 130px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.tree-card.left { border-color: #198754; }
.tree-card.right { border-color: #0d6efd; }
.tree-card.empty {
    color: #94a3b8;
    border-style: dashed;
    background: #f8fafc;
}
.branch-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
}

/* ---- Tables ---- */
.table thead th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; }
