/* ===================================================================
 * ALPHA AI TRADING - REDESIGNED DASHBOARD STYLES v3 (FIXED)
 * =================================================================== */
:root {
    --primary-blue: #4361ee;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease-in-out;
}

.dashboard-content {
    padding: 2rem;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-blue), #3a56d1);
    color: white; padding: 2rem; border-radius: 16px; display: flex;
    justify-content: space-between; align-items: center; margin-bottom: 2rem;
    box-shadow: var(--shadow);
}
.welcome-banner h2 { font-size: 1.75rem; margin: 0 0 0.5rem 0; }
.welcome-banner .username { font-weight: 700; }
.welcome-banner p { margin: 0; opacity: 0.8; }
.btn.btn-primary {
    background-color: white; color: var(--primary-blue); font-weight: 600;
    padding: 0.75rem 1.5rem; border-radius: 8px; text-decoration: none;
    transition: var(--transition);
}
.btn.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.btn i { margin-right: 0.5rem; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background-color: white; border-radius: 12px; padding: 1.5rem;
    display: flex; align-items: center; gap: 1.5rem; box-shadow: var(--shadow);
    transition: var(--transition); animation: popIn 0.5s ease-out forwards;
    opacity: 0;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }
.stat-card:nth-child(6) { animation-delay: 0.6s; }

.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.card-icon-wrapper {
    width: 50px; height: 50px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.25rem;
    color: white; flex-shrink: 0;
}
.icon-wallet { background: linear-gradient(45deg, #2563eb, #3b82f6); }
.icon-total-pl { background: linear-gradient(45deg, #059669, #10b981); }
.icon-bots { background: linear-gradient(45deg, #7c3aed, #8b5cf6); }
.icon-referrals { background: linear-gradient(45deg, #db2777, #e11d48); }
.icon-earnings { background: linear-gradient(45deg, #d97706, #f59e0b); }

.card-title { font-size: 0.9rem; color: var(--text-light); margin-bottom: 0.25rem; }
.card-value { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; }
.action-card { padding: 0; }
.action-card .action-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%; text-decoration: none; color: var(--primary-blue);
    font-weight: 600;
}
.action-card .action-link i { font-size: 2rem; margin-bottom: 0.5rem; }

/* Main Grid */
.main-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.content-panel { background-color: white; border-radius: 16px; box-shadow: var(--shadow); padding: 1.5rem; }
.panel-header { margin-bottom: 1.5rem; }
.panel-header h3 { font-size: 1.25rem; color: var(--text-dark); margin: 0; }
.panel-header span { font-size: 0.9rem; color: var(--text-light); }

/*
 * ==== THE FIX IS HERE ====
 */

/* 1. Remove the universal fixed height */
.panel-body {
    /* height: 320px; <-- This line is removed */
}

/* 2. Apply the fixed height ONLY to the chart panel's body */
.chart-panel .panel-body {
    height: 320px;
}

/* 3. Style the referral panel's body to center its content vertically */
.referral-panel .panel-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
/*
 * ==== END OF FIX ====
 */

#balanceHistoryChart { max-height: 100%; }

/* Referral Panel Content */
.referral-link-wrapper { display: flex; width: 100%; margin-top: 1rem; }
.referral-link-wrapper .form-control {
    flex-grow: 1; padding: 0.75rem 1rem; border: 1px solid var(--border-color);
    background-color: var(--bg-light); border-radius: 8px 0 0 8px;
    outline: none; font-size: 0.9rem;
}
.referral-link-wrapper .btn-copy {
    padding: 0.75rem 1.5rem; border: 1px solid var(--border-color); border-left: none;
    background-color: #e9ecef; color: var(--text-light);
    border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600;
    transition: background-color 0.2s;
}
.btn-copy:hover { background-color: #dbeafe; }
.btn-copy.copied {
    background-color: var(--success-green);
    color: white;
    border-color: var(--success-green);
}

/* Responsive */
@media(max-width: 1200px) { .main-grid { grid-template-columns: 1fr; } }

/* --- Live Activity Feed Styles for Dashboard --- */

.activity-ticker {
    background: linear-gradient(to right, #3a86ff, #8338ec);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    height: 200px; /* You can adjust this height */
}

.ticker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.ticker-header i.fa-sync-alt {
    animation: spin 4s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.ticker-content {
    position: relative;
    height: calc(100% - 46px); /* Adjust based on header height */
    overflow: hidden;
}

.ticker-item {
    display: flex;
    align-items: center;
    padding: 12px 5px;
    position: absolute;
    width: 100%;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    text-align: center;
    line-height: 28px;
    margin-right: 12px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

