:root {
    --bg-dark: #3b3b3b; /* YouTube Dark BG */
    --bg-sidebar: #444444; /* Discord Sidebar */
    --bg-panel: #414142; /* Zinc 900 */
    --bg-input: #2f3136;
    --primary: #5865F2; /* Discord Blurple */
    --danger: #ED4245;
    --success: #3BA55C;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --border: #3f3f3f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'gg sans', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

/* Login Overlay */
#login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-sidebar);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: var(--bg-panel);
    padding: 40px;
    border-radius: 8px;
    width: 400px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.logo-area { margin-bottom: 20px; color: var(--primary); }
.login-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: var(--bg-input);
    border: 1px solid #202225;
    color: white;
    border-radius: 4px;
}
.login-box button {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}
.error-msg { color: var(--danger); margin-top: 10px; font-size: 0.9em; }

/* App Layout */
#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 72px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    overflow-y: auto;
}

.sidebar-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #36393f;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--success);
    position: relative;
}

.sidebar-item:hover {
    border-radius: 30%;
    background: var(--primary);
    color: white;
}

.sidebar-item.active {
    border-radius: 30%;
    background: var(--primary);
}

.sidebar-item img {
    width: 100%; height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.separator {
    width: 32px;
    height: 2px;
    background: #36393f;
    margin: 8px 0;
}

.logout-icon { color: var(--danger); margin-top: auto; margin-bottom: 20px; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    overflow-y: auto;
}

/* Top Bar */
.top-bar {
    height: 60px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.search-bar {
    display: flex;
    background: #121212;
    border: 1px solid #303030;
    border-radius: 2px;
    padding: 5px;
    width: 400px;
    transition: width 0.3s;
}
.search-bar button {
    background: #303030;
    border: none;
    color: #606060;
    padding: 0 15px;
    cursor: pointer;
}
.search-bar #refresh-btn {
    margin-left: 5px;
}

/* responsive adjustments */
@media (max-width: 1024px) {
    .search-bar { width: 300px; }
    .bot-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .bot-card { font-size: 0.9em; }
}

@media (max-width: 768px) {
    body { overflow: auto; }
    #app { flex-direction: column; }
    .sidebar { width: 100%; height: 60px; flex-direction: row; padding: 0 5px; overflow-x: auto; }
    .sidebar-item { width: 40px; height: 40px; margin: 5px; }
    .separator { display: none; }
    .main-content { flex: none; width: 100%; }
    .top-bar { flex-direction: column; height: auto; padding: 10px; gap: 10px; }
    .search-bar { width: 100%; }
    .user-profile { order: -1; }
    .bot-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .video-container { max-width: 100%; aspect-ratio: 16/9; }
    .bot-info-section { margin: 10px; }
}

@media (max-width: 480px) {
    .search-bar { padding: 3px; }
    .search-bar input { padding-left: 5px; }
    .bot-info-section { margin: 5px; }
    .command-input-wrapper { flex-direction: column; gap: 10px; }
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    padding-left: 10px;
    outline: none;
}

.search-bar button {
    background: #303030;
    border: none;
    color: #606060;
    padding: 0 15px;
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile img {
    width: 32px; height: 32px; border-radius: 50%;
}

/* Dashboard Grid */
.content-area {
    padding: 24px;
    flex: 1;
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bot-card {
    background: var(--bg-panel);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.bot-card:hover {
    transform: translateY(-5px);
}

.card-thumb {
    position: relative;
    height: 140px;
    background: #202225;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    color: #40444b;
}
.card-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.card-info {
    padding: 12px;
}

.card-title { font-weight: bold; margin-bottom: 5px; }
.card-status { font-size: 0.8em; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: gray; }
.status-dot.running { background: var(--success); }
.status-dot.stopped { background: var(--danger); }

/* Terminal / Video Player Style */
.video-container {
    background: black;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.terminal-window {
    flex: 1;
    background: #0d0d0d;
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Consolas', monospace;
}

.terminal-header {
    display: flex;
    gap: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }
.terminal-title { margin-left: 10px; color: #666; font-size: 0.8em; }

.terminal-content {
    flex: 1;
    overflow-y: auto;
    color: #cccccc;
    font-size: 0.9em;
    white-space: pre-wrap;
}

.log-line { padding: 2px 0; border-bottom: 1px solid #1a1a1a; }
.log-line:hover { background: #1a1a1a; }

/* Controls */
.bot-controls {
    height: 50px;
    background: #202020;
    display: flex;
    align-items: center;
    padding: 0 15px;
    justify-content: space-between;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    margin-right: 15px;
    cursor: pointer;
}
.control-btn:hover { color: var(--primary); }

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    background: #333;
}
.badge.running { background: var(--success); color: white; }
.badge.stopped { background: var(--danger); color: white; }

/* Info Section */
.bot-info-section {
    max-width: 1200px;
    margin: 20px auto;
}

.bot-meta h1 { font-size: 1.5em; margin-bottom: 10px; }
.bot-stats { display: flex; gap: 20px; color: var(--text-muted); font-size: 0.9em; margin-bottom: 15px; }
.description { padding: 15px 0; border-top: 1px solid #333; border-bottom: 1px solid #333; color: #ddd; }

.command-input-wrapper {
    display: flex;
    margin-top: 20px;
    gap: 15px;
}

.comment-avatar { width: 40px; height: 40px; border-radius: 50%; }

#cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: white;
    padding: 5px;
    outline: none;
    transition: 0.3s;
}

#cmd-input:focus { border-bottom: 2px solid var(--text-main); }

/* admin panel wrapper (padding + text color) */
.view-container { padding: 20px; color: #fff; overflow-y: auto; }

/* admin panel styling (moved from inline script) */
.user-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: #2f3136; border-radius: 5px; overflow: hidden; }
.user-table th, .user-table td { padding: 12px; text-align: left; border-bottom: 1px solid #40444b; }
.user-table th { background: #202225; }
.create-form { background: #2f3136; padding: 15px; border-radius: 5px; display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.create-form input { padding: 8px; border-radius: 3px; border: 1px solid #202225; background: #40444b; color: white; }
.btn-danger { background: #ed4245; color: white; border: none; padding: 5px 10px; cursor: pointer; border-radius: 3px; }
.btn-edit { background: #5865F2; color: white; border: none; padding: 5px 8px; cursor: pointer; border-radius: 3px; }
.btn-edit i { font-size: 0.9em; }
.bot-check-list { display: flex; flex-wrap: wrap; gap: 10px; max-width: 300px; }
.bot-check-item { background: #202225; padding: 2px 6px; border-radius: 3px; font-size: 0.8em; }