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

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

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    max-height: 800px;
    background: white;
    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, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.language-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: background 0.2s;
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.3);
}

.language-selector select option {
    background: #667eea;
    color: white;
}

.country-badge {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
    border-radius: 8px;
}

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

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: slideIn 0.3s ease-out;
}

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

.message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.message-meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.message.sent .message-meta {
    color: rgba(255, 255, 255, 0.7);
}

.message-translation {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border-left: 3px solid #667eea;
}

.message.sent .message-translation {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    border-left-color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.message.sent .message-translation strong {
    color: #ffffff !important;
}

.message.sent .message-translation small {
    color: rgba(255, 255, 255, 0.85) !important;
}

.system-message {
    text-align: center;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    margin: 0 auto;
    max-width: 80%;
}

.system-message p {
    color: #667eea;
    font-size: 14px;
    font-style: italic;
}

.chat-input-container {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

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

.send-button {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

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

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    margin-top: 8px;
    padding: 8px 16px;
    text-align: center;
    color: #667eea;
    font-size: 13px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-header h1 {
        font-size: 20px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-messages {
        padding: 16px;
    }
}
