/* =========================================
   1. DASHBOARD GRUNDLAGEN
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f0e17;
    --card-bg: #1a1a2e;
    --text: #fffffe;
    --subtext: #a7a9be;
    --accent: #ff8906;
    --green: #00ff41;
    --red: #ef4565;
}

body.dashboard-body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow: hidden; /* Verhindert Scrollen am gesamten Body */
    width: 100vw;
    height: 100vh;
}

.app-container { display: flex; width: 100%; height: 100%; }

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background: #16161a;
    padding: 25px;
    border-right: 1px solid #2e2f3e;
    transition: transform 0.3s ease, width 0.3s ease, padding 0.3s ease;
    flex-shrink: 0;
    z-index: 1000;
}

.sidebar.collapsed { width: 0; padding: 0; border: none; overflow: hidden; }

/* Das X in der Sidebar NUR für Mobile anzeigen */
.mobile-close-btn { display: none; }

.brand { margin-bottom: 35px; }
.brand h2 { font-size: 20px; white-space: nowrap; }
.brand span { color: var(--accent); }

.add-bot-panel { min-width: 210px; }
.add-bot-panel h4 { margin-bottom: 12px; font-size: 13px; color: var(--subtext); }
.add-bot-panel input {
    width: 100%; padding: 12px; background: #242629; border: 1px solid #2e2f3e;
    color: white; border-radius: 6px; margin-bottom: 10px;
}
.add-bot-panel button {
    width: 100%; padding: 12px; background: #3da9fc; border: none;
    color: white; font-weight: bold; border-radius: 6px; cursor: pointer;
}

/* --- MAIN CONTENT --- */
.content {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto; /* Erlaubt vertikales Scrollen bei vielen Bots */
    overflow-x: hidden; /* Verhindert horizontales Wackeln */
}

.grid-container { width: 100%; }

.grid {
    display: grid;
    /* Container-Größe bleibt starr bei 380px auf Desktop */
    grid-template-columns: repeat(auto-fill, 380px); 
    gap: 25px;
    width: 100%;
}

.bot-card {
    width: 380px; 
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #2e2f3e;
}

/* --- CARD HEADER --- */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.avatar-img { width: 55px; height: 55px; border-radius: 8px; object-fit: cover; }

.header-center { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.bot-name { font-weight: bold; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
.status-dot.offline { background: var(--red); }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

.header-right { display: flex; align-items: center; gap: 10px; }
.timer-box { background: #121216; padding: 6px 10px; border-radius: 6px; font-size: 12px; font-family: monospace; color: var(--subtext); border: 1px solid #2e2f3e; }

.btn-kill {
    background: rgba(239, 69, 101, 0.1); border: 1px solid var(--red); color: var(--red);
    width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-weight: bold;
}

/* --- STATS & TERMINAL --- */
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; background: #121216; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.stat { text-align: center; }
.label { font-size: 9px; color: var(--subtext); text-transform: uppercase; display: block; margin-bottom: 5px; font-weight: bold; }
.value { font-size: 15px; font-weight: bold; font-family: monospace; }

.log-terminal { 
    background: #000; height: 120px; border-radius: 8px; padding: 12px; 
    overflow-y: auto; font-family: 'Courier New', monospace; font-size: 11px;
    border: 1px solid #333; color: #00ff41; margin-bottom: 20px;
}

.auto-booster-control { display: flex; align-items: center; gap: 12px; background: #242629; padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.auto-label { font-size: 11px; font-weight: bold; color: var(--green); }

.action-btn { width: 100%; padding: 16px; background: #2e2f3e; color: #666; border: none; border-radius: 8px; font-weight: 800; cursor: not-allowed; transition: 0.3s; }
.action-btn.ready { background: linear-gradient(135deg, #ff8906, #f25f4c); color: white; cursor: pointer; }

/* Switch Style */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #444; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

.toggle-sidebar-btn { background: #2e2f3e; border: 1px solid #444; color: white; padding: 8px 15px; border-radius: 6px; cursor: pointer; margin-bottom: 20px; }

/* =========================================
   2. MOBILE OPTIMIERUNG
   ========================================= */
@media (max-width: 768px) {
    .grid { grid-template-columns: 1fr; width: 100%; }
    .bot-card { width: 100%; }
    .content { padding: 15px; }
    .sidebar { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; transform: translateX(0); }
    .sidebar.collapsed { transform: translateX(-100vw); }
    .mobile-close-btn { display: block; position: absolute; top: 15px; right: 15px; font-size: 32px; color: white; background: none; border: none; }
}

/* =========================================
   3. LOGIN PAGE (Neo-Brutalism Dark)
   ========================================= */
body.login-page {
    --primary: #ffffff;
    --secondary: #050505;
    --accent: #FF5E5B;
    --shadow: 6px 6px 0px var(--primary);
    background-color: #111111 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace !important;
    overflow: hidden;
}

body.login-page .login-container {
    width: 100%;
    max-width: 400px;
    border: 2px solid var(--primary);
    padding: 40px 30px;
    background-color: var(--secondary);
    box-shadow: var(--shadow);
    position: relative;
    border-radius: 12px;
}

body.login-page h1 { color: var(--primary); text-align: center; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 2px; }
body.login-page label { display: block; margin-bottom: 10px; color: var(--primary); font-weight: bold; }
body.login-page input {
    width: 100%; padding: 15px; border: 2px solid var(--primary); background: #000;
    color: #fff; margin-bottom: 25px; outline: none; border-radius: 0;
}
body.login-page input:focus { box-shadow: 4px 4px 0px var(--accent); }
body.login-page button {
    width: 100%; padding: 15px; background: var(--accent); border: 2px solid var(--primary);
    font-weight: 900; cursor: pointer; color: #000; text-transform: uppercase; border-radius: 0;
}
body.login-page button:hover { background: #fff; transform: translate(-2px, -2px); box-shadow: 4px 4px 0px var(--primary); }
