* {
    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;
    color: #fff;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 20px 0;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #888;
    margin-top: 5px;
}

.chat-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: 60vh;
}

.welcome-message {
    text-align: center;
    color: #666;
    padding: 40px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.message-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.text-input-wrapper {
    flex: 1;
    min-width: 200px;
    display: flex;
    gap: 5px;
}

#textInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: background 0.3s;
}

#textInput:focus {
    background: rgba(255, 255, 255, 0.15);
}

#textInput::placeholder {
    color: #666;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

.mic-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

.mic-btn.recording {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
    50% { box-shadow: 0 0 0 15px rgba(255, 68, 68, 0); }
}

.mic-btn svg {
    width: 28px;
    height: 28px;
}

.lang-select {
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    outline: none;
}

.lang-select option {
    background: #1a1a2e;
}

.clear-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: rgba(255, 68, 68, 0.3);
}

.status {
    text-align: center;
    padding: 10px;
    color: #888;
    font-size: 0.9rem;
    min-height: 40px;
}

.status.error {
    color: #ff4444;
}

.status.success {
    color: #00ff88;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00d9ff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 0.85rem;
    color: #888;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}
