@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #0d0f12;
    --panel-bg: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --nav-height: 70px;
    --glass-blur: blur(12px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden; /* Prevent body scroll */
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

/* Glassmorphism utilities */
.glass {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
}

/* Login Screen */
#loginScreen {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1a1c29 0%, var(--bg-color) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.4s ease;
}

.login-card {
    width: 90%;
    max-width: 350px;
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
}

.login-card h2 {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
}

/* Forms & Inputs */
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

button {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:active {
    transform: scale(0.97);
}

/* Main App Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    display: none;
}

header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
}

header h1 {
    font-size: 18px;
    font-weight: 600;
}

.bot-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* Content Area */
main {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 30px);
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex: 1;
    min-height: 0;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

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

/* Bot List */
.bot-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bot-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.bot-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: var(--primary);
}

.bot-info {
    flex: 1;
}

.bot-info .hostname {
    font-weight: 500;
    font-size: 16px;
}

.bot-info .username {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Trackpad */
.trackpad-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 15px;
}

.trackpad {
    flex: 1;
    border-radius: 20px;
    position: relative;
    touch-action: none; /* Prevent browser scroll/zoom */
    display: flex;
    align-items: center;
    justify-content: center;
}

.trackpad::after {
    content: 'TRACKPAD';
    color: rgba(255, 255, 255, 0.05);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    pointer-events: none;
}

.mouse-buttons {
    display: flex;
    gap: 15px;
    height: 60px;
}

.mouse-buttons button {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
}

#tab-terminal {
    height: 100%;
}

#tab-terminal.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Terminal */
.terminal-output {
    background: #000;
    border-radius: 6px;
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: #10b981;
    margin: 0 0 10px 0;
    border: 1px solid #333;
}

.command-input-group {
    display: flex;
    gap: 10px;
}

.command-input-group button {
    width: 80px;
}

/* Shortcuts */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.shortcut-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}

.shortcut-btn i {
    font-size: 18px;
    color: var(--primary);
}

/* Bottom Navigation */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 50;
    border-top: 1px solid var(--panel-border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    width: 25%;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
}
