:root {
    --bg-dark: #0f111a;
    --bg-panel: #1a1d2d;
    --bg-card: #25293d;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --border: #334155;
    
    /* Log Colors */
    --log-info: #38bdf8;
    --log-warn: #facc15;
    --log-error: #f87171;
    --log-success: #34d399;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-header h2 { font-size: 1.2rem; font-weight: 600; }
.sidebar-header i { color: var(--accent); margin-right: 8px; }

.sidebar-nav { padding: 15px 10px; display: flex; flex-direction: column; gap: 5px; }
.sidebar-nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: var(--bg-card);
    color: var(--text-main);
}
.sidebar-nav a.active { border-left: 4px solid var(--accent); }

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    height: 60px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.server-title { font-family: 'Courier New', monospace; font-weight: bold; color: var(--text-muted); }

.status-badge {
    background-color: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.online { background-color: var(--log-success); box-shadow: 0 0 8px var(--log-success); }
.dot.offline { background-color: var(--log-error); box-shadow: 0 0 8px var(--log-error); }

/* Sections */
.content-area { flex: 1; padding: 20px; overflow-y: auto; }
.view-section { display: none; animation: fadeIn 0.3s ease; height: 100%; flex-direction: column; }
.view-section.active { display: flex; }
.section-title { font-size: 1.5rem; margin-bottom: 20px; font-weight: 500; }

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

/* Cards & Dashboard */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.card { background-color: var(--bg-panel); padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-value { font-size: 1.8rem; font-weight: 600; margin-bottom: 15px; }

.progress-bar { width: 100%; height: 6px; background-color: var(--bg-dark); border-radius: 4px; overflow: hidden; }
.progress { height: 100%; background-color: var(--accent); border-radius: 4px; transition: width 0.5s; }

/* Terminal */
.console-header { display: flex; justify-content: space-between; align-items: center; }
.terminal-container {
    background-color: #090a0f;
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}
.log-line { margin-bottom: 4px; word-wrap: break-word; }
.log-line.info { color: var(--log-info); }
.log-line.warn { color: var(--log-warn); }
.log-line.error { color: var(--log-error); }
.log-line.cmd { color: #fff; font-weight: bold; }

.terminal-input-wrapper {
    background-color: #090a0f;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.prompt { color: var(--log-success); font-family: monospace; font-weight: bold; }
#cmd-input {
    flex: 1; background: transparent; border: none; color: #fff; font-family: monospace; font-size: 14px; outline: none;
}

/* UI Elements */
.btn {
    background-color: var(--bg-card); color: var(--text-main); border: 1px solid var(--border);
    padding: 10px 16px; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem;
}
.btn:hover { background-color: var(--border); }
.btn-primary { background-color: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background-color: var(--accent-hover); }

/* File Manager */
.file-manager { display: flex; flex-direction: column; height: 100%; gap: 15px; }
.file-toolbar { display: flex; gap: 10px; }
.file-grid { display: grid; grid-template-columns: 250px 1fr; gap: 15px; flex: 1; min-height: 0; }
.file-tree { background-color: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 15px; overflow-y: auto; }
.file-editor { background-color: #1e1e1e; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

/* Git */
.git-card { display: flex; flex-direction: column; gap: 15px; max-width: 600px; }
.input-group { display: flex; gap: 10px; }
.input-group input { flex: 1; background-color: var(--bg-dark); border: 1px solid var(--border); padding: 10px 15px; border-radius: 8px; color: #fff; outline: none; }
.git-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast { background-color: var(--bg-card); border-left: 4px solid var(--accent); padding: 12px 20px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); animation: slideIn 0.3s ease forwards; color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Mobile Only */
.mobile-only { display: none; background: transparent; border: none; color: var(--text-main); font-size: 1.2rem; cursor: pointer; }

@media (max-width: 768px) {
    .mobile-only { display: block; }
    .sidebar { position: fixed; z-index: 1000; height: 100vh; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 15px rgba(0,0,0,0.5); }
    .file-grid { grid-template-columns: 1fr; grid-template-rows: 200px 1fr; }
    .input-group { flex-direction: column; }
}
