:root {
    --bg-app: #f5f5f7;      /* Apple Grey Background */
    --bg-panel: #ffffff;    /* Pure White Panels */
    --bg-sidebar: #fbfbfd;  /* Slightly translucent sidebar */
    
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    
    --accent-blue: #0071e3;
    --accent-hover: #0077ED;
    
    --border-light: rgba(0,0,0,0.05);
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    
    --radius-app: 24px;
    --radius-widget: 20px;
}

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

body {
    font-family: -apple-system, 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; /* App-like feel */
}

/* ----------------------------------
   LAYOUT CONTAINER
   ---------------------------------- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

/* ----------------------------------
   SIDEBAR (macOS Style)
   ---------------------------------- */
.apple-sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

.sidebar-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
}

.brand-icon { font-size: 1.2rem; }

.menu-group { display: flex; flex-direction: column; gap: 4px; }
.mt-auto { margin-top: auto; }

.menu-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.nav-item:hover { background: rgba(0,0,0,0.03); color: var(--text-main); }

.nav-item.active {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-blue);
    font-weight: 600;
}

/* User Profile Mini */
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.user-card img { width: 36px; height: 36px; border-radius: 50%; }
.user-info { flex: 1; display: flex; flex-direction: column; }
.user-info strong { font-size: 0.85rem; }
.user-info span { font-size: 0.7rem; color: var(--text-muted); }
.arrow { font-size: 0.8rem; color: #ccc; }

/* ----------------------------------
   MAIN VIEW
   ---------------------------------- */
.main-view {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    height: 70px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 245, 247, 0.8); /* Glass effect */
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.breadcrumbs { font-size: 0.9rem; color: var(--text-muted); }
.breadcrumbs .current { color: var(--text-main); font-weight: 500; }

.actions { display: flex; gap: 15px; }

.btn-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-main);
    cursor: pointer;
}

.btn-primary-pill {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.content-wrapper {
    padding: 20px 40px 60px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-text { margin-bottom: 30px; }
.hero-text h1 { font-size: 1.8rem; margin-bottom: 5px; }
.hero-text p { color: var(--text-muted); }

/* ----------------------------------
   WIDGETS (iOS Style)
   ---------------------------------- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background: var(--bg-panel);
    padding: 20px;
    border-radius: var(--radius-widget);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    transition: transform 0.2s;
}

.widget:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.widget-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.widget-icon.blue { background: #e0f2fe; color: #0284c7; }
.widget-icon.green { background: #dcfce7; color: #16a34a; }
.widget-icon.purple { background: #f3e8ff; color: #9333ea; }
.widget-icon.orange { background: #ffedd5; color: #ea580c; }

.widget-data h3 { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 5px; }
.widget-data span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ----------------------------------
   SPLIT LAYOUT
   ---------------------------------- */
.split-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.panel {
    background: var(--bg-panel);
    border-radius: var(--radius-app);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.panel-header h2 { font-size: 1.1rem; }
.link-action { font-size: 0.85rem; color: var(--accent-blue); text-decoration: none; }

/* Mission Card Specifics */
.mission-container {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f9f9fb; /* Slight contrast within card */
    padding: 20px;
    border-radius: 20px;
}

.mission-icon {
    width: 60px; height: 60px;
    background: #20232a; /* React Dark */
    color: #61dafb;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}

.mission-details { flex: 1; }
.mission-details h3 { font-size: 1rem; margin-bottom: 4px; }
.mission-details p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }

.progress-wrapper { display: flex; align-items: center; gap: 10px; }
.progress-bar {
    flex: 1; height: 6px; background: #e0e0e0; border-radius: 10px; overflow: hidden;
}
.fill { height: 100%; background: var(--accent-blue); border-radius: 10px; }
.percentage { font-size: 0.8rem; font-weight: 600; color: var(--accent-blue); }

.btn-play {
    width: 44px; height: 44px;
    background: var(--text-main);
    color: white;
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.btn-play:hover { transform: scale(1.1); }

/* Feed List */
.feed-list { display: flex; flex-direction: column; gap: 15px; }
.feed-item { display: flex; gap: 12px; align-items: start; padding-bottom: 15px; border-bottom: 1px solid var(--border-light); }
.feed-item:last-child { border: none; padding-bottom: 0; }

.avatar {
    width: 32px; height: 32px;
    background: #eee; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600;
}
.avatar.small { background: #ffdede; color: #ff4d4d; }
.avatar.icon { background: #fff4d6; color: #fbbf24; }

.feed-text { font-size: 0.85rem; line-height: 1.4; flex: 1; }
.time { font-size: 0.75rem; color: var(--text-muted); }


/* VAULT CONTAINER */
.vault-section {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* THE WALLET (Big Counter) */
.star-wallet {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%); /* Gold Gradient */
    border-radius: 24px;
    padding: 30px 40px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.wallet-text span { font-weight: 600; opacity: 0.8; font-size: 0.9rem; text-transform: uppercase; }
.wallet-text h1 { font-size: 4rem; margin: 0; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.wallet-icon { font-size: 3rem; color: #fff; opacity: 0.5; }

/* GRID LAYOUT */
.vault-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.vault-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.card-header { margin-bottom: 24px; border-bottom: 1px solid #f0f0f0; padding-bottom: 16px; }
.card-header h3 { font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card-header p { font-size: 0.85rem; color: #86868b; }

/* TASK LIST (EARN) */
.task-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f7;
}

.task-info { display: flex; flex-direction: column; }
.task-title { font-weight: 600; font-size: 0.95rem; }
.task-sub { font-size: 0.75rem; color: #86868b; }

.task-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.reward-pill { font-size: 0.75rem; color: #28c840; font-weight: 700; background: #eaffef; padding: 2px 8px; border-radius: 4px; }

.btn-claim {
    background: #000;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-claim:hover { transform: scale(1.05); background: #333; }
.btn-claim.disabled { background: #f0f0f0; color: #999; cursor: not-allowed; transform: none; }

/* MARKET LIST (SPEND) */
.market-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f7;
}

.item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.item-icon.blue { background: #e8f2ff; color: #0071e3; }
.item-icon.purple { background: #f2e8ff; color: #af52de; }

.item-details h4 { font-size: 1rem; margin-bottom: 2px; }
.item-details p { font-size: 0.8rem; color: #666; margin-bottom: 8px; }

.price-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.cost { font-weight: 700; color: #FFC107; font-size: 0.9rem; }

.btn-buy {
    background: transparent;
    border: 1px solid #e5e5e5;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-buy:hover { border-color: #000; background: #000; color: #fff; }

/* UPSELL BOX */
.premium-upsell {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    align-items: center;
    justify-content: space-between;
}
.upsell-text strong { font-size: 0.85rem; display: block; }
.upsell-text p { font-size: 0.75rem; color: #666; margin: 0; }
.btn-tiny-dark { background: #000; color: #fff; font-size: 0.7rem; padding: 6px 12px; border-radius: 8px; text-decoration: none; }

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.toast.show { opacity: 1; bottom: 40px; }

@media (max-width: 768px) {
    .vault-grid { grid-template-columns: 1fr; }
    .wallet-text h1 { font-size: 3rem; }
}


/* user login */

/* === PROFILE MODAL STYLES === */

/* 1. The Background Overlay (Hidden by Default) */
.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark transparent bg */
    backdrop-filter: blur(5px);      /* Blur effect */
    z-index: 10000;                  /* Sit on top of everything */
    
    /* Flexbox to center the card */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Hiding Logic */
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

/* 2. The Active State (JS adds this class to show it) */
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* 3. The White Card Design */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 350px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px); /* Start slightly lower */
    transition: transform 0.3s ease;
}

/* Animate card up when active */
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Header & Stats Styling */
.modal-header img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 10px; }
.modal-header h2 { margin: 0; font-size: 1.4rem; }
.modal-header p { color: #888; font-size: 0.9rem; margin-top: 5px; }

.modal-stats-row { 
    display: flex; justify-content: space-around; 
    margin: 20px 0; padding: 15px; 
    background: #f5f5f7; border-radius: 12px; 
}
.stat { display: flex; flex-direction: column; }
.stat span { font-size: 0.8rem; color: #666; }

/* Buttons */
.close-icon {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #555;
}
.btn-logout {
    width: 100%; padding: 12px;
    background: #ffebee; color: #c62828;
    border: none; border-radius: 10px;
    font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-logout:hover { background: #ffcdd2; }

.link{
    text-decoration: none;
    color: white;
}