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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    max-height: 700px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info h1 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    font-size: 0.75rem;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message.bot-message {
    align-self: flex-start;
}

.message.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.bot-message .message-content {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.message-content audio {
    width: 100%;
    max-width: 250px;
    height: 35px;
    border-radius: 20px;
    margin-top: 5px;
}

.timestamp {
    font-size: 0.7rem;
    color: #999;
    padding: 0 5px;
}

.user-message .timestamp {
    text-align: right;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 15px 20px;
    background: #e9ecef;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-top: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    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%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    position: relative;
}

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

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.control-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.control-btn.recording {
    background: #ef4444;
    color: white;
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

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

#messageInput:focus {
    border-color: #1a1a2e;
}

.send-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(26, 26, 46, 0.3);
}

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

.recording-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 20px;
    margin-top: 10px;
    color: #ef4444;
    font-size: 0.85rem;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-recording 1s infinite;
}

.attachment-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
}

.remove-attachment {
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.remove-attachment:hover {
    color: #ef4444;
}

@media (max-width: 480px) {
    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
}
