/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor principal del chat */
.chat-container {
    width: 100%;
    max-width: 500px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header del chat */
.chat-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.chat-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9em;
}

/* Área de mensajes */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

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

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

/* Mensajes */
.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s ease;
}

.user-message {
    align-items: flex-end;
}

.bot-message {
    align-items: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-bottom-right-radius: 6px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 6px;
}

.message-timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    padding: 0 8px;
}

/* Indicador de escritura */
.chat-typing {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.typing-dots {
    display: flex;
    margin-right: 8px;
}

.typing-dots span {
    height: 8px;
    width: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}

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

.typing-text {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Contenedor del input */
.chat-input-container {
    display: flex;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    resize: none;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: #4CAF50;
}

#sendButton {
    margin-left: 10px;
    width: 45px;
    height: 45px;
    border: none;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#sendButton:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#sendButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Respuestas rápidas */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    animation: fadeInUp 0.3s ease;
}

.quick-reply-button {
    padding: 8px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-button:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Selector de vehículos */
.vehicle-selector {
    margin: 15px 0;
    animation: fadeInUp 0.3s ease;
}

.vehicle-selector h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
}

.vehicle-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.vehicle-card:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.vehicle-image {
    flex-shrink: 0;
    width: 96px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehicle-info h5 {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.vehicle-info p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.vehicle-price {
    color: #4CAF50 !important;
    font-weight: 600;
    font-size: 15px !important;
}

/* Display de cotización */
.quote-display {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid #4CAF50;
    border-radius: 15px;
    margin: 15px 0;
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.1);
}

.quote-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 15px;
    text-align: center;
}

.quote-header h4 {
    margin: 0;
    font-size: 18px;
}

.quote-details {
    padding: 20px;
}

.quote-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.quote-item.total {
    border-bottom: none;
    border-top: 2px solid #4CAF50;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 600;
}

.quote-item .label {
    color: #666;
    font-weight: 500;
}

.quote-item .value {
    color: #333;
    font-weight: 600;
}

.quote-item .value.price {
    color: #4CAF50;
    font-size: 18px;
}

.quote-actions {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    background: #f8f9fa;
}

.quote-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.quote-button.primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.quote-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.quote-button.secondary {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.quote-button.secondary:hover {
    background: #f8f9fa;
    border-color: #4CAF50;
    color: #4CAF50;
}

.quote-disclaimer {
    padding: 0 20px 15px;
    text-align: center;
}

.quote-disclaimer small {
    color: #888;
    font-style: italic;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .vehicle-card {
        padding: 12px;
    }
    
    .quote-actions {
        flex-direction: column;
    }
    
    .quote-button {
        margin: 5px 0;
    }
}
