/* RewardHub - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-base: #07070f;
    --bg-surface: #0f0f1a;
    --bg-card: #13131f;
    --bg-card2: #1a1a28;
    --border: #2a2a40;
    --border-light: #1e1e30;
    --primary: #6c3bff;
    --primary-light: #8a5fff;
    --accent: #ff3b8b;
    --accent2: #3bffd1;
    --text: #e8e8f0;
    --text-muted: #7878a0;
    --text-faint: #404060;
    --success: #3bffa0;
    --warning: #ffb83b;
    --danger: #ff4f4f;
    --info: #3bb5ff;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --glow: 0 0 24px rgba(108,59,255,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-base);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: 
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(108,59,255,0.15) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255,59,139,0.1) 0%, transparent 60%),
        var(--bg-base);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.5s ease;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.auth-title { font-size: 1.5rem; color: var(--text); margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px; }
.form-control {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,59,255,0.15);
}
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.input-group { position: relative; }
.input-group .form-control { padding-right: 48px; }
.input-group-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.2s;
}
.input-group-icon:hover { color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: var(--radius);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(108,59,255,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(108,59,255,0.5); color: #fff; }
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #ff6bab);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,59,139,0.3);
}
.btn-accent:hover { transform: translateY(-1px); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #000; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== ALERTS ===== */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
}
.alert-success { background: rgba(59,255,160,0.08); border-color: rgba(59,255,160,0.25); color: var(--success); }
.alert-danger { background: rgba(255,79,79,0.08); border-color: rgba(255,79,79,0.25); color: var(--danger); }
.alert-info { background: rgba(59,181,255,0.08); border-color: rgba(59,181,255,0.25); color: var(--info); }
.alert-warning { background: rgba(255,184,59,0.08); border-color: rgba(255,184,59,0.25); color: var(--warning); }

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-wrap { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text);
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-faint);
    text-transform: uppercase;
    padding: 8px 8px 6px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
    position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active {
    background: rgba(108,59,255,0.15);
    color: var(--primary-light);
    border: 1px solid rgba(108,59,255,0.2);
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}
.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 0.72rem; color: var(--text-faint); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.topbar-left h2 { font-size: 1.1rem; color: var(--text); }
.topbar-left p { font-size: 0.8rem; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.notif-btn {
    position: relative;
    width: 38px; height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 1.1rem;
}
.notif-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.page-content { flex: 1; padding: 28px; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: 1rem; font-weight: 700; font-family: 'Outfit', sans-serif; }
.card-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    transform: translate(30%, -30%);
    opacity: 0.12;
}
.stat-card.purple::before { background: var(--primary); }
.stat-card.pink::before { background: var(--accent); }
.stat-card.teal::before { background: var(--accent2); }
.stat-card.gold::before { background: var(--warning); }

.stat-label { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 800; font-family: 'Outfit', sans-serif; }
.stat-value.purple { color: var(--primary-light); }
.stat-value.pink { color: var(--accent); }
.stat-value.teal { color: var(--accent2); }
.stat-value.gold { color: var(--warning); }
.stat-icon { position: absolute; top: 18px; right: 18px; font-size: 1.4rem; opacity: 0.4; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: var(--bg-card2);
    border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border-light); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card2); }
tbody td { padding: 14px 16px; font-size: 0.9rem; color: var(--text-muted); vertical-align: middle; }
tbody td .cell-main { color: var(--text); font-weight: 500; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(59,255,160,0.1); color: var(--success); border: 1px solid rgba(59,255,160,0.2); }
.badge-danger { background: rgba(255,79,79,0.1); color: var(--danger); border: 1px solid rgba(255,79,79,0.2); }
.badge-warning { background: rgba(255,184,59,0.1); color: var(--warning); border: 1px solid rgba(255,184,59,0.2); }
.badge-info { background: rgba(59,181,255,0.1); color: var(--info); border: 1px solid rgba(59,181,255,0.2); }
.badge-purple { background: rgba(108,59,255,0.1); color: var(--primary-light); border: 1px solid rgba(108,59,255,0.2); }

/* ===== AVATAR ===== */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-md { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 1.8rem; }
.avatar-xl { width: 100px; height: 100px; font-size: 2rem; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.modal-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.2s;
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); }

/* ===== NOTIFICATIONS ===== */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
    transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(108,59,255,0.04); padding: 14px 10px; border-radius: var(--radius); }
.notif-icon-wrap {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.notif-icon-wrap.reward { background: rgba(255,184,59,0.12); color: var(--warning); }
.notif-icon-wrap.info { background: rgba(59,181,255,0.12); color: var(--info); }
.notif-icon-wrap.alert { background: rgba(255,79,79,0.12); color: var(--danger); }
.notif-icon-wrap.system { background: rgba(108,59,255,0.12); color: var(--primary-light); }
.notif-content { flex: 1; }
.notif-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.notif-msg { font-size: 0.82rem; color: var(--text-muted); }
.notif-time { font-size: 0.75rem; color: var(--text-faint); margin-top: 4px; }
.unread-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }

/* ===== REWARD CARD ===== */
.reward-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.reward-card:hover { transform: translateY(-2px); border-color: var(--border); }
.reward-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.2s;
}
.reward-card:hover::after { opacity: 1; }
.reward-icon {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, rgba(108,59,255,0.15), rgba(255,59,139,0.15));
    border: 1px solid rgba(108,59,255,0.2);
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.reward-info { flex: 1; }
.reward-name { font-weight: 700; font-family: 'Outfit', sans-serif; font-size: 0.95rem; }
.reward-txn { font-size: 0.75rem; color: var(--text-faint); margin-top: 3px; font-family: monospace; }
.reward-balance { text-align: right; }
.reward-amount { font-size: 1.3rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--warning); }
.reward-label { font-size: 0.72rem; color: var(--text-faint); }

/* ===== PROFILE ===== */
.profile-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
}
.profile-avatar-wrap {
    position: absolute;
    bottom: -40px;
    left: 28px;
}
.profile-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding-top: 0;
    overflow: visible;
    margin-bottom: 20px;
}
.profile-info-wrap { padding: 52px 28px 24px; }
.profile-name { font-size: 1.4rem; }
.profile-email { color: var(--text-muted); font-size: 0.9rem; margin-top: 2px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

/* ===== UTILITIES ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }

/* ===== MOBILE TOGGLE ===== */
.menu-toggle {
    display: none;
    width: 38px; height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in { animation: fadeIn 0.4s ease; }
.fade-up { animation: fadeUp 0.4s ease; }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border-light); margin: 20px 0; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-faint); font-size: 0.85rem; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

/* ===== SPINNER ===== */
.spinner { width: 20px; height: 20px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .auth-card { padding: 28px 20px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
