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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: #2d3748;
    line-height: 1.6;
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 700px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    color: #1a202c;
    padding: 24px 32px;
    text-align: center;
}

.chat-header h1 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: #2d3748;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.message-content {
    max-width: 75%;
    padding: 16px 20px;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.7;
    font-size: 15px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #2d3748;
    color: #ffffff;
    margin-left: auto;
    border: 1px solid #2d3748;
}

.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #f7fafc;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.chat-input-container {
    padding: 24px 32px 32px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

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

#messageInput {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    resize: none;
    min-height: 50px;
    max-height: 120px;
}

#messageInput:focus {
    border-color: #4a5568;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

#messageInput:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

#sendButton {
    width: 50px;
    height: 50px;
    border: 1px solid #2d3748;
    border-radius: 8px;
    background: #2d3748;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#sendButton:disabled {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

#sendButton:hover:not(:disabled) {
    background: #1a202c;
    border-color: #1a202c;
}

#sendButton:active:not(:disabled) {
    transform: translateY(1px);
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-width: 75%;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a0aec0;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Scrollbar personalizado */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .chat-container {
        height: calc(100vh - 32px);
        border-radius: 8px;
    }
    
    .chat-messages {
        padding: 20px;
        gap: 16px;
    }
    
    .chat-header {
        padding: 20px 24px;
    }
    
    .chat-input-container {
        padding: 16px 20px 20px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    #messageInput {
        padding: 14px 16px;
        font-size: 14px;
    }
}