﻿/* =============================================== */
/* CHATBOT MAIN CSS - ESTILOS PRINCIPALES */
/* =============================================== */

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 32px 64px rgba(0, 0, 0, 0.15);
    /* NUEVAS VARIABLES RGB PARA COLORES DINÁMICOS */
    --primary-rgb: 99, 102, 241;
    --secondary-rgb: 139, 92, 246;
    --accent-rgb: 16, 185, 129;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.chatbot-container {
    max-width: 900px;
    margin: 1rem auto;
    /*background: var(--background); */ /* Color de fondo de la empresa */
    /*background: rgba(255, 255, 255, 0.95);*/
    background: color-mix(in srgb, var(--background) 95%, transparent);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    /*border: 2px solid rgba(255, 255, 255, 0.3);*/
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    height: calc(98vh - 2rem); /* ✅ Restar los márgenes */
    display: flex;
    flex-direction: column;
}


/* ===== HEADER ===== */
.chatbot-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-logo {
    width: auto;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}

    .company-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

.chatbot-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.chatbot-title p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.chatbot-meta {
    margin-left: auto;
    text-align: right;
}

    .chatbot-meta small {
        color: var(--secondary);
        opacity: 0.9;
        font-size: 0.8rem;
    }

.progress-percentage,
.preview-secondary-badge {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== BARRA DE PROGRESO ===== */
.progress-container {
    padding: 1rem 2rem;
    background: white;
}

.enhanced-slider-progress {
    background: rgba(var(--primary-rgb), 0.04);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--secondary);
    position: relative;
    overflow: hidden;
}

    .enhanced-slider-progress::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
        animation: shimmer 3s infinite;
    }

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.slider-top-enhanced {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 2;
}

.slider-message-enhanced {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.motivational-icon {
    font-size: 1.1rem;
    animation: continuousBounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes continuousBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-3px) scale(1.05);
    }

    50% {
        transform: translateY(-6px) scale(1.1);
    }

    75% {
        transform: translateY(-3px) scale(1.05);
    }
}

.slider-time-enhanced {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

    .slider-time-enhanced::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent);
        animation: timeShimmer 2s infinite;
    }

@keyframes timeShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.slider-bar-enhanced {
    height: 6px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.75rem;
}

.slider-fill-enhanced {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    animation: progressFlow 3s linear infinite;
    position: relative;
}

@keyframes progressFlow {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.slider-fill-enhanced::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -3px;
    width: 6px;
    height: 6px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
    animation: glowPulse 1.5s infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
        transform: translateY(-50%) scale(1);
    }

    50% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.7);
        transform: translateY(-50%) scale(1.2);
    }
}

.motivational-detail {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    position: relative;
    z-index: 2;
    animation: textFade 4s ease-in-out infinite;
}

@keyframes textFade {
    0%, 100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* ===== ÁREA DE MENSAJES ===== */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.powered-by-link {
    color: var(--secondary) !important;
    opacity: 0.9;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

    .powered-by-link:hover {
        color: var(--secondary) !important;
        opacity: 1;
        text-decoration: none;
    }

.preview-secondary-accent {
    border-left: 4px solid var(--secondary);
    padding-left: 1rem;
    margin: 1rem 0;
}

.message {
    display: flex;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
    max-width: 85%;
}

.user-message {
    align-self: flex-end;
    max-width: 70%;
}

.message-content {
    background: white;
    padding: 1.25rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.bot-message .message-content {
    border-bottom-left-radius: 8px;
}

.user-message .message-content {
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 8px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.avatar-user {
    background: var(--secondary);
}
/* ===== INDICADOR DE ESCRITURA ===== */
.typing-dots {
    display: flex;
    gap: 0.25rem;
}

    .typing-dots div {
        width: 6px;
        height: 6px;
        background: #6b7280;
        border-radius: 50%;
        animation: bounce 1.5s infinite;
    }

        .typing-dots div:nth-child(2) {
            animation-delay: 0.3s;
        }

        .typing-dots div:nth-child(3) {
            animation-delay: 0.6s;
        }

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ===== GRID DE OPCIONES ===== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.option-card {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .option-card:hover {
        border-color: var(--primary);
        transform: translateY(-1px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
        background: rgba(var(--primary-rgb), 0.15);
    }

    .option-card.selected {
        border-color: var(--primary);
        background: rgba(var(--primary-rgb), 0.06); /* Más sutil */
        box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.12); /* Más sutil */
    }

.option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary); /* Sin gradiente */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.option-title {
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.option-subtitle {
    color: var(--secondary);
    font-size: 0.875rem;
    margin: 0;
}

.checkmark {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: white;
    opacity: 0;
    transition: all 0.3s ease;
}

.option-card.selected .checkmark {
    opacity: 1;
    border-color: var(--primary);
    background: var(--primary);
}

    .option-card.selected .checkmark::after {
        content: '✓';
        color: white;
        font-size: 12px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

/* ===== BOTONES MODERNOS ===== */
.btn-modern {
    border-radius: 20px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary-modern {
    background: var(--primary);
    color: white;
}

    .btn-primary-modern:hover {
        background: var(--primary);
        filter: brightness(0.9); /* Oscurecer al hover */
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.3);
        color: white;
        text-decoration: none;
    }

/* Step indicators */
.step-indicator.active {
    background: var(--primary);
}

.step-indicator.completed {
    background: var(--accent);
}

.btn-success-modern {
    background: var(--accent);
    color: white;
}

    .btn-success-modern:hover {
        background: var(--accent);
        filter: brightness(0.9);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.3);
    }

.btn-secondary-modern {
    background: var(--secondary);
    color: white;
}

    .btn-secondary-modern:hover {
        background: var(--secondary);
        filter: brightness(0.9);
        transform: translateY(-2px);
        color: white;
        text-decoration: none;
    }

/* ===== INPUTS DE DIMENSIONES ===== */
.dimension-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.dimension-input {
    position: relative;
}

    .dimension-input input {
        width: 100%;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        padding: 0.75rem;
        text-align: center;
        font-size: 1rem;
        transition: border-color 0.3s ease;
    }

        .dimension-input input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

.dimension-label {
    position: absolute;
    top: -8px;
    left: 12px;
    background: white;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== ÁREA DE INPUT ===== */
.chatbot-input-section {
    background: white;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
}

.input-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-field {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

    .input-field:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

.send-button {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .send-button:hover {
        transform: scale(1.05);
    }

    .send-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

/* ===== INDICADORES DE CARGA ===== */
.message-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== COMPONENTES DE FOTOS ===== */
.photo-upload-component {
    margin: 1rem 0;
}

.photo-upload-area {
    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .photo-upload-area:hover {
        border-color: var(--primary);
        background: rgba(99, 102, 241, 0.05);
    }

    .photo-upload-area.dragover {
        border-color: var(--primary);
        background: rgba(99, 102, 241, 0.1);
        transform: scale(1.02);
    }

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-actions {
    margin-top: 1rem;
}

.photo-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.photo-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

    .photo-item:hover {
        border-color: var(--primary);
        transform: scale(1.05);
    }

    .photo-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.photo-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .photo-remove:hover {
        background: #dc2626;
        transform: scale(1.1);
    }

.photo-actions {
    margin-top: 1rem;
}

/* ===== FORMULARIO DE CONTACTO ===== */
.contact-form-component {
    margin: 1rem 0;
}

.contact-summary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
}

    .contact-summary ul {
        margin: 0.5rem 0 0 0;
        padding-left: 1.5rem;
        font-size: 0.875rem;
    }

.contact-fields {
    margin-top: 1rem;
}

.contact-preferences {
    margin: 0.1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

    .contact-checkbox input[type="checkbox"] {
        margin: 0;
        transform: scale(1.1);
    }

    .contact-checkbox.required {
        font-weight: 500;
    }

.contact-field {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

    .contact-field:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

/* ===== MENSAJE DE FINALIZACIÓN ===== */
.completion-message {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(99, 102, 241, 0.05));
    border-radius: 16px;
    margin: 1rem 0;
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.completion-message h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.completion-benefits {
    background: #f0fdf4;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #22c55e;
    margin: 1.5rem 0;
    text-align: left;
}

    .completion-benefits ul {
        margin: 0.5rem 0 0 0;
        padding-left: 1.5rem;
        font-size: 0.875rem;
    }

.completion-email-notice {
    background: #fffbeb;
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
    margin: 1rem 0;
}

    .completion-email-notice p {
        margin: 0;
        font-size: 0.875rem;
    }

        .completion-email-notice p:first-child {
            font-weight: 600;
        }

.completion-actions {
    margin-top: 2rem;
}

.completion-redirect {
    margin-top: 1rem;
}

    .completion-redirect small {
        color: var(--text-light);
    }

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    80% {
        transform: translateY(-5px);
    }
}

/* ===== MENSAJES TEMPORALES ===== */
.temporary-message {
    animation: slideInAndOut 3s ease-in-out;
}

@keyframes slideInAndOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    10%, 90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.temporary-message.error .message-content {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #dc2626;
}

.temporary-message.info .message-content {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1d4ed8;
}

/* ===== MEJORAS RESPONSIVE ===== */
@media (max-width: 768px) {
    .photo-container {
        justify-content: center;
    }

    .photo-item {
        width: 80px;
        height: 80px;
    }

    .contact-preferences {
        gap: 1rem;
    }

    .completion-message {
        padding: 1.5rem;
    }

    .completion-icon {
        font-size: 3rem;
    }

    .contact-summary {
        padding: 1rem;
    }
}

/* Indicador de escritura */
.typing-indicator {
    animation: fadeInUp 0.5s ease;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-style: italic;
    font-size: 0.875rem;
}

.typing-text {
    opacity: 0.8;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #6b7280;
    animation: typingDot 1.4s infinite;
}

    .typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================================
   ANIMACIONES SUAVES PARA MENSAJES DEL CHATBOT
   =============================================== */

/* Animación base para todos los mensajes */
.message {
    transform-origin: left center;
    animation-fill-mode: both;
}

/* Animación de entrada para mensajes del bot */
.bot-message {
    animation: slideInFromLeft 0.5s ease-out;
}

/* Animación de entrada para mensajes del usuario */
.user-message {
    animation: slideInFromRight 0.5s ease-out;
}

/* Keyframes para entrada desde la izquierda (bot) */
@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px) translateY(20px) scale(0.95);
    }

    50% {
        opacity: 0.7;
        transform: translateX(-10px) translateY(10px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

/* Keyframes para entrada desde la derecha (usuario) */
@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(30px) translateY(20px) scale(0.95);
    }

    50% {
        opacity: 0.7;
        transform: translateX(10px) translateY(10px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

/* Animación para el avatar */
.message-avatar {
    animation: avatarBounceIn 0.6s ease-out 0.1s both;
}

@keyframes avatarBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(5deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Animación para el contenido del mensaje */
.message-content {
    animation: contentFadeInUp 0.5s ease-out 0.2s both;
}

@keyframes contentFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animaciones para botones y opciones */
.option-card, .btn-modern, button {
    transition: all 0.3s ease;
}

.option-card {
    animation: optionSlideIn 0.4s ease-out both;
}

@keyframes optionSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animación staggered para múltiples opciones */
.option-card:nth-child(1) {
    animation-delay: 0.3s;
}

.option-card:nth-child(2) {
    animation-delay: 0.4s;
}

.option-card:nth-child(3) {
    animation-delay: 0.5s;
}

.option-card:nth-child(4) {
    animation-delay: 0.6s;
}

.option-card:nth-child(5) {
    animation-delay: 0.7s;
}

/* Hover effects mejorados */
.option-card:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Animación para inputs de formulario */
.form-group {
    animation: formSlideIn 0.5s ease-out both;
}

@keyframes formSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stagger para inputs de formulario */
.form-group:nth-child(1) {
    animation-delay: 0.4s;
}

.form-group:nth-child(2) {
    animation-delay: 0.5s;
}

.form-group:nth-child(3) {
    animation-delay: 0.6s;
}

.form-group:nth-child(4) {
    animation-delay: 0.7s;
}

/* Animación para el indicador de typing mejorada */
.typing-indicator {
    animation: typingSlideIn 0.4s ease-out;
}

@keyframes typingSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animación de salida para typing */
.typing-indicator.hiding {
    animation: typingSlideOut 0.3s ease-in forwards;
}

@keyframes typingSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* ===============================================
   ANIMACIONES ESPECIALES
   =============================================== */

/* Animación de "escritura" para texto */
.typing-text-effect {
    overflow: hidden;
    border-right: 2px solid #3b82f6;
    animation: typewriter 2s steps(40) 1s both, blinkCursor 1s infinite;
}

@keyframes typewriter {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

@keyframes blinkCursor {
    0%, 50% {
        border-color: #3b82f6;
    }

    51%, 100% {
        border-color: transparent;
    }
}

/* Animación de "bounce" para mensajes importantes */
.message.important {
    animation: importantBounce 0.8s ease-out;
}

@keyframes importantBounce {
    0% {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }

    50% {
        transform: scale(1.05) translateY(-5px);
        opacity: 0.9;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===============================================
   MICRO-INTERACCIONES
   =============================================== */

/* Animación cuando se selecciona una opción */
.option-card.selected {
    animation: optionSelected 0.3s ease-out;
}

@keyframes optionSelected {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Animación para botones al hacer clic */
.btn-modern:active {
    transform: scale(0.98) translateY(0);
    transition: transform 0.1s ease;
}

/* ===============================================
   CONFIGURACIONES DE PERFORMANCE
   =============================================== */

/* Optimización para animaciones */
.message, .option-card, .btn-modern, .typing-indicator {
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reducir animaciones si el usuario prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .message,
    .option-card,
    .btn-modern,
    .typing-indicator,
    .message-avatar,
    .message-content {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }
}

/* ===============================================
   ANIMACIONES PARA MÓVIL
   =============================================== */

@media (max-width: 768px) {
    /* Animaciones más rápidas en móvil */
    .message {
        animation-duration: 0.3s !important;
    }

    .option-card {
        animation-duration: 0.3s !important;
    }

        /* Menos stagger en móvil */
        .option-card:nth-child(n) {
            animation-delay: 0.1s !important;
        }
}

/* ===== CSS FALTANTE PARA TUS DIMENSION INPUTS ===== */

/* Corrección para tu estructura HTML actual */
.dimension-input {
    position: relative;
    margin-bottom: 1rem; /* Espacio para el label superior */
}

/* El label está ENCIMA del input en tu HTML */
.dimension-label {
    position: absolute;
    top: -10px; /* Posición encima del input */
    left: 12px;
    background: white;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    pointer-events: none;
    z-index: 100 !important; /* Muy alto para evitar que se tape */
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
    white-space: nowrap;
}

/* CSS para .dimension-field (que faltaba) */
.dimension-field {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    padding-top: 1rem; /* Espacio extra arriba para el label */
    text-align: center;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
    position: relative;
    z-index: 2;
}

    .dimension-field:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        z-index: 3;
    }

    .dimension-field:invalid {
        border-color: #ef4444;
    }

    .dimension-field::placeholder {
        color: var(--text-light);
        opacity: 0.7;
    }

/* Estado cuando el input tiene focus o valor */
.dimension-input .dimension-field:focus ~ .dimension-label,
.dimension-input .dimension-field:not(:placeholder-shown) ~ .dimension-label {
    color: var(--primary);
    font-weight: 600;
    transform: scale(0.95);
    z-index: 101 !important;
}

/* Fix para asegurar que los labels sean visibles durante animaciones */
.message .dimension-inputs {
    z-index: 20 !important;
    position: relative;
}

.message .dimension-label {
    z-index: 21 !important;
    background: white !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Contenedor estable durante animaciones */
.dimension-inputs {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.98);
/*    padding: 1rem;*/
    border-radius: 1rem;
/*    margin: 1rem 0;*/
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dimension-inputs {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .dimension-field {
        padding: 0.875rem;
        padding-top: 1.25rem;
        font-size: 1.1rem;
    }

    .dimension-label {
        top: -12px;
        font-size: 0.8rem;
        left: 16px;
        z-index: 150 !important;
    }
}

/* ===== DEBUGGING TEMPORAL ===== */
/* Descomenta si sigues teniendo problemas para ver dónde están los elementos */
/*
.dimension-label {
    background: rgba(255, 0, 0, 0.3) !important;
    border: 1px solid red !important;
    color: black !important;
}

.dimension-field {
    border: 2px solid blue !important;
}
*/

/* ===== COMPONENTES DE FOTOS MEJORADOS ===== */

.photo-upload-component {
    margin: 1rem 0;
    position: relative;
    z-index: 5;
}

.photo-upload-area {
    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .photo-upload-area:hover {
        border-color: var(--primary);
        background: rgba(99, 102, 241, 0.05);
    }

    .photo-upload-area.dragover {
        border-color: var(--primary);
        background: rgba(99, 102, 241, 0.1);
        transform: scale(1.02);
    }

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== PREVIEW DE FOTOS ===== */

.photo-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.photo-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    justify-content: center;
}

.photo-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .photo-item:hover {
        border-color: var(--primary);
        transform: scale(1.05);
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
    }

    .photo-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* ===== BOTÓN DE ELIMINAR MEJORADO ===== */

.photo-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    line-height: 1;
    padding: 0;
}

    .photo-remove:hover {
        background: #dc2626;
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    }

    .photo-remove:active {
        transform: scale(0.95);
    }

    .photo-remove span {
        display: inline-block;
        line-height: 1;
        font-size: 12px;
        margin-top: -1px; /* Ajuste fino para centrar */
    }

/* ===== BOTONES DE ACCIÓN ===== */

.photo-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

    .photo-actions .btn-modern {
        min-width: 160px;
        font-size: 0.95rem;
    }

/* ===== ESTADOS ESPECIALES ===== */

/* Cuando no hay fotos */
.photo-upload-component .photo-preview[style*="display: none"] + .photo-actions #continueWithPhotos {
    display: none !important;
}

/* Cuando hay fotos */
.photo-upload-component .photo-preview:not([style*="display: none"]) + .photo-actions #continueWithPhotos {
    display: inline-block !important;
}

/* Estado de máximo alcanzado */
.photo-upload-area.max-reached {
    background: #f0fdf4;
    border-color: #22c55e;
    cursor: default;
}

    .photo-upload-area.max-reached:hover {
        background: #f0fdf4;
        border-color: #22c55e;
        transform: none;
    }

/* ===== ANIMACIONES ===== */

.photo-item {
    animation: photoAppear 0.5s ease-out;
}

@keyframes photoAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Animación de eliminación */
.photo-item.removing {
    animation: photoRemove 0.3s ease-in forwards;
}

@keyframes photoRemove {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .photo-container {
        justify-content: center;
        gap: 0.75rem;
    }

    .photo-item {
        width: 80px;
        height: 80px;
    }

    .photo-remove {
        width: 22px;
        height: 22px;
        top: -6px;
        right: -6px;
        font-size: 12px;
    }

    .photo-actions {
        flex-direction: column;
        align-items: center;
    }

        .photo-actions .btn-modern {
            min-width: 200px;
        }

    .upload-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
}

/* ===== INDICADORES VISUALES ===== */

/* Contador de fotos */
.photo-counter {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Indicador de drag activo */
.photo-upload-area.dragover::before {
    content: '📸 Suelta las fotos aquí';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(99, 102, 241, 0.95);
    color: white;
    padding: 1rem 2rem;
    border-radius: 20px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
}

/* ===== ANIMACIONES CORREGIDAS PARA INPUTS ===== */

/* Estado inicial para mensajes que contienen inputs */
.message.animating {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    transition: none !important;
}

/* Estado inicial específico para dimension inputs */
.dimension-inputs.pre-animation {
    opacity: 0 !important;
    transform: translateY(15px) !important;
    transition: none !important;
}

/* Estado inicial para contact form */
.contact-form-component.pre-animation {
    opacity: 0 !important;
    transform: translateY(15px) !important;
    transition: none !important;
}

/* Estado inicial para inputs individuales */
.dimension-input.pre-animation,
.contact-field.pre-animation {
    opacity: 0 !important;
    transform: translateY(10px) scale(0.98) !important;
    transition: none !important;
}

/* ===== ANIMACIONES DE ENTRADA SUAVES ===== */

/* Animación principal del mensaje */
.message.entering {
    animation: messageSlideIn 0.5s ease-out forwards;
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animación para contenedores de inputs */
.dimension-inputs.entering {
    animation: inputContainerFadeIn 0.6s ease-out 0.2s forwards;
}

.contact-form-component.entering {
    animation: inputContainerFadeIn 0.6s ease-out 0.2s forwards;
}

@keyframes inputContainerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación escalonada para inputs individuales */
.dimension-input.entering {
    animation: inputSlideIn 0.4s ease-out forwards;
}

.dimension-input:nth-child(1).entering {
    animation-delay: 0.3s;
}

.dimension-input:nth-child(2).entering {
    animation-delay: 0.4s;
}

.dimension-input:nth-child(3).entering {
    animation-delay: 0.5s;
}

/* Para el formulario de contacto */
.contact-field.entering {
    animation: inputSlideIn 0.4s ease-out forwards;
}

.contact-field:nth-child(1).entering {
    animation-delay: 0.3s;
}

.contact-field:nth-child(2).entering {
    animation-delay: 0.4s;
}

.contact-field:nth-child(3).entering {
    animation-delay: 0.5s;
}

@keyframes inputSlideIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animación para botones */
.btn-modern.entering {
    animation: buttonPopIn 0.4s ease-out 0.7s forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes buttonPopIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    70% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== OVERRIDE DE ANIMACIONES CSS EXISTENTES ===== */

/* Deshabilitar animaciones CSS automáticas para elementos con inputs */
.message:has(.dimension-inputs),
.message:has(.contact-form-component) {
    animation: none !important;
}

.bot-message:has(.dimension-inputs),
.bot-message:has(.contact-form-component) {
    animation: none !important;
}

/* ===== FALLBACK PARA NAVEGADORES SIN :has() ===== */
.message.has-inputs {
    animation: none !important;
}

.bot-message.has-inputs {
    animation: none !important;
}

/* ===== OPTIMIZACIÓN DE RENDIMIENTO ===== */
.dimension-inputs,
.contact-form-component,
.dimension-input,
.contact-field {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Animaciones más rápidas en móvil */
    .message.entering,
    .dimension-inputs.entering,
    .contact-form-component.entering,
    .dimension-input.entering,
    .contact-field.entering {
        animation-duration: 0.3s !important;
    }

    /* Delays menores en móvil */
    .dimension-input:nth-child(1).entering {
        animation-delay: 0.1s !important;
    }

    .dimension-input:nth-child(2).entering {
        animation-delay: 0.15s !important;
    }

    .dimension-input:nth-child(3).entering {
        animation-delay: 0.2s !important;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    .message.entering,
    .dimension-inputs.entering,
    .contact-form-component.entering,
    .dimension-input.entering,
    .contact-field.entering,
    .btn-modern.entering {
        animation: simpleAppear 0.2s ease-out forwards !important;
    }
}

@keyframes simpleAppear {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* ===== LOGO EN MÓVIL - CORRECCIÓN COMPLETA ===== */

/* Contenedor del logo */
.company-logo {
    width: auto;
    height: 50px;
    min-width: 50px; /* ✅ Ancho mínimo para prevenir que se aplaste */
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: visible; /* ✅ Cambiar de hidden a visible */
    flex-shrink: 0; /* ✅ Prevenir que se encoja */
    position: relative; /* ✅ Para control de posicionamiento */
}

    /* Imagen del logo */
    .company-logo img {
        width: auto; /* ✅ Mantener proporción */
        height: 100%;
        max-width: none; /* ✅ Permitir que sea más ancho que el contenedor si es necesario */
        object-fit: contain; /* ✅ Mantener proporción sin recortar */
        border-radius: 8px;
        display: block; /* ✅ Eliminar espacios inline */
    }

/* Header responsive */
.chatbot-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap; /* ✅ No permitir wrap en el header */
    min-height: 80px; /* ✅ Altura mínima */
}

/* Título responsive */
.chatbot-title {
    flex: 1; /* ✅ Tomar espacio disponible */
    min-width: 0; /* ✅ Permitir que se contraiga */
}

    .chatbot-title h1 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
        white-space: nowrap; /* ✅ Evitar salto de línea */
        overflow: hidden;
        text-overflow: ellipsis; /* ✅ Mostrar ... si es muy largo */
    }

    .chatbot-title p {
        margin: 0;
        opacity: 0.8;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* Meta información */
.chatbot-meta {
    flex-shrink: 0; /* ✅ No permitir que se encoja */
    text-align: right;
}

/* ===== RESPONSIVE DESIGN PARA MÓVIL ===== */

/* Tablets */
@media (max-width: 992px) {
    .chatbot-header {
        padding: 1.25rem 1.5rem;
        gap: 0.75rem;
    }

    .company-logo {
        height: 45px;
        min-width: 45px;
    }

    .chatbot-title h1 {
        font-size: 1.3rem;
    }

    .chatbot-title p {
        font-size: 0.85rem;
    }
}

/* Móvil */
@media (max-width: 768px) {
    .chatbot-header {
        padding: 1rem 1rem;
        gap: 0.5rem;
        min-height: 70px;
    }

    .company-logo {
        height: 40px;
        min-width: 40px;
        flex-shrink: 0;
    }

    .chatbot-title h1 {
        font-size: 1.1rem;
    }

    .chatbot-title p {
        font-size: 0.8rem;
    }

    .chatbot-meta {
        display: none; /* ✅ Ocultar en móvil para dar más espacio */
    }
}

/* Móvil pequeño */
@media (max-width: 576px) {
    .chatbot-header {
        padding: 0.75rem;
        gap: 0.5rem;
        min-height: 60px;
    }

    .company-logo {
        height: 35px;
        min-width: 35px;
        border-radius: 8px;
    }

    .chatbot-title h1 {
        font-size: 1rem;
        max-width: 200px; /* ✅ Limitar ancho máximo */
    }

    .chatbot-title p {
        font-size: 0.75rem;
        max-width: 200px;
    }
}

/* Móvil muy pequeño */
@media (max-width: 480px) {
    .chatbot-header {
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .company-logo {
        height: 30px;
        min-width: 30px;
        border-radius: 6px;
    }

    .chatbot-title h1 {
        font-size: 0.9rem;
        max-width: 150px;
    }

    .chatbot-title p {
        font-size: 0.7rem;
        max-width: 150px;
    }
}

/* ===== CASOS ESPECÍFICOS DE LOGO ===== */

/* Logo muy ancho */
.company-logo.wide-logo {
    width: auto;
    max-width: 120px; /* ✅ Ancho máximo para logos anchos */
    height: 40px;
}

/* Logo cuadrado */
.company-logo.square-logo {
    width: 50px;
    height: 50px;
}

/* Logo vertical */
.company-logo.tall-logo {
    width: auto;
    min-width: 30px;
    max-width: 80px;
    height: 50px;
}

/* ===== SOLUCIÓN ALTERNATIVA: HEADER ADAPTATIVO ===== */

/* Si el logo sigue causando problemas, usar esta versión alternativa */
@media (max-width: 768px) {
    .chatbot-header.alternative-layout {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        gap: 0.5rem;
        text-align: center;
    }

        .chatbot-header.alternative-layout .company-logo {
            height: 50px;
            width: auto;
            min-width: auto;
            max-width: 200px;
        }

        .chatbot-header.alternative-layout .chatbot-title h1,
        .chatbot-header.alternative-layout .chatbot-title p {
            white-space: normal;
            max-width: none;
        }

        .chatbot-header.alternative-layout .chatbot-meta {
            display: block;
        }
}

/* ===== DEBUG TEMPORAL ===== */
/* Descomenta estas líneas para debug visual: */
/*
.company-logo {
    border: 2px solid red !important;
}

.company-logo img {
    border: 1px solid blue !important;
}

.chatbot-header {
    border: 2px solid green !important;
}
*/

.btn-continuar,
.btn-send {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

    .btn-continuar:hover,
    .btn-send:hover {
        background: var(--primary);
        filter: brightness(0.9); /* Oscurecer al hover */
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.3);
        color: white;
        text-decoration: none;
    }

/* Typing indicator dinámico */
.typing-indicator .dot {
    background-color: var(--primary);
}

/* Progress fill dinámico */
.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

    .progress-fill::after {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    }

/* Form controls dinámicos */
.form-control:focus,
.dimension-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08); /* Más sutil */
    outline: none;
}

/* Loading spinner dinámico */
.loading-indicator .spinner {
    border-top-color: var(--primary);
}

/* Message user dinámico */
.message-user .message-content {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

/* Checkmark dinámico */
.option-card.selected .checkmark {
    border-color: var(--primary);
    background: var(--primary);
}

/* Input container y send button */
#messageInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

#sendButton {
    background: var(--primary);
}

    #sendButton:hover:not(:disabled) {
        background: var(--primary);
        filter: brightness(0.9);
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.3);
    }

/* Avatar del mensaje bot */
.message-bot .message-avatar {
    background: var(--primary); /* Sin gradiente */
    color: white;
}

/* Powered by link dinámico */
.powered-by-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

.typing-indicator .dot {
    background-color: var(--primary);
}

.message-timestamp {
    color: var(--secondary);
    opacity: 0.6;
}

.option-card.loading .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 15px;
    right: 15px;
}

.option-card.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.option-card.error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #f5e8e8 100%);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== ESTILOS PARA OPCIONES DE DIRECCIÓN ===== */

.address-options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    max-width: 100%;
}

.address-option {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius-lg, 12px);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .address-option:hover {
        border-color: var(--primary, #6366f1);
        background: #f8faff;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
    }

    .address-option:active {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    }

.address-main {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.address-details {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.3;
}

.retry-option {
    border-color: #fbbf24;
    background: #fffbeb;
}

    .retry-option:hover {
        border-color: #f59e0b;
        background: #fef3c7;
    }

    .retry-option .address-main {
        color: #d97706;
    }

    .retry-option .address-details {
        color: #92400e;
    }

/* ===== EFECTOS VISUALES ===== */

.address-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.address-option:hover::before {
    left: 100%;
}

/* ===== CONFIRMACIÓN ÚNICA (si se usa) ===== */

.address-confirmation-single {
    margin-top: 1rem;
    text-align: center;
}

.address-detected {
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    border-radius: var(--border-radius-lg, 12px);
    padding: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #0c4a6e;
}

.confirmation-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .address-options-container {
        gap: 0.5rem;
    }

    .address-option {
        padding: 0.875rem;
    }

    .address-main {
        font-size: 0.95rem;
    }

    .address-details {
        font-size: 0.8rem;
    }

    .confirmation-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

        .confirmation-buttons .btn-modern {
            width: 100%;
            justify-content: center;
        }
}

@media (max-width: 480px) {
    .address-option {
        padding: 0.75rem;
    }

    .address-main {
        font-size: 0.9rem;
        margin-bottom: 0.125rem;
    }

    .address-details {
        font-size: 0.75rem;
    }
}

/* ===== ACCESIBILIDAD ===== */

.address-option:focus {
    outline: 3px solid rgba(99, 102, 241, 0.3);
    outline-offset: 2px;
}

    .address-option:focus:not(:focus-visible) {
        outline: none;
    }

/* ===== ANIMACIONES DE ENTRADA ===== */

.address-option {
    animation: slideInUp 0.3s ease-out;
}

    .address-option:nth-child(1) {
        animation-delay: 0.1s;
    }

    .address-option:nth-child(2) {
        animation-delay: 0.2s;
    }

    .address-option:nth-child(3) {
        animation-delay: 0.3s;
    }

    .address-option:nth-child(4) {
        animation-delay: 0.4s;
    }

    .address-option:nth-child(5) {
        animation-delay: 0.5s;
    }

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== ESTADOS DE LOADING ===== */

.address-option.loading {
    pointer-events: none;
    opacity: 0.6;
}

    .address-option.loading::after {
        content: '⏳';
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
        animation: pulse 1.5s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== TEMA OSCURO (opcional) ===== */

@media (prefers-color-scheme: dark) {
    .address-option {
        background: #374151;
        border-color: #4b5563;
    }

        .address-option:hover {
            background: #4b5563;
            border-color: var(--primary, #6366f1);
        }

    .address-main {
        color: #f9fafb;
    }

    .address-details {
        color: #d1d5db;
    }

    .retry-option {
        background: #451a03;
        border-color: #92400e;
    }

        .retry-option:hover {
            background: #78350f;
        }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}