:root {
    --bg-color: #0a0c10; --glass-bg: rgba(255,255,255,0.05); --glass-border: rgba(255,255,255,0.1);
    --neon-blue: #3b82f6; --neon-glow: rgba(59,130,246,0.4); --text-main: #f3f4f6; --text-muted: #9ca3af;
    --success: #10b981; --danger: #ef4444; --warning: #f59e0b; --chat-bg: rgba(0,0,0,0.4);
}
body {
    margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-color) url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?q=80&w=2000&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover; color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    user-select: none; -webkit-user-select: none;
}
#ai-chat-history, .msg, .terminal, input, textarea { user-select: text !important; -webkit-user-select: text !important; }

.glass { background: var(--glass-bg); backdrop-filter: blur(24px); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: 0 10px 40px 0 rgba(0,0,0,0.5); padding: 25px; margin: 10px; width: 100%; max-width: 1000px; box-sizing: border-box; }

/* Responsive */
@media (max-width: 768px) { .glass { max-width: 95%; padding: 20px; } .tabs { grid-template-columns: repeat(3, 1fr) !important; } }
@media (min-width: 769px) { .tabs { grid-template-columns: repeat(7, 1fr); } }

/* Login */
#login-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; width: 100%; }
#login-screen .glass { max-width: 420px; text-align: center; }
input, textarea, select { width: 100%; padding: 14px; margin: 10px 0; background: rgba(0,0,0,0.6); border: 1px solid var(--glass-border); border-radius: 10px; color: white; box-sizing: border-box; outline: none; font-family: inherit; }
input:focus { border-color: var(--neon-blue); box-shadow: 0 0 10px var(--neon-glow); }
button { background: linear-gradient(135deg, #2563eb, #3b82f6); color: white; border: none; padding: 12px 20px; border-radius: 10px; cursor: pointer; font-weight: bold; transition: all 0.3s; margin: 5px; box-shadow: 0 4px 15px var(--neon-glow); }
button:hover { transform: translateY(-2px); opacity: 0.9; }
.hidden { display: none !important; }

/* Header & Tabs */
header { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1000px; padding: 15px 10px; }
.status-pill { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 16px; border-radius: 30px; background: rgba(0,0,0,0.6); border: 1px solid var(--glass-border); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); transition: 0.3s; }
.dot.online { background: var(--success); box-shadow: 0 0 10px var(--success); }

.tabs { display: grid; gap: 10px; margin-bottom: 20px; }
.tab-btn { background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); padding: 12px 5px; border-radius: 30px; text-align: center; cursor: pointer; font-size: 13px; transition: 0.3s; }
.tab-btn.active { background: rgba(59, 130, 246, 0.2); border-color: var(--neon-blue); color: var(--neon-blue); box-shadow: 0 0 15px var(--neon-glow); font-weight: bold; }

.tab-content { display: none; animation: fadeIn 0.4s ease; } 
.tab-content.active { display: block; }
.tab-content.active#tab-ai { display: flex; flex-direction: column; height: 65vh; min-height: 450px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard Widgets */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.widget { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 15px; padding: 20px; transition: 0.3s; }
.widget:hover { background: rgba(255,255,255,0.08); transform: translateY(-3px); }
.widget-title { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.widget-value { font-size: 24px; font-weight: bold; }
.ping-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ping-row:last-child { border-bottom: none; }
.ping-val { font-weight: bold; font-family: monospace; }
.ping-good { color: var(--success); text-shadow: 0 0 8px var(--success); }
.ping-bad { color: var(--danger); text-shadow: 0 0 8px var(--danger); }

/* AI Chat */
.chat-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); padding-bottom: 12px; margin-bottom: 12px; }
#ai-chat-history { flex: 1; overflow-y: auto; padding: 15px; background: var(--chat-bg); border-radius: 15px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 15px; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 20px; font-size: 14px; line-height: 1.6; word-wrap: break-word; animation: slideIn 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.msg.user { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: white; align-self: flex-end; border-bottom-left-radius: 4px; }
.msg.ai { background: rgba(255, 255, 255, 0.1); color: #e5e7eb; align-self: flex-start; border-bottom-right-radius: 4px; border: 1px solid var(--glass-border); }
.msg img { max-width: 100%; border-radius: 8px; margin-top: 5px; }
.ai-controls { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 8px; }
.ai-controls button { padding: 4px 10px; font-size: 11px; background: transparent; border: 1px solid var(--neon-blue); color: var(--neon-blue); border-radius: 12px; margin: 0; box-shadow: none; }
.ai-controls button:hover { background: rgba(59,130,246,0.2); }

.input-area { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.6); border: 1px solid var(--glass-border); border-radius: 30px; padding: 5px 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.4); }
.input-area input[type="text"] { margin: 0; border: none; background: transparent; padding: 12px; flex: 1; font-size: 14px; box-shadow: none; }
.icon-btn { background: transparent; color: var(--text-muted); font-size: 22px; padding: 8px; margin: 0; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: 0.2s; border: none; box-shadow: none; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,0.1); color: var(--neon-blue); transform: scale(1.1); }
.icon-btn.send { color: var(--neon-blue); }
.icon-btn.mic.active { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

#img-preview { display: none; position: relative; width: fit-content; margin-bottom: 5px; }
#img-preview img { height: 50px; border-radius: 8px; border: 1px solid var(--neon-blue); }
#img-preview button { position: absolute; top: -5px; right: -5px; background: var(--danger); border-radius: 50%; padding: 2px 6px; font-size: 10px; }

/* Bots */
.bot-card { background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 15px; margin-bottom: 12px; overflow: hidden; transition: 0.3s; }
.bot-card:hover { border-color: rgba(59,130,246,0.5); }
.bot-header { display: flex; justify-content: space-between; align-items: center; padding: 18px; cursor: pointer; transition: 0.3s; }
.bot-header:hover { background: rgba(255,255,255,0.05); }
.bot-details { display: none; padding: 18px; background: rgba(0,0,0,0.5); border-top: 1px solid var(--glass-border); }
.bot-details.open { display: block; animation: fadeIn 0.3s; }
.bot-stats { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.bot-actions { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }

/* Terminal */
.terminal { background: #000; color: #0f0; font-family: monospace; padding: 15px; border-radius: 15px; height: 350px; overflow-y: auto; font-size: 12px; white-space: pre-wrap; margin-top: 15px; direction: ltr; border: 1px solid rgba(0,255,0,0.2); box-shadow: inset 0 0 20px rgba(0,255,0,0.1); }
.term-input-area { display: flex; margin-top: 10px; background: #000; border-radius: 10px; border: 1px solid #333; padding: 5px; }
.term-input-area span { color: #0f0; font-family: monospace; padding: 10px 5px 0 10px; }
.term-input-area input { background: transparent; border: none; color: #0f0; font-family: monospace; margin: 0; box-shadow: none; }

/* Settings & Keys */
.key-field { position: relative; margin-bottom: 15px; background: rgba(0,0,0,0.3); padding: 15px; border-radius: 15px; border: 1px solid var(--glass-border); }
.key-field label { font-size: 14px; color: var(--text-muted); font-weight: bold; }
.key-field input { padding-left: 40px; margin-bottom: 5px; }
.eye-btn { position: absolute; left: 25px; top: 55px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; box-shadow: none; margin: 0; padding: 0; }

/* Modals */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 1000; animation: fadeIn 0.3s; }
.modal-content { background: var(--bg-color); padding: 25px; border-radius: 20px; max-width: 600px; width: 90%; border: 1px solid var(--neon-blue); box-shadow: 0 0 30px var(--neon-glow); max-height: 80vh; overflow-y: auto; }

/* Toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.9); border: 1px solid var(--neon-blue); color: white; padding: 12px 24px; border-radius: 30px; z-index: 2000; font-size: 14px; display: none; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }

/* Network Logs */
.net-log-row { display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid #333; font-family: monospace; font-size: 12px; }
.net-log-row.get { color: #0f0; }
.net-log-row.post { color: #3b82f6; }
.net-log-row.error { color: #ef4444; }

/* Code Editor */
.code-editor { width: 100%; height: 400px; background: #1e1e1e; color: #d4d4d4; font-family: monospace; font-size: 14px; padding: 10px; border-radius: 10px; border: 1px solid #333; resize: vertical; direction: ltr; }
