/**
 * ===================================
 * CitadelVest Pro - New Dashboard Design
 * File: public/css/new-dashboard.css
 * The modern, clean dashboard layout
 * ===================================
 */

/* Additional CSS Variables for New Design */
:root {
    /* --primary and --primary-dark are defined in brand.css — DO NOT redeclare here */
    /* --secondary bridges brand.css naming to this file's var(--secondary) usages */
    --secondary: var(--primary-dark);
    --success: #4CAF50;
    --danger: #f44336;
    --warning: #FF9800;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #333;
    --text-muted: #666;
}

[data-brand] { visibility: hidden; }

/* Navigation - New Design */
nav.modern-nav {
    background: var(--card-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;           /* Task 1 fix: let active ::after underline show */
}

nav.modern-nav .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;          /* Task 3 fix: breathing room for logo & links */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav.modern-nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;          /* Task 2: explicit size — never changes on active */
    transition: color 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;        /* Task 2: same padding active & inactive */
    border-radius: 10px;
    position: relative;          /* Task 1: required for ::after underline */
}

.nav-links a:hover {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

/* Task 1 & 2: active state — identical size/spacing to base, just colour+bg change */
.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;          /* Task 2: same as non-active, no jump */
    background: rgba(102, 126, 234, 0.08);
    padding: 0.5rem 1rem;        /* Task 2: same padding, no layout shift */
    position: relative;
}

/* Task 1: active underline — works for ALL nav links including Markets */
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* User Profile in Nav */
.nav-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: 0.3s;
}

.nav-profile:hover {
    background: #f5f5f5;
}

.nav-profile-photo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

/* Main Dashboard Layout */
.dashboard {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Hero Section - Portfolio Overview */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    padding: 3rem;
    color: white;
    margin-bottom: 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.portfolio-value {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.total-value {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.value-change {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.quick-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    font-size: 1rem;
}

.quick-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.quick-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Balance Cards */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.balance-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.balance-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.balance-change {
    font-size: 0.85rem;
    color: var(--success);
}

/* Live Chart Section */
.chart-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.timeframe-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeframe-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 500;
}

.timeframe-btn:hover {
    border-color: var(--primary);
}

.timeframe-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#miniChart {
    height: 300px;
    width: 100%;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Market Overview */
.market-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.coin-card {
    padding: 1rem;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    transition: 0.3s;
}

.coin-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.coin-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coin-price {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.coin-change {
    font-size: 0.85rem;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .balance-grid,
    .stats-grid,
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 0 1rem;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .balance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .balance-grid .balance-card:first-child {
        grid-column: 1 / -1;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .total-value {
        font-size: 2.5rem;
    }

    .hero {
        padding: 2rem;
    }

    .chart-section {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 1.3rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .stat-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .total-value {
        font-size: 2rem;
    }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}


/**
 * ===================================
 * MOBILE NAVIGATION - THEME FIX
 * REPLACE the mobile nav section in new-dashboard.css with this
 * Fixes: Mobile menu now respects light/dark theme
 * ===================================
 */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

.mobile-menu-btn.active .material-icons-sharp {
    transform: rotate(90deg);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    /* Show hamburger button on mobile */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        order: -1;
    }
    
    /* Navigation container adjustments */
    nav.modern-nav .container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Logo in center on mobile */
    nav.modern-nav .logo {
        flex: 1;
        text-align: center;
        order: 0;
    }
    
    /* Nav-right on the right side */
    nav.modern-nav .nav-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        order: 1;
    }
    
    /* KEEP notification bell and dark mode toggle visible on mobile */
    .nav-right .notification-bell {
        display: flex !important;
    }
    
    .nav-right .dark-mode-toggle-btn {
        display: flex !important;
    }
    
    /* Hide profile name on mobile, keep photo */
    .nav-profile-btn .profile-name {
        display: none;
    }
    
    .nav-profile-btn {
        padding: 0.5rem;
    }
    
    /* Hide main nav links by default on mobile */
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        /* LIGHT THEME BACKGROUND */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        z-index: 1000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        padding: 2rem;
        opacity: 0;
        transform: translateY(-100%);
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    /* Show mobile menu when active */
    .nav-links.mobile-menu-active {
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Mobile nav links styling - LIGHT THEME */
    .nav-links a {
        color: #333 !important;
        font-size: 1.3rem;
        padding: 1rem 2rem;
        border-radius: 12px;
        width: 100%;
        max-width: 300px;
        text-align: center;
        background: rgba(0, 0, 0, 0.03);
        border: 1px solid rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
    }
    
    .nav-links a:hover {
        background: rgba(0, 0, 0, 0.08);
        transform: translateX(10px);
    }
    
    .nav-links a.active {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white !important;
        font-weight: 600;
        border-color: transparent;
    }
    
    .nav-links a .material-icons-sharp {
        font-size: 1.5rem;
        color: inherit !important;
    }
}

/* DARK THEME - Mobile menu */
.dark-theme .nav-links {
    background: rgba(15, 15, 30, 0.98) !important;
    backdrop-filter: blur(10px);
}

.dark-theme .nav-links a {
    color: #e8e8f0 !important;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .nav-links a.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
}

.dark-theme .mobile-menu-btn {
    color: #e8e8f0;
}

/* Small mobile screens */
@media (max-width: 480px) {
    .nav-links a {
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
    }
    
    nav.modern-nav .logo {
        font-size: 1.1rem;
    }
    
    .nav-right {
        gap: 0.3rem;
    }
}

/* Tablet size - show regular nav */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-links {
        display: flex !important;
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .nav-links a.active {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .nav-links a .material-icons-sharp {
        font-size: 1.2rem;
    }
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Force deposit modal hidden on page load */
#depositClaimModal {
    display: none;
}









/* ── Coming Soon Balance Cards ──────────────────── */
        .balance-card--coming-soon {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            opacity: 0.72;
            cursor: default;
            overflow: hidden;
        }
        .balance-card--coming-soon::before {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                45deg,
                transparent,
                transparent 6px,
                rgba(128,128,128,0.04) 6px,
                rgba(128,128,128,0.04) 12px
            );
            pointer-events: none;
        }
        .balance-card--coming-soon h3 {
            margin-bottom: 0.5rem;
        }
        .coming-soon-lock {
            font-size: 2rem;
            margin-bottom: 0.4rem;
            line-height: 1;
        }
        .coming-soon-label {
            font-size: 0.8rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            color: var(--text-muted, #888);
            text-transform: uppercase;
        }
        @media (max-width: 480px) {
            .coming-soon-lock { font-size: 1.6rem; }
            .coming-soon-label { font-size: 0.72rem; }
        }


/* Fix iOS auto-zoom on input focus */
input, select, textarea {
font-size: 16px !important;
}




/* Market section header: align heading left, link right on same line */
.market-section {
    position: relative;
}

.market-section h2 {
    display: inline-block;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.market-section > a {
    float: right;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    text-decoration: none;
}

.market-section > a:hover {
    text-decoration: underline;
}

/* Clearfix to prevent layout issues */
.market-section::after {
    content: "";
    display: table;
    clear: both;
}

/* Mobile: stack vertically if screen too narrow */
@media (max-width: 640px) {
    .market-section h2 {
        display: block;
        margin-bottom: 8px;
    }
    .market-section > a {
        float: none;
        display: inline-block;
        margin-bottom: 12px;
    }
}