/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    /* Colors */
    --color-dark: #050505;
    --color-background: #0b0b0b;
    --color-card: #151515;
    --color-gold-primary: #d4af37;
    --color-text-light: #e6e6e6;
    --color-text-faded: #bbb;
    
    /* Stats Colors */
    --color-stat-gold: #d4af37;
    --color-stat-blue: #1e90ff; /* DodgerBlue */
    --color-stat-green: #3cb371; /* MediumSeaGreen */
    --color-stat-red: #dc143c; /* Crimson */
    
    /* Layout */
    --padding-main: 30px;
    --border-radius: 8px;
    --transition-fast: 0.3s ease;
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BASE */
body {
    font-family: 'Outfit', sans-serif;
    background: var(--color-background);
    color: var(--color-text-light);
    line-height: 1.6;
    min-height: 100vh;
}

h2 {
    color: var(--color-gold-primary);
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Helper Class */
.hidden {
    display: none !important;
}

/* Main CTA Button Style */
.cta {
    padding: 12px 24px;
    background: var(--color-gold-primary);
    color: var(--color-dark);
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.cta:hover {
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

.cta.secondary {
    background: transparent;
    color: var(--color-gold-primary);
    border: 1px solid var(--color-gold-primary);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.cta.secondary:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: none;
    transform: none;
}

.cta.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.error-message {
    color: var(--color-stat-red);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* =========================================
   2. LOGIN SCREEN
   ========================================= */

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #1a1a1a, #000);
}

.login-box {
    background: var(--color-card);
    padding: 40px 50px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    border-top: 4px solid var(--color-gold-primary);
    text-align: center;
}

.login-box .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 10px;
    margin-bottom: 25px;
}

.login-box .logo img {
    height: 35px;
    filter: drop-shadow(0 0 5px var(--color-gold-primary));
}

.login-box .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gold-primary);
}

.login-box h2 {
    color: var(--color-text-light);
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-faded);
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: #222;
    border: 1px solid #333;
    color: var(--color-text-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-gold-primary);
    box-shadow: 0 0 0 1px var(--color-gold-primary);
}

.login-box .cta {
    width: 100%;
    margin-top: 10px;
}

.login-note {
    font-size: 0.8rem;
    color: #555;
    margin-top: 25px;
}

/* =========================================
   3. DASHBOARD STRUCTURE
   ========================================= */

.dashboard-wrapper {
    background: var(--color-background);
}

/* Header (Sticky Nav) */
.header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px var(--padding-main);
    border-bottom: 1px solid #1f1f1f;
}

.header .logo {
    gap: 10px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header .logo img {
    height: 30px;
}

.header .logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gold-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-id-text {
    font-size: 0.9rem;
    color: var(--color-text-faded);
}

/* Main Content Layout */
.dashboard-content {
    padding: var(--padding-main);
    max-width: 1400px;
    margin: auto;
}

/* =========================================
   4. STATS OVERVIEW
   ========================================= */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--color-card);
    padding: 25px;
    border-radius: var(--border-radius);
    border-left: 5px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.stat-card h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-faded);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #777;
}

/* Specific Stat Card Colors */
.stat-card.gold { border-color: var(--color-stat-gold); }
.stat-card.gold .stat-value { color: var(--color-stat-gold); }

.stat-card.blue { border-color: var(--color-stat-blue); }
.stat-card.blue .stat-value { color: var(--color-stat-blue); }

.stat-card.green { border-color: var(--color-stat-green); }
.stat-card.green .stat-value { color: var(--color-stat-green); }

.stat-card.red { border-color: var(--color-stat-red); }
.stat-card.red .stat-value { color: var(--color-stat-red); }


/* =========================================
   5. CHARTS SECTION
   ========================================= */

.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

.chart-box {
    background: var(--color-card);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid #222;
}

.chart-box h3 {
    color: var(--color-text-light);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.chart-subtitle {
    color: var(--color-text-faded);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Chart Canvas Styling (Handled by Chart.js, but ensures container fits) */
#growthChart, #allocationChart {
    max-height: 350px;
    width: 100% !important;
}

/* =========================================
   6. ACTIVE PLANS
   ========================================= */

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.plan-card {
    background: var(--color-card);
    border: 1px solid #222;
    padding: 25px;
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 150px; /* Adjust columns for detail */
    align-items: center;
    transition: box-shadow 0.3s ease;
}

.plan-card:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

.plan-header {
    background: #1f1f1f;
    padding: 15px 25px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 150px;
    color: var(--color-gold-primary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-gold-primary);
}

.plan-card > div {
    padding: 5px 10px;
}

.plan-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-light);
}

.plan-detail {
    font-size: 0.95rem;
    color: var(--color-text-faded);
}

.progress-bar-container {
    background: #222;
    border-radius: 5px;
    height: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background: var(--color-stat-green);
    transition: width 0.5s ease;
}

.status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-tag.active {
    background: var(--color-stat-blue);
    color: var(--color-dark);
}

.status-tag.complete {
    background: var(--color-gold-primary);
    color: var(--color-dark);
}

.status-tag.payout {
    background: var(--color-stat-red);
    color: var(--color-dark);
}

.withdrawal-btn {
    opacity: 0; /* Hidden initially */
    transition: opacity 0.3s ease;
}

.withdrawal-btn.ready {
    opacity: 1; /* Show when plan is complete */
}

/* =========================================
   7. NOTIFICATIONS
   ========================================= */

.notifications-section {
    margin-top: 40px;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification {
    background: var(--color-card);
    border-left: 4px solid;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification.alert {
    border-color: var(--color-stat-red);
}

.notification.info {
    border-color: var(--color-stat-blue);
}

.icon-alert, .icon-info {
    font-size: 1.2rem;
}

.notification p {
    flex-grow: 1;
    font-size: 0.95rem;
}

.notification-date {
    font-size: 0.75rem;
    color: #555;
    flex-shrink: 0;
}

/* =========================================
   8. MODAL STYLES (Withdrawal)
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-card);
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    border-top: 4px solid var(--color-gold-primary);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
}

.modal-content h3 {
    margin-top: 0;
    color: var(--color-text-light);
}

.modal-content p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: #777;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--color-gold-primary);
}

.withdrawal-details {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 4px;
}

.withdrawal-details .input-group input,
.withdrawal-details .input-group select {
    background: #222;
    border: 1px solid #333;
    padding: 10px;
    color: var(--color-text-light);
    border-radius: 4px;
    width: 100%;
}


/* =========================================
   9. MEDIA QUERIES
   ========================================= */

@media (max-width: 1024px) {
    .dashboard-content {
        padding: 20px;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .plan-header, .plan-card {
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 2rem;
    }

    .plan-header {
        display: none; /* Hide header on small screens */
    }

    .plan-card {
        grid-template-columns: 1fr; /* Stack columns */
        padding: 15px;
    }

    .plan-card > div {
        padding: 8px 0;
        border-bottom: 1px dotted #222;
    }

    .plan-card > div:last-child {
        border-bottom: none;
        padding-top: 15px;
    }
}