* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.metrics-panel, .chat-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.metrics-panel h2, .chat-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2d3748;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.metric-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.metric-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.2rem;
}

.metric-status.good { color: #48bb78; }
.metric-status.warning { color: #ed8936; }
.metric-status.critical { color: #f56565; }

.last-updated {
    text-align: center;
    font-size: 0.85rem;
    color: #718096;
    font-style: italic;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.message {
    margin-bottom: 16px;
    max-width: 85%;
}

.message.user {
    margin-left: auto;
}

.message.assistant {
    margin-right: auto;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 6px;
}

.message.assistant .message-content {
    background: #f7fafc;
    color: #2d3748;
    border-bottom-left-radius: 6px;
    border: 1px solid #e2e8f0;
}

.message-time {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
    text-align: right;
}

.message.assistant .message-time {
    text-align: left;
}

.chat-input-container {
    margin-top: auto;
}

.input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

#chat-input:focus {
    border-color: #667eea;
}

#chat-input:disabled {
    background: #f7fafc;
    color: #a0aec0;
}

.voice-btn, .send-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 48px;
    height: 48px;
}

.voice-btn {
    background: #ed8936;
    color: white;
}

.voice-btn:hover:not(:disabled) {
    background: #dd6b20;
    transform: scale(1.05);
}

.voice-btn.recording {
    background: #f56565;
    animation: pulse 1s infinite;
}

.send-btn {
    background: #667eea;
    color: white;
    border-radius: 24px;
    padding: 12px 20px;
    min-width: auto;
}

.send-btn:hover:not(:disabled) {
    background: #5a67d8;
    transform: scale(1.05);
}

.voice-btn:disabled, .send-btn:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.connection-status {
    text-align: center;
    font-size: 0.8rem;
    color: #718096;
}

.connection-status.connected {
    color: #48bb78;
}

.connection-status.error {
    color: #f56565;
}

.alerts-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.alert {
    background: white;
    border-left: 4px solid #f56565;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.alert.warning {
    border-left-color: #ed8936;
}

.alert.info {
    border-left-color: #4299e1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #2d3748;
}

.alert-message {
    font-size: 0.9rem;
    color: #4a5568;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .chat-container {
        height: 400px;
    }
}
