@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00A3FF;
    --primary-dark: #0066CC;
    --sidebar-bg: #FFFFFF;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 70px;
    --body-bg: #F8F9FA;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Premium Dark Theme Tokens */
    --bg-dark-deep: #0f172a;
    --bg-dark-surface: #1e293b;
    --border-dark: #334155;
}

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

.btn-primary-premium {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
}

.btn-primary-premium:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-2px);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

a {
    text-decoration: none !important;
}

/* Sidebar Styling - FORCE PREMIUM LOOK */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    border-right: 1px solid #E5E7EB;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

#sidebar .sidebar-header {
    padding: 20px 25px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
}

#sidebar ul.components {
    padding: 10px 0;
}

/* Force premium appearance for sidebar links */
#sidebar ul.components li.nav-item a {
    padding: 14px 25px !important;
    font-size: 0.95rem;
    display: flex !important;
    align-items: center;
    color: #4B5563 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

#sidebar ul.components li.nav-item a:hover,
#sidebar ul.components li.nav-item.active a {
    color: var(--primary-color) !important;
    background: rgba(0, 163, 255, 0.07) !important;
    border-left-color: var(--primary-color) !important;
    text-decoration: none !important;
}

#sidebar ul.components li.nav-item a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: inherit;
}

/* Premium Dashboard Card */
.premium-balance-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    border-radius: 24px !important;
    padding: 35px 30px !important;
    color: white !important;
    position: relative !important;
    overflow: hidden !important;
    margin-bottom: 30px;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0, 163, 255, 0.2);
}

.premium-balance-card::before,
.premium-balance-card::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.premium-balance-card::before {
    width: 200px;
    height: 200px;
    top: -100px;
    right: -50px;
}

.premium-balance-card::after {
    width: 150px;
    height: 150px;
    bottom: -80px;
    left: -40px;
}

.premium-balance-card .balance-value {
    font-size: 3rem !important;
    font-weight: 800 !important;
    margin: 5px 0 10px;
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: nowrap;
}

.card-action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white !important;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.card-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.today-sales-box {
    text-align: right;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.today-sales-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 2px;
    display: block;
}

.today-sales-value {
    font-size: 1.3rem;
    font-weight: 800;
}

/* Content Area */
#content {
    width: 100%;
    padding-left: var(--sidebar-width);
    transition: var(--transition);
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 900;
}

/* Grids & Banners */
.quick-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.quick-icon-wrapper {
    width: 65px;
    height: 65px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.4rem;
}

.join-banner {
    background: #25D366;
    color: white;
    border-radius: 20px;
    padding: 22px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.chart-card {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}

/* Auth Section */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 32px;
    padding: 60px 45px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 40px 80px rgba(0, 72, 144, 0.2);
}

.auth-header h2 {
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    margin-bottom: 35px;
}

.btn-primary-premium {
    background: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.btn-primary-premium:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 163, 255, 0.3);
}

/* Password Toggle */
.password-field-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9CA3AF;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        padding-left: 0 !important;
    }

    .topbar {
        padding: 0 20px;
    }

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

    .today-sales-box {
        text-align: left;
    }

    /* Sidebar Overlay & Blur */
    .sidebar-overlay {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: 998;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        transition: var(--transition);
    }

    .sidebar-overlay.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    #sidebarCloseMobile {
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f3f4f6;
        transition: var(--transition);
    }

    #sidebarCloseMobile:hover {
        background: #e5e7eb;
        transform: rotate(90deg);
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}

/* Landing Page (Portal) Styles */
.portal-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.portal-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 70px 50px;
    width: 100%;
    max-width: 580px;
    text-align: center;
    box-shadow: 0 30px 60px -12px rgba(0, 72, 144, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.portal-branding .portal-logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.portal-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.portal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.portal-btn {
    padding: 16px 30px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none !important;
}

.portal-btn-primary {
    background: var(--primary-color);
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(0, 163, 255, 0.3);
}

.portal-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 163, 255, 0.4);
}

.portal-btn-secondary {
    background: white;
    color: var(--text-primary) !important;
    border: 1px solid #E5E7EB;
}

.portal-btn-secondary:hover {
    background: #F9FAFB;
    transform: translateY(-2px);
}

.portal-btn-whatsapp {
    background: #25D366;
    color: white !important;
}

.portal-btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.portal-footer {
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animations */
.animate__animated.animate__zoomIn {
    --animate-duration: 0.8s;
}

/* Network Specific Branding */
.bg-mtn {
    background-color: #FFCC00 !important;
    color: #000 !important;
}

.bg-telecel {
    background-color: #E60000 !important;
    color: #fff !important;
}

.bg-at {
    background-color: #00A3FF !important;
    color: #fff !important;
}

/* Plan Matrix Styles */
.plan-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.plan-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid #f1f5f9;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.plan-card .network-badge {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.plan-card .plan-size {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.plan-card .plan-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 1.25rem;
    display: block;
}

.plan-card .btn-buy {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    background: #1e293b;
    color: #fff;
    border: none;
    transition: var(--transition);
}

.plan-card:hover .btn-buy {
    background: var(--success);
    color: white;
}

/* Glassmorphism Balance Badge */
.balance-badge-premium {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--success);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Mobile-First Purchase Page */
.plan-grid-mobile {
    padding-bottom: 30px;
}

.plan-card-premium {
    background: white;
    border-radius: 20px;
    padding: 15px 10px;
    text-align: center;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.plan-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.network-icon-box {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-weight: 800;
    font-size: 0.7rem;
    color: white;
}

.bg-mtn {
    background: #FFCC00;
    color: #000;
}

.bg-telecel {
    background: #E60000;
}

.bg-at {
    background: #00A3FF;
}

.plan-size-large {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.plan-price-large {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.btn-buy-now {
    width: 100%;
    background: #22c55e;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 100px;
    font-weight: 800;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.back-btn-pill {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #f1f5f9;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.balance-pill-green {
    background: #f0fdf4;
    color: #16a34a;
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dcfce7;
}

.bulk-btn-premium {
    background: #f8fafc;
    color: #64748b;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.grayscale {
    filter: grayscale(1);
}