/* CryptoSignals - Clean White Theme */
:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1a202c;
    --muted: #718096;
    --green: #10b981;
    --red: #ef4444;
    --blue: #3b82f6;
    --yellow: #f59e0b;
    --purple: #8b5cf6;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

#app { min-height: 100vh; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--card);
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text);
}

.input-group { margin-bottom: 20px; }
.input-label { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 8px; display: block; }
.input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.btn {
    width: 100%;
    padding: 14px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: #2563eb; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }
.btn-red { background: var(--red); }
.btn-green { background: var(--green); }

.error-msg { color: var(--red); font-size: 13px; text-align: center; margin-top: 16px; }

/* Header */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo { font-weight: 700; font-size: 20px; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.sync-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.sync-btn:disabled { opacity: 0.5; }
.last-sync { font-size: 12px; color: var(--muted); }

/* Tabs */
.tabs {
    display: flex;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1;
    min-width: 70px;
    padding: 16px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Content */
.content { padding: 20px; max-width: 1200px; margin: 0 auto; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 32px; font-weight: 700; }
.card-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }

/* Positions */
.position { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.position:last-child { border-bottom: none; }
.pos-left { display: flex; align-items: center; gap: 14px; }
.pos-icon { width: 44px; height: 44px; background: linear-gradient(135deg, var(--blue), var(--purple)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.pos-coin { font-weight: 600; font-size: 16px; }
.pos-amount { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pos-right { text-align: right; }
.pos-value { font-weight: 600; font-size: 16px; }
.pos-pnl { font-size: 14px; font-weight: 500; margin-top: 2px; }
.pos-targets { display: flex; gap: 12px; margin-top: 4px; font-size: 11px; }
.pos-tp { color: var(--green); }
.pos-sl { color: var(--red); }

/* Colors */
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--blue); }

/* Signals */
.signal-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 12px; }
.signal-card.buy { border-left: 4px solid var(--green); }
.signal-header { display: flex; justify-content: space-between; align-items: flex-start; }
.signal-coin { font-weight: 700; font-size: 20px; }
.signal-price { font-size: 14px; color: var(--muted); margin-top: 4px; }
.signal-score { padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.score-high { background: rgba(16,185,129,0.15); color: var(--green); }
.score-med { background: rgba(245,158,11,0.15); color: var(--yellow); }
.score-low { background: rgba(113,128,150,0.15); color: var(--muted); }

.signal-details { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.signal-indicators { display: flex; flex-wrap: wrap; gap: 8px; }
.indicator { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg); border-radius: 6px; font-size: 12px; font-weight: 500; }
.indicator.pass { background: rgba(16,185,129,0.1); color: var(--green); }
.indicator.fail { background: var(--bg); color: var(--muted); }
.signal-strategy { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 12px 16px; background: var(--bg); font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
tr:hover { background: var(--bg); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-gray { background: var(--bg); color: var(--muted); }

/* Settings */
.setting-section { margin-bottom: 24px; }
.setting-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 500; }
.setting-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

.toggle { width: 52px; height: 28px; background: var(--border); border-radius: 14px; position: relative; cursor: pointer; }
.toggle.on { background: var(--green); }
.toggle::after { content: ''; position: absolute; width: 22px; height: 22px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.toggle.on::after { transform: translateX(24px); }

.input-sm { width: 80px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; text-align: right; }
.input-sm:focus { outline: none; border-color: var(--blue); }

.strategy-list { display: grid; gap: 10px; margin-top: 12px; }
.strategy-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg); border-radius: 10px; cursor: pointer; }
.strategy-item:hover { background: #e2e8f0; }
.strategy-cb { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.strategy-item.on .strategy-cb { background: var(--blue); border-color: var(--blue); }
.strategy-item.on .strategy-cb::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 700; }
.strategy-name { font-weight: 500; }
.strategy-desc { font-size: 12px; color: var(--muted); }

/* Logs */
.log-viewer { background: #1e293b; border-radius: 10px; padding: 16px; font-family: monospace; font-size: 12px; color: #94a3b8; max-height: 400px; overflow-y: auto; line-height: 1.6; white-space: pre-wrap; }

/* Loading & Empty */
.loading { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

@media (max-width: 640px) {
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .tab { padding: 14px 6px; font-size: 12px; }
}
