/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e14;
    --bg-secondary: #1a1f29;
    --bg-header: #151a21;
    --text-primary: #00ff00;
    --text-secondary: #39ff14;
    --text-muted: #6c7986;
    --border-color: #2a2f3a;
    --accent-color: #00ff00;
    --error-color: #ff3333;
    --warning-color: #ffaa00;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #0a0e14 0%, #151a21 100%);
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.error-message {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 4px;
    color: var(--error-color);
    font-size: 12px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* Terminal Screen */
.terminal-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

/* Header */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    height: 50px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-info {
    font-size: 14px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    font-size: 12px;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    color: #00ff00;
}

.status-indicator.offline {
    color: #666;
}

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

#bot-status-text {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-bot, .btn-logout {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-bot:hover, .btn-logout:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* Terminal */
.terminal {
    flex: 1;
    padding: 10px;
    overflow: hidden;
}

.xterm {
    height: 100%;
    width: 100%;
}

.xterm-viewport {
    background-color: var(--bg-primary) !important;
}

.xterm-screen {
    background-color: var(--bg-primary) !important;
}

/* QR Modal */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.qr-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
}

.qr-content h3 {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

#qr-image {
    max-width: 300px;
    width: 100%;
    margin: 20px 0;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.qr-content p {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 20px;
}

.btn-close {
    padding: 10px 20px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close:hover {
    opacity: 0.8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 20, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-header {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .login-box {
        margin: 20px;
        padding: 30px 20px;
    }

    .os-logo {
        height: 20px;
    }

    .server-info {
        font-size: 12px;
    }

    .btn-bot, .btn-logout {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .terminal {
        padding: 5px;
    }

    .login-box {
        padding: 20px;
    }

    .login-header h1 {
        font-size: 20px;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease;
}
