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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 24px;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #44ff44;
}

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

.chat-container {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.message.user .message-avatar {
    background: #667eea;
}

.message.bot .message-avatar {
    background: #764ba2;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background: #667eea;
    color: white;
}

.message-content img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 8px;
}

.message-content audio {
    margin-top: 8px;
}

.typing-indicator {
    display: inline-block;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-modes {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.mode-btn {
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-btn:hover {
    border-color: #667eea;
    background: #f5f3ff;
}

.mode-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-area.hidden {
    display: none;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    max-height: 120px;
}

#messageInput:focus {
    border-color: #667eea;
}

.send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.record-btn {
    flex: 1;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.record-btn.recording {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    animation: recordPulse 1s infinite;
}

@keyframes recordPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.voice-visualizer {
    flex: 1;
    height: 60px;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 10px;
}

.voice-visualizer canvas {
    width: 100%;
    height: 100%;
}

.image-upload-area {
    flex: 1;
    position: relative;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f5f3ff;
}

.upload-label:hover {
    background: #e8e3ff;
    border-color: #764ba2;
}

.image-preview {
    position: relative;
    margin-top: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
}

.image-preview .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imagePrompt, #videoPrompt {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.video-container {
    width: 100%;
}

#videoElement {
    width: 100%;
    max-height: 300px;
    background: #000;
    border-radius: 10px;
    margin-bottom: 10px;
}

.video-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.video-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.video-btn:hover {
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-container {
        height: calc(100vh - 80px);
    }
    
    .message-content {
        max-width: 85%;
    }
}