/* Estilos principales - Chatbot Correos Express */
:root {
    --color-primary: #E30613;
    --color-secondary: #FFD700;
    --color-dark: #1a1a1a;
    --color-gray: #666666;
    --color-light-gray: #f5f5f5;
    --color-white: #ffffff;
    --color-success: #28a745;
    --color-error: #dc3545;
    --color-warning: #ffc107;
    
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 450px;
    height: 700px;
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header */
.chat-header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-secondary);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo-container h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--color-white);
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.bot-message .message-content {
    background: var(--color-light-gray);
    color: var(--color-dark);
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: var(--color-primary);
    color: var(--color-white);
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--color-gray);
    margin-top: 4px;
    padding: 0 8px;
}

.bot-message .message-time {
    align-self: flex-start;
}

.user-message .message-time {
    align-self: flex-end;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--color-light-gray);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: fit-content;
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--color-gray);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input area */
.chat-input-container {
    padding: 20px;
    background: var(--color-white);
    border-top: 1px solid #e0e0e0;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: var(--transition);
}

#messageInput:focus {
    border-color: var(--color-primary);
}

#messageInput:disabled {
    background: var(--color-light-gray);
    cursor: not-allowed;
}

.send-button {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.send-button:hover:not(:disabled) {
    background: #c00510;
    transform: scale(1.05);
}

.send-button:disabled {
    background: var(--color-gray);
    cursor: not-allowed;
    transform: none;
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 8px 16px;
    background: var(--color-light-gray);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: var(--color-dark);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* Error states */
.error-message {
    background: #ffebee;
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 14px;
}

.success-message {
    background: #e8f5e8;
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 16px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Animation for new messages */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.new {
    animation: slideInUp 0.3s ease;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--color-light-gray);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-gray);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--color-dark);
}