* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #111;
    border-bottom: 1px solid #222;
}

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

#session-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#session-status {
    font-size: 13px;
    color: #888;
}

button {
    padding: 8px 16px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background: #252525;
    border-color: #444;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button#btn-new-session {
    background: #1a5c2e;
    border-color: #2a8c44;
}

button#btn-new-session:hover:not(:disabled) {
    background: #1f6e36;
}

button#btn-destroy {
    background: #5c1a1a;
    border-color: #8c2a2a;
}

button#btn-destroy:hover:not(:disabled) {
    background: #6e1f1f;
}

button#btn-takeover {
    background: #1a3d5c;
    border-color: #2a5c8c;
}

button#btn-takeover:hover:not(:disabled) {
    background: #1f4a6e;
}

button#btn-takeover.active {
    background: #8c5c1a;
    border-color: #c47a22;
}

/* Main content */
#main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Chat panel */
#chat-panel {
    width: 380px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #222;
    background: #0d0d0d;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 90%;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: #1a3d5c;
    color: #e0e0e0;
}

.message.agent {
    align-self: flex-start;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #d0d0d0;
}

.message.system {
    align-self: center;
    background: transparent;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

#chat-input-area {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-top: 1px solid #222;
}

#chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

#chat-input:focus {
    border-color: #555;
}

#chat-input:disabled {
    opacity: 0.5;
}

#btn-send {
    background: #1a5c2e;
    border-color: #2a8c44;
}

/* Viewport panel */
#viewport-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}

#viewport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #111;
    border-bottom: 1px solid #222;
}

#viewport-title {
    font-size: 14px;
    font-weight: 500;
}

#viewport-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#agent-status {
    font-size: 12px;
    color: #888;
    padding: 4px 10px;
    border-radius: 4px;
    background: #1a1a1a;
}

#viewport-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#viewport-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #555;
    font-size: 14px;
    text-align: center;
    gap: 8px;
}

#viewport-placeholder code {
    background: #1a1a1a;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: #aaa;
}

#vnc-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
