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

:root {
    --primary: #0052e0;
    --primary-grad: linear-gradient(135deg, #0066ff 0%, #0033cc 100%);
    --bg-main: #f5f8ff;
    --bg-card: #ffffff;
    --text-main: #1a202c;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 15px rgba(0, 50, 150, 0.06);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
    overflow-x: hidden;
}

/* Base Wrapper for layout */
.app-container {
    max-width: 480px; /* Mobile first, centered on desktop */
    margin: 0 auto;
    background-color: var(--bg-main);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
}

/* Header & Hamburger Menu */
.app-header {
    background: var(--primary-grad);
    padding: 20px 20px 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

.hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
}

/* Drawer / Sidebar Navigation */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 380px;
    height: 100%;
    background-color: var(--bg-card);
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    padding: 30px 20px;
    overflow-y: auto;
}

.sidebar-drawer.active {
    left: 0;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

.drawer-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-menu-list {
    list-style: none;
}

.drawer-menu-item {
    margin-bottom: 8px;
}

.drawer-menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.drawer-menu-link:hover, .drawer-menu-item.active .drawer-menu-link {
    background-color: #ebf4ff;
    color: var(--primary);
}

.drawer-menu-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* User Profile Banner */
.profile-banner {
    background: var(--primary-grad);
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    padding: 10px 24px 40px 24px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.profile-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.profile-avatar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 12px auto;
    border-radius: 50%;
    padding: 5px;
    background: rgba(255, 255, 255, 0.2);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: white;
}

.profile-username {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.profile-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 20px;
    margin-top: -25px; /* Overlap banner */
    position: relative;
    z-index: 10;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background-color: #ebf4ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #003db3;
}

.stat-currency {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* General Layout Card */
.content-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    margin: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
}

.card-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: #003db3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Weekly Earners list */
.earner-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.earner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #f7fafc;
}

.earner-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.earner-rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.earner-rank-badge.rank-1 { background-color: #fbd38d; color: #7b341e; }
.earner-rank-badge.rank-2 { background-color: #e2e8f0; color: #4a5568; }
.earner-rank-badge.rank-3 { background-color: #ed8936; color: #742a2a; }

.earner-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 10px;
    margin-right: 12px;
    background-color: #edf2f7;
}

.earner-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.earner-name {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2d3748;
}

.earner-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* Chart Container and layout */
.activity-box {
    display: flex;
    gap: 15px;
}

.activity-legend-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 110px;
}

.activity-legend-card {
    background-color: #f7fafc;
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-legend-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-muted);
}

.activity-legend-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.activity-chart-canvas-wrap {
    flex: 1;
    height: 160px;
    position: relative;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 65px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 990;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    padding: 8px 0;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Forms & UI Elements */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #fafbfc;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    background-color: white;
}

.btn-primary {
    display: block;
    width: 100%;
    background: var(--primary-grad);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,80,224,0.2);
    transition: transform 0.1s, opacity 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    opacity: 0.95;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-danger {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert-warning {
    background-color: #feebc8;
    color: #744210;
    border: 1px solid #fbd38d;
}

/* E-Commerce Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.product-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background-color: #f7fafc;
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-cat {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.product-prices {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.real-price {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.disc-price {
    font-size: 14px;
    font-weight: 700;
    color: #e53e3e;
}

.add-cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    text-align: center;
}

/* Cart Item List */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-details {
    flex: 1;
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badge list styles */
.badge-secondary {
    background-color: #edf2f7;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Grid Details List (for profiles, parameters) */
.details-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f7fafc;
}

.details-label {
    color: var(--text-muted);
    font-weight: 500;
}

.details-val {
    font-weight: 600;
    color: var(--text-main);
}

/* Floating Actions / Floating links */
.copy-link-box {
    display: flex;
    gap: 10px;
}

.copy-input {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
}

/* Admin Dashboard styles */
.admin-card-summary {
    background: #edf2f7;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 13px;
}

.admin-table th, .admin-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: #f7fafc;
    font-weight: 700;
}

/* Utilities */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.text-success { color: #38a169; }
.text-danger { color: #e53e3e; }
.text-warning { color: #dd6b20; }
.w-full { width: 100%; }

/* Navigation & Main Layout */
.top-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--primary-grad);
    color: white;
}
.top-nav-bar h1 {
    font-size: 18px;
    font-weight: 700;
}
.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}
.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
