/* ==============================
   DASHBOARD CSS (Light / Blue)
   Login + all logged-in pages
================================ */

/* Base reset (safe) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #F5F8FF;
    color: #333333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================
   UNIVERSAL HEADER
   (same as public)
============================ */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    height: 75px;
    background: #ffffff;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0 60px;
    border-bottom: 1px solid #eaecef;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

header .logo {
    flex: 0 0 auto;
}

header .logo img {
    height: 42px;
    width: auto;
    display: block;
}

header nav {
    flex: 1 0 auto;
    display: flex;
    justify-content: flex-end;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 35px;
    align-items: center;
    margin: 0;
    padding: 0;
}

header nav ul li {
    list-style: none;
}

header nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.25s ease;
}

header nav a:hover {
    background: #f5f8ff;
    color: #005EB8;
}

header nav a.active {
    border: 2px solid #000;
    padding: 8px 16px;
    color: #000;
    border-radius: 10px;
}

/* ============================
   LAYOUT WRAPPER (dashboard pages)
============================ */

.container {
    max-width: 1200px;
    margin: 100px auto 30px; /* 100px to clear fixed header */
    padding: 20px;
}

/* ============================
   DASHBOARD HOME
============================ */

.welcome {
    margin-bottom: 25px;
}

.welcome h2 {
    color: #003087;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.welcome p {
    font-size: 0.95rem;
    color: #666666;
}

/* Overview cards */

.overview {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.portfolio-card,
.performance-card {
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #D6E6F6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 20px;
}

.portfolio-card h2,
.performance-card h2 {
    font-size: 1.3rem;
    color: #003087;
    margin-bottom: 10px;
}

.portfolio-card p,
.performance-card p {
    font-size: 0.95rem;
    color: #666666;
}

.portfolio-card canvas {
    max-height: 220px;
    margin-top: 10px;
}

/* Quick stats */

.quick-stats {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 180px;
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #D6E6F6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    padding: 15px 20px;
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    color: #003087;
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333333;
}

/* Assets table */

.assets-table {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #D6E6F6;
    margin-top: 10px;
}

.assets-table h2 {
    font-size: 1.3rem;
    color: #003087;
    margin-bottom: 15px;
}

.assets-table table {
    width: 100%;
    border-collapse: collapse;
}

.assets-table th,
.assets-table td {
    padding: 10px;
    text-align: left;
    font-size: 0.95rem;
}

.assets-table th {
    background: #E8F1FC;
    color: #003087;
    font-weight: 600;
}

.assets-table tr:nth-child(even) td {
    background: #F7F9FD;
}

/* Positive/Negative colours */

.positive {
    color: #00A859;
}

.negative {
    color: #D62828;
}

/* Recent activity (generic list) */

.recent-activity {
    margin-top: 30px;
    background: #FFFFFF;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #D6E6F6;
}

.recent-activity h2 {
    font-size: 1.3rem;
    color: #003087;
    margin-bottom: 10px;
}

.recent-activity ul {
    list-style: none;
}

.recent-activity li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #EEF2FA;
    font-size: 0.9rem;
}

.recent-activity li:last-child {
    border-bottom: none;
}

/* ============================
   RECENT CLOSED TRADES – LIGHT THEME
============================ */

.trades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.trade-item {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid #D6E6F6;
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: transparent;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.trade-item.profit {
    border-left-color: #00A859;
}

.trade-item.loss {
    border-left-color: #D62828;
}

.trade-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.trade-info {
    font-size: 0.95rem;
    color: #333333;
}

.trade-direction {
    font-weight: 600;
    color: #003087;
    font-size: 1.05rem;
}

.trade-prices {
    color: #666666;
    margin-top: 4px;
    font-size: 0.9rem;
}

.trade-pnl {
    text-align: right;
}

.pnl-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333333;
}

.pnl-percent {
    font-size: 0.9rem;
    opacity: 0.9;
    color: #666666;
}

/* ============================
   DEPOSIT / WITHDRAW / HISTORY
============================ */

.deposit-section,
.withdrawal-section,
.history-section {
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    background: #FFFFFF;
    border: 1px solid #D6E6F6;
}

.deposit-section h2,
.withdrawal-section h2,
.history-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #003087;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 5px;
}

.deposit-section select,
.deposit-section input,
.withdrawal-section select,
.withdrawal-section input {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    background-color: #EDEFF2;
    border: none;
    color: #333333;
    border-radius: 5px;
    font-size: 0.9rem;
}

.deposit-section button,
.withdrawal-section button {
    padding: 10px 20px;
    background-color: #005EB8;
    border: none;
    color: #FFFFFF;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.deposit-section button:hover,
.withdrawal-section button:hover {
    background-color: #004494;
    transform: translateY(-2px);
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 10px;
    text-align: left;
    color: #666666;
    font-size: 0.9rem;
}

.history-table th {
    color: #333333;
    font-weight: 600;
}

/* ============================
   TRADERS TABLE
============================ */

.traders-table {
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    background: #FFFFFF;
    border: 1px solid #D6E6F6;
}

.traders-table h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333333;
}

.traders-table table {
    width: 100%;
    border-collapse: collapse;
}

.traders-table th,
.traders-table td {
    padding: 10px;
    text-align: left;
    color: #666666;
    font-size: 0.9rem;
}

.traders-table th {
    color: #333333;
    font-weight: 600;
}

.trader-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    border: 1px solid #005EB8;
    padding: 2px;
}

.follow-btn,
.following-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.follow-btn {
    background-color: #005EB8;
    color: #FFFFFF;
}

.follow-btn:hover {
    background-color: #004494;
}

.following-btn {
    background-color: #EDEFF2;
    color: #333333;
}

.following-btn:hover {
    background-color: #DDE1E7;
}

/* ============================
   AUTH PAGES (login, register, 2FA, profile)
============================ */

body.auth-page {
    min-height: 100vh;
    display: block;
    padding-top: 120px;  /* pushes form below header */
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

.auth-container {
    background-color: #FFFFFF;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 400px;
    max-width: 90%;
    text-align: center;
    margin: 0 auto;
}

.auth-container h2 {
    font-size: 24px;
    color: #003087;
    margin-bottom: 20px;
}

.auth-container h3 {
    font-size: 1.5rem;
    color: #003087;
    margin-top: 20px;
    margin-bottom: 10px;
}

.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="text"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background-color: #EDEFF2;
    border: none;
    color: #333333;
    border-radius: 5px;
    font-size: 14px;
}

.auth-container button {
    width: 100%;
    padding: 10px;
    background-color: #005EB8;
    border: none;
    color: #FFFFFF;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-container button:hover {
    background-color: #004494;
}

.auth-container .error {
    color: #E53E3E;
    font-size: 14px;
    margin-top: 10px;
    min-height: 1em;
}

.auth-container p {
    margin-top: 20px;
    color: #666666;
    font-size: 14px;
}

.auth-container p a {
    color: #005EB8;
    text-decoration: none;
}

.auth-container p a:hover {
    text-decoration: underline;
}

/* Verify container */

.verify-container {
    padding: 30px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 120px auto 0;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.verify-container h2 {
    font-size: 24px;
    color: #003087;
    margin-bottom: 20px;
}

.verify-container p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #666666;
}

/* ============================
   FOOTER (logged-in pages)
============================ */

footer {
    margin-top: 40px;
    text-align: center;
    padding: 25px;
    background: #FFFFFF;
    color: #333333;
    font-size: 0.85rem;
    border-top: 1px solid #E3F2FD;
}

/* ============================
   RESPONSIVE
============================ */

@media (max-width: 768px) {

    header {
        padding: 0 20px;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    header nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        margin-top: 110px;
        padding: 15px;
    }

    .overview {
        grid-template-columns: 1fr;
    }

    .portfolio-card canvas {
        max-height: 150px;
    }

    .assets-table th,
    .assets-table td {
        font-size: 0.85rem;
    }

    .recent-activity li {
        flex-direction: column;
        gap: 5px;
    }

    .traders-table th,
    .traders-table td {
        font-size: 0.85rem;
        padding: 8px;
    }

    .auth-container {
        padding: 20px;
    }

    body.auth-page {
        padding-top: 140px;
    }
}
