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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #f5f5f5;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    margin-bottom: 24px;
    color: #1a1a1a;
    font-size: 2em;
}

h2 {
    margin-bottom: 16px;
    color: #2c3e50;
    font-size: 1.3em;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #545b62;
}

.debug-panel {
    background: #1e1e1e;
    color: #00ff00;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.5;
}

.chat-messages {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
}

.message {
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
}

.message.user {
    background: #e3f2fd;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 2px;
}

.message.assistant {
    background: #f1f8e9;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.message.system {
    background: #fff3e0;
    margin: 10px auto;
    text-align: center;
    font-style: italic;
    color: #666;
    max-width: 100%;
}

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

.chat-input-group input {
    flex: 1;
}

.status {
    padding: 12px 16px;
    margin: 0 0 20px 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1em;
}

.connected {
    background: #c8e6c9;
    color: #1b5e20;
    border-left: 4px solid #2e7d32;
}

.disconnected {
    background: #ffcdd2;
    color: #b71c1c;
    border-left: 4px solid #c62828;
}

/* Scrollbar styling */
.debug-panel::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.debug-panel::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.debug-panel::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.debug-panel::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        margin: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .chat-input-group {
        flex-direction: column;
    }
    
    .message {
        max-width: 100%;
    }
}
