:root {
    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(circle at top right, #1e293b, #0f172a);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-inter: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-inter);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Screens */
.screen { display: none; animation: fadeIn 0.4s ease-out; }
.screen.active { display: block; }

/* Glassmorphism */
.glass-card, .glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Typography & Base Elements */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; }
p { color: var(--text-muted); font-size: 0.95rem; }

input {
    width: 100%; padding: 12px 16px; background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border); border-radius: 8px;
    color: var(--text-main); font-size: 1rem; outline: none; transition: all 0.2s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

.btn {
    padding: 12px 24px; border: none; border-radius: 8px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; font-size: 0.95rem;
}
.primary-btn { background: var(--primary); color: white; }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.secondary-btn { background: rgba(59, 130, 246, 0.1); color: var(--primary); border: 1px solid rgba(59, 130, 246, 0.2); }
.secondary-btn:hover { background: rgba(59, 130, 246, 0.2); }
.icon-btn { background: transparent; color: var(--text-muted); padding: 8px; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }

/* Login */
#login-screen { height: 100vh; display: none; align-items: center; justify-content: center; }
#login-screen.active { display: flex; }
.login-card { width: 100%; max-width: 400px; padding: 40px; text-align: center; }
.logo-wrapper { margin-bottom: 24px; display: flex; justify-content: center; }
.logo-circle { width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), #8b5cf6); border-radius: 50%; }
.logo-circle.small { width: 32px; height: 32px; flex-shrink: 0; }
.login-card h1 { margin-bottom: 8px; }
.login-card p { margin-bottom: 24px; }
#login-form { display: flex; flex-direction: column; gap: 16px; }
.error-msg, .success-msg { margin-top: 12px; font-size: 0.85rem; min-height: 20px;}
.error-msg { color: var(--danger); }
.success-msg { color: var(--success); }

/* Dashboard */
.glass-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; margin: 24px; }
.nav-brand { display: flex; align-items: center; gap: 12px; }

.dashboard-grid {
    display: grid; grid-template-columns: repeat(12, 1fr); grid-gap: 24px;
    padding: 0 24px 24px 24px; max-width: 1400px; margin: 0 auto;
}
.status-card { grid-column: span 12; padding: 24px; display:flex; justify-content: space-between; align-items: center;}
.symbols-card { grid-column: span 6; padding: 24px;}
.settings-card { grid-column: span 6; padding: 24px;}
.logs-card { grid-column: span 12; padding: 24px; height: 400px; display:flex; flex-direction:column;}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--glass-border); padding-bottom: 12px;}
.indicator { width: 12px; height: 12px; border-radius: 50%; }
.indicator.running { background: var(--success); animation: pulse-ring 2s infinite; }
.indicator.stopped { background: var(--danger); }

.status-controls { display: flex; align-items: center; gap: 24px; }
.status-controls p { font-size: 1.1rem; }
#toggle-bot-btn.running { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
#toggle-bot-btn.running:hover { background: rgba(239, 68, 68, 0.2); }

.badge { background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; }
.inline-form { display: flex; gap: 12px; margin-bottom: 20px; }
.symbols-list { display: flex; flex-direction: column; gap: 12px; max-height: 300px; overflow-y: auto; padding-right: 8px;}
.symbol-item { display:flex; justify-content: space-between; align-items:center; background: rgba(15,23,42,0.4); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--glass-border);}
.remove-btn { color: var(--danger); background:transparent; border:none; cursor:pointer; padding:4px;}

#settings-form { display: flex; flex-direction: column; gap: 16px; }
.input-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-muted); }

.terminal-logs { background: #000; border-radius: 8px; padding: 16px; overflow-y: auto; flex-grow: 1; font-family: monospace; font-size: 0.85rem; color: #10b981; line-height: 1.5; }
.log-entry { margin-bottom: 4px; border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom:4px;}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

@media (max-width: 768px) {
    .symbols-card, .settings-card { grid-column: span 12; }
    .status-card { flex-direction: column; gap: 16px; text-align:center; }
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--glass-border); transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: var(--text-muted); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(16px); background-color: white; }
.item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
