* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #6675f7 0%, #ffffff 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 600px;
    height: 90vh;
    background: #e5ddd5;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-header {
    background: #00A884;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-info h2 {
    font-size: 18px;
    font-weight: 600;
}

.header-info p {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Área de mensajes */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 50c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10c0 5.5-4.5 10-10 10s-10-4.5-10-10 4.5-10 10-10zm0 0c0 5.5-4.5 10-10 10s-10-4.5-10-10 4.5-10 10-10 10 4.5 10 10z' fill='%23d1d7db' fill-opacity='0.2'/%3E%3C/svg%3E");
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.user .message-bubble {
    background: #00A884;
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

/* Botones rápidos */
.quick-replies {
    padding: 10px 15px;
    background: #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
}

.quick-replies:empty {
    display: none;
}

.quick-reply-btn {
    background: white;
    border: 2px solid #00A884;
    color: #00A884;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: #00A884;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,168,132,0.3);
}

/* Input area */
.chat-input-area {
    background: #f0f0f0;
    padding: 10px 15px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#message-input:focus {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

#send-btn {
    background: #00A884;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#send-btn:hover {
    background: #008f6f;
    transform: scale(1.05);
}

#send-btn:active {
    transform: scale(0.95);
}

/* Scrollbar personalizada */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.4);
}

/* Responsive */
@media (max-width: 640px) {
    .chat-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* Estado de carga */
.typing-indicator {
    display: none;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    margin-bottom: 15px;
    max-width: 75%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.typing-indicator.active {
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    margin: 0 2px;
    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%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-container h2 {
    color: #00A884;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-container p {
    color: #666;
    margin-bottom: 20px;
}

.login-container input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.login-container input:focus {
    border-color: #00A884;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #00A884;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.login-container button:hover {
    background: #008f6f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,168,132,0.3);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

.demo-clients {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.demo-clients p {
    font-size: 13px;
    margin-bottom: 10px;
}

.demo-clients button {
    background: #f0f0f0;
    color: #333;
    font-size: 13px;
    padding: 8px;
}

.demo-clients button:hover {
    background: #e0e0e0;
    transform: none;
    box-shadow: none;
}