/* ============================================================
   TRADELOG — CLEAN SAAS THEME (INDIGO + WHITE)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..700;1,9..40,400..700&display=swap');

:root {
    --accent:           #4f46e5;
    --accent-hover:     #4338ca;
    --accent-light:     #eef2ff;
    --accent-border:    #c7d2fe;
    --bg-page:          #f5f7fc;
    --bg-card:          #ffffff;
    --bg-surface:       #f8f9fd;
    --border:           #e8ecf4;
    --border-strong:    #d4d9e8;
    --text-primary:     #0f1b3d;
    --text-secondary:   #5a6a8a;
    --text-muted:       #9aaabb;
    --success:          #059669;
    --success-light:    #ecfdf5;
    --success-border:   #a7f3d0;
    --danger:           #dc2626;
    --danger-light:     #fef2f2;
    --danger-border:    #fecaca;
    --open-color:       #1d4ed8;
    --open-light:       #eff6ff;
    --open-border:      #bfdbfe;
    --breakeven-color:  #d97706;
    --breakeven-light:  #fffbeb;
    --breakeven-border: #fde68a;
    --radius-card:      16px;
    --radius-input:     9px;
    --radius-badge:     20px;
    --radius-btn:       9px;
    --shadow-card:      0 1px 4px rgba(15,27,61,.06), 0 4px 16px rgba(15,27,61,.05);
    --shadow-modal:     0 8px 40px rgba(15,27,61,.16), 0 2px 8px rgba(15,27,61,.08);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding: 1.5rem 1rem;
}

.container {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    max-width: 860px;
    margin: 0 auto;
    overflow: hidden;
}

h2 { font-size: 18px; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.02em; }

/* NAVIGATION */
.nav {
    display: flex;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav button {
    padding: 1rem 1.1rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    font-family: 'DM Sans', sans-serif;
}
.nav button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.section { display: none; padding: 1.5rem; }
.section.active { display: block; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { margin-bottom: 1.2rem; }

label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    outline: none;
    transition: all 0.18s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.image-paste-zone {
    border: 2px dashed var(--accent-border);
    border-radius: 12px;
    background: var(--accent-light);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s;
    color: var(--text-secondary);
    font-size: 13px;
}
.image-paste-zone:hover { border-color: var(--accent); background: #e8eaf6; }
.image-paste-zone img { max-width: 100%; border-radius: 10px; margin-top: 10px; border: 1px solid var(--border); }

.btn-submit {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: #ffffff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: all 0.18s;
    margin-top: 1rem;
}
.btn-submit:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(79,70,229,0.25); }

/* TABLE */
.table-container { overflow-x: auto; margin-top: 10px; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
thead th {
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.14s; }
tbody tr:nth-child(even) { background: var(--bg-surface); }
tbody tr:hover { background: var(--accent-light); cursor: pointer; }
td { padding: 0.85rem 1rem; color: var(--text-primary); font-weight: 500; }
td strong { font-weight: 700; color: var(--text-primary); }

/* STATUS & PIPS */
.status-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: var(--radius-badge);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.status-Won { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.status-Lost { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.status-Open { background: var(--open-light); color: var(--open-color); border: 1px solid var(--open-border); }
.status-Breakeven { background: var(--breakeven-light); color: var(--breakeven-color); border: 1px solid var(--breakeven-border); }

.pip-positive { color: var(--success); font-weight: 700; }
.pip-negative { color: var(--danger); font-weight: 700; }
.duration-tag { font-size: 11.5px; color: var(--text-muted); background: var(--bg-surface); padding: 2px 9px; border-radius: var(--radius-badge); border: 1px solid var(--border); }

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15,27,61,0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 500px;
    position: relative;
    padding: 1.5rem;
}
.close-modal { position: absolute; top: 1rem; right: 1.2rem; cursor: pointer; font-size: 20px; color: var(--text-muted); font-weight: 700; }
.modal a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    text-decoration: none;
    margin-top: 10px;
}

@media (max-width: 640px) {
    body { padding: 0.5rem; }
    .container { border-radius: 12px; }
    .form-grid { grid-template-columns: 1fr; }
    .nav button { padding: 0.8rem 0.8rem; font-size: 12px; }
    .modal-content { border-radius: 16px 16px 0 0; position: fixed; bottom: 0; }
}

/* STATS ROW STYLES */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}
.stat-card label {
    margin-bottom: 4px;
    font-size: 10px;
}
.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

/* CHART STYLES */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    height: 300px;
    width: 100%;
}

/* Multi-image preview grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.preview-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
/* Ensure the zone can be focused for pasting */
.image-paste-zone:focus {
    border-color: var(--accent);
    background: var(--accent-light);
}

.wl-card {
    background: white;
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.wl-card h3 { margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.wl-card p { font-size: 13px; margin-bottom: 15px; }
.sentiment-Bullish { color: var(--success); }
.sentiment-Bearish { color: var(--danger); }
.sentiment-Neutral { color: var(--text-muted); }

.wl-actions { display: flex; gap: 8px; }
.wl-btn-void { flex: 1; background: var(--danger-light); color: var(--danger); border: none; padding: 8px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; }
.wl-btn-trade { flex: 1; background: var(--accent-light); color: var(--accent); border: none; padding: 8px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; }