:root {
    --accent: #6C4FB3;
    --accent-m: #9B7FD4;
    --accent-d: #4E3A8A;
    --accent-s: #EEE9F8;
    --accent-rgb: 108, 79, 179;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--accent-m) 0%, var(--accent-d) 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, var(--accent-m) 0%, var(--accent-d) 100%);
    color: white;
    padding: 16px 20px;
    text-align: center;
    position: relative;
}

.chat-back-link {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
}
.chat-back-link:hover { opacity: 0.9; color: white; }
.chat-back-link svg { width: 20px; height: 20px; stroke: currentColor; }

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chat-header-logo {
    height: 65px;
    width: auto;
    filter: brightness(0) invert(1);
}

.subtitle {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

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

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

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

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

.assistant .message-avatar {
    background: linear-gradient(135deg, var(--accent-m) 0%, var(--accent-d) 100%);
    color: white;
}

.user-message .message-avatar {
    background: #e0e0e0;
    color: #333;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    word-break: break-word;
    overflow-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--accent-m) 0%, var(--accent-d) 100%);
    color: white;
    margin-left: auto;
}

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

.typing-indicator {
    opacity: 0.7;
}

.typing-indicator .message-content {
    padding: 16px;
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 4px;
    background: #f8f9fc;
    border-top: 1px solid #e8e8e8;
}
.quick-prompt-btn {
    background: #fff;
    border: 1px solid #D8CFF0;
    color: #6C4FB3;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.quick-prompt-btn:hover {
    background: #EEE9F8;
}

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

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

.voice-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-btn svg { width: 22px; height: 22px; color: var(--accent); }
.voice-btn:hover {
    border-color: var(--accent);
    background: var(--accent-s);
}

.voice-btn.recording {
    background: #ff4444;
    border-color: #ff4444;
    animation: pulse 1s infinite;
}

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

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: var(--accent);
}

.chat-send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-m) 0%, var(--accent-d) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-send-btn svg { width: 18px; height: 18px; }
.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
}

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

/* Scrollbar customizada */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent-d);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    
    .chat-header { padding: 12px 16px; }
    .chat-header-logo { height: 56px; }
    .subtitle { font-size: 13px; }
    
    .chat-messages { padding: 16px; }
    .message-content { max-width: 85%; font-size: 15px; }
    
    .chat-input-container { padding: 12px 16px; }
    .chat-input { min-height: 44px; font-size: 16px; }
    .chat-send-btn { min-height: 44px; min-width: 44px; padding: 12px 18px; }
    .voice-btn { min-width: 44px; min-height: 44px; }
}

@media (max-width: 480px) {
    .chat-back-link { font-size: 12px; padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
    .chat-header-logo { height: 50px; }
    .subtitle { font-size: 12px; white-space: normal; text-align: center; }
    .chat-input-wrapper { gap: 8px; }
    .chat-send-btn span { display: none; }
    .chat-send-btn { padding: 12px; }
}
