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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

.browser-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    background: #0d0d0d;
}

.browser-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.browser-toolbar input {
    flex: 1;
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.browser-toolbar input:focus {
    outline: none;
    border-color: #0066cc;
}

.browser-toolbar button {
    padding: 8px 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.browser-toolbar button:hover {
    background: #3a3a3a;
}

.browser-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    position: relative;
}

#screenshot {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

#loadingIndicator {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    color: #0066cc;
    font-size: 18px;
}

.browser-info {
    padding: 8px 12px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #888;
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 350px;
    max-width: 500px;
    background: #1a1a1a;
}

.chat-header {
    padding: 16px;
    background: #0d0d0d;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 18px;
    color: #e0e0e0;
}

.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status.connected {
    background: #1a3d1a;
    color: #4ade80;
}

.status.disconnected {
    background: #3d1a1a;
    color: #f87171;
}

.status.thinking {
    background: #3d3d1a;
    color: #fbbf24;
}

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

.message {
    display: flex;
    gap: 8px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: #0066cc;
    color: white;
}

.message.user .message-avatar {
    background: #444;
    color: #e0e0e0;
}

.message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.message.assistant .message-content {
    background: #2a2a2a;
    color: #e0e0e0;
}

.message.user .message-content {
    background: #0066cc;
    color: white;
}

.message.system .message-content {
    background: #3d3d1a;
    color: #fbbf24;
}

.chat-input {
    padding: 12px;
    background: #0d0d0d;
    border-top: 1px solid #333;
    display: flex;
    gap: 8px;
}

#messageInput {
    flex: 1;
    padding: 10px 14px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

#messageInput:focus {
    outline: none;
    border-color: #0066cc;
}

#sendBtn {
    padding: 10px 20px;
    background: #0066cc;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

#sendBtn:hover {
    background: #0052a3;
}

#sendBtn:disabled {
    background: #444;
    cursor: not-allowed;
}
