/**
 * Estilos del Chatbot - Ruta 45 Tours
 * Diseño responsive y moderno
 */

/* ==========================================
   VARIABLES
   ========================================== */
:root {
    --chatbot-primary: #8b4513;
    --chatbot-secondary: #d2691e;
    --chatbot-accent: #cd853f;
    --chatbot-success: #28a745;
    --chatbot-danger: #dc3545;
    --chatbot-warning: #ffc107;
    --chatbot-info: #17a2b8;
    
    --chatbot-bg-light: #ffffff;
    --chatbot-bg-dark: #f8f9fa;
    --chatbot-bg-message-user: #e8f5e9;
    --chatbot-bg-message-bot: #f5f5f5;
    --chatbot-bg-message-system: #fff3cd;
    
    --chatbot-text-dark: #333333;
    --chatbot-text-light: #666666;
    --chatbot-text-white: #ffffff;
    
    --chatbot-border: #e0e0e0;
    --chatbot-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --chatbot-shadow-hover: 0 6px 30px rgba(0, 0, 0, 0.2);
    
    --chatbot-border-radius: 12px;
    --chatbot-transition: all 0.3s ease;
    
    --chatbot-z-index: 9999;
}

/* ==========================================
   BOTÓN FLOTANTE
   ========================================== */
.chatbot-float-button {
    position: fixed;
    bottom: 95px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border: none;
    border-radius: 50%;
    color: var(--chatbot-text-white);
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: var(--chatbot-transition);
    z-index: var(--chatbot-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-chatbot 2s infinite;
}

.chatbot-float-button:hover {
    transform: scale(1.1);
    box-shadow: var(--chatbot-shadow-hover);
}

.chatbot-float-button.active {
    transform: scale(0.9);
}

/* Badge de notificaciones */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--chatbot-danger);
    color: var(--chatbot-text-white);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Animación de pulso */
@keyframes pulse-chatbot {
    0% {
        box-shadow: 0 4px 20px rgba(139, 69, 19, 0.4), 0 0 0 0 rgba(139, 69, 19, 0.7);
    }
    70% {
        box-shadow: 0 4px 20px rgba(139, 69, 19, 0.4), 0 0 0 15px rgba(139, 69, 19, 0);
    }
    100% {
        box-shadow: 0 4px 20px rgba(139, 69, 19, 0.4), 0 0 0 0 rgba(139, 69, 19, 0);
    }
}

/* ==========================================
   VENTANA DEL CHATBOT
   ========================================== */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--chatbot-bg-light);
    border-radius: var(--chatbot-border-radius);
    box-shadow: var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--chatbot-z-index);
    animation: slideInUp 0.3s ease-out;
}

/* Soporte para notch de iPhone y safe areas */
@supports (padding: max(0px)) {
    .chatbot-window {
        padding-top: env(safe-area-inset-top);
    }
}

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

/* ==========================================
   HEADER
   ========================================== */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: var(--chatbot-text-white);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--chatbot-border-radius) var(--chatbot-border-radius) 0 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--chatbot-success);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: var(--chatbot-text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    font-size: 0.9rem;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ==========================================
   ÁREA DE MENSAJES
   ========================================== */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* NO permitir scroll horizontal */
    padding: 20px;
    background: var(--chatbot-bg-dark);
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-text-light);
}

/* Mensaje de bienvenida */
.chatbot-welcome-message {
    background: var(--chatbot-bg-light);
    padding: 24px;
    border-radius: var(--chatbot-border-radius);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.chatbot-welcome-message h4 {
    margin: 0 0 8px 0;
    color: var(--chatbot-primary);
    font-size: 1.1rem;
}

.chatbot-welcome-message p {
    margin: 0;
    color: var(--chatbot-text-light);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Mensajes */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.chatbot-message-bot .message-avatar {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: var(--chatbot-text-white);
}

.chatbot-message-user .message-avatar {
    background: var(--chatbot-success);
    color: var(--chatbot-text-white);
}

.chatbot-message-system .message-avatar {
    background: var(--chatbot-warning);
    color: var(--chatbot-text-dark);
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* Permite que el contenido se comprima */
    max-width: 100%; /* No exceder el ancho disponible */
    overflow: hidden; /* Prevenir overflow horizontal */
}

.message-text {
    background: var(--chatbot-bg-light);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--chatbot-text-dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chatbot-message-user .message-text {
    background: var(--chatbot-bg-message-user);
}

.chatbot-message-bot .message-text {
    background: var(--chatbot-bg-message-bot);
}

.chatbot-message-system .message-text {
    background: var(--chatbot-bg-message-system);
}

.message-text a {
    color: var(--chatbot-primary);
    text-decoration: underline;
}

.message-text a:hover {
    color: var(--chatbot-secondary);
}

.message-time {
    font-size: 0.7rem;
    color: var(--chatbot-text-light);
    padding: 0 8px;
}

/* Mensaje de voucher */
.chatbot-message-voucher {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.voucher-container {
    background: var(--chatbot-bg-light);
    border: 2px solid var(--chatbot-success);
    border-radius: var(--chatbot-border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.voucher-header {
    background: var(--chatbot-success);
    color: var(--chatbot-text-white);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.voucher-header i {
    font-size: 1.5rem;
}

.voucher-header h4 {
    margin: 0;
    font-size: 1rem;
}

.voucher-body {
    padding: 16px;
    text-align: center;
}

.voucher-body p {
    margin: 0 0 16px 0;
    color: var(--chatbot-text-dark);
    font-size: 0.9rem;
}

.voucher-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--chatbot-primary);
    color: var(--chatbot-text-white);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--chatbot-transition);
}

.voucher-download-btn:hover {
    background: var(--chatbot-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

/* ==========================================
   INDICADOR DE ESCRITURA
   ========================================== */
.chatbot-typing-indicator {
    padding: 0 20px 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--chatbot-bg-dark);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chatbot-text-light);
    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);
    }
}

.typing-text {
    font-size: 0.8rem;
    color: var(--chatbot-text-light);
    font-style: italic;
}

/* ==========================================
   ÁREA DE INPUT
   ========================================== */
.chatbot-input-area {
    background: var(--chatbot-bg-light);
    padding: 16px;
    border-top: 1px solid var(--chatbot-border);
}

/* Preview de archivo */
.chatbot-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--chatbot-bg-dark);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    gap: 12px;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

#filePreviewImage {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--chatbot-border);
}

.file-preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

.file-preview-info i {
    color: var(--chatbot-primary);
    font-size: 1.2rem;
}

.file-preview-info span {
    font-size: 0.85rem;
    color: var(--chatbot-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#filePreviewSize {
    color: var(--chatbot-text-light);
    font-size: 0.75rem;
}

.file-preview-remove {
    width: 28px;
    height: 28px;
    background: var(--chatbot-danger);
    border: none;
    border-radius: 50%;
    color: var(--chatbot-text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    flex-shrink: 0;
}

.file-preview-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Container del input */
.chatbot-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chatbot-attach-btn {
    width: 40px;
    height: 40px;
    background: var(--chatbot-bg-dark);
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    color: var(--chatbot-text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    flex-shrink: 0;
}

.chatbot-attach-btn:hover:not(:disabled) {
    background: var(--chatbot-primary);
    color: var(--chatbot-text-white);
    border-color: var(--chatbot-primary);
}

.chatbot-attach-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: var(--chatbot-transition);
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.chatbot-input:disabled {
    background: var(--chatbot-bg-dark);
    cursor: not-allowed;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    background: var(--chatbot-primary);
    border: none;
    border-radius: 8px;
    color: var(--chatbot-text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    background: var(--chatbot-secondary);
    transform: scale(1.05);
}

.chatbot-send-btn:disabled {
    background: var(--chatbot-border);
    cursor: not-allowed;
}

/* Barra de progreso de upload */
.chatbot-upload-progress {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    height: 6px;
    background: var(--chatbot-bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--chatbot-primary), var(--chatbot-secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressAnimation 1.5s infinite;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

.progress-text {
    font-size: 0.8rem;
    color: var(--chatbot-text-light);
    text-align: center;
}

/* ==========================================
   FOOTER
   ========================================== */
.chatbot-footer {
    background: var(--chatbot-bg-dark);
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-footer-text {
    font-size: 0.75rem;
    color: var(--chatbot-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chatbot-footer-text i {
    color: var(--chatbot-success);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

/* Tablet */
@media (max-width: 768px) {
    .chatbot-float-button {
        bottom: 90px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }
    
    .chatbot-window {
        width: 360px;
        height: 550px;
        bottom: 100px;
        right: 15px;
    }
}

/* Móvil */
@media (max-width: 480px) {
    .chatbot-float-button {
        bottom: 85px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        max-width: none;
        max-height: none;
        border-radius: 0;
        position: fixed;
    }
    
    .chatbot-header {
        padding: 12px;
        border-radius: 0;
    }
    
    .chatbot-logo {
        width: 35px;
        height: 35px;
    }
    
    .chatbot-messages {
        padding: 12px;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden; /* NO permitir scroll horizontal */
        -webkit-overflow-scrolling: touch;
    }
    
    .chatbot-input-area {
        padding: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        flex-shrink: 0;
    }
    
    /* Asegurar que el área de mensajes se ajuste correctamente */
    .chatbot-messages {
        min-height: 0;
        flex: 1 1 auto;
    }
    
    /* Ajustar mensajes para mejor legibilidad */
    .message-text {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 10px 14px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* Ajustar input */
    .chatbot-input {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    /* Welcome message más compacto */
    .chatbot-welcome-message {
        padding: 16px;
    }
    
    .welcome-icon {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .chatbot-welcome-message h4 {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .chatbot-welcome-message p {
        font-size: 0.85rem;
    }
    
    /* Footer más compacto en móvil */
    .chatbot-footer {
        padding: 8px 10px;
        flex-shrink: 0;
    }
    
    .chatbot-footer-text {
        font-size: 0.7rem;
    }
    
    /* Typing indicator más compacto */
    .chatbot-typing-indicator {
        padding: 0 12px 8px 12px;
    }
    
    /* Ajustar botones en el input */
    .chatbot-attach-btn,
    .chatbot-send-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    /* File preview más compacto */
    .chatbot-file-preview {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    #filePreviewImage {
        width: 40px;
        height: 40px;
    }
}

/* Extra pequeño */
@media (max-width: 360px) {
    .chatbot-float-button {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .chatbot-header {
        padding: 10px;
    }
    
    .chatbot-header-text h3 {
        font-size: 0.85rem;
    }
    
    .chatbot-status {
        font-size: 0.65rem;
    }
    
    .chatbot-logo {
        width: 32px;
        height: 32px;
    }
    
    .chatbot-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .message-text {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .chatbot-messages {
        padding: 10px;
    }
}

/* ==========================================
   MODO OSCURO (OPCIONAL)
   ========================================== */
@media (prefers-color-scheme: dark) {
    /* Descomentar si quieres soportar modo oscuro automático
    :root {
        --chatbot-bg-light: #2c2c2c;
        --chatbot-bg-dark: #1e1e1e;
        --chatbot-text-dark: #e0e0e0;
        --chatbot-text-light: #b0b0b0;
        --chatbot-border: #444444;
    }
    */
}

/* ==========================================
   ACCESIBILIDAD
   ========================================== */
.chatbot-float-button:focus,
.chatbot-action-btn:focus,
.chatbot-attach-btn:focus,
.chatbot-send-btn:focus {
    outline: 3px solid var(--chatbot-accent);
    outline-offset: 2px;
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================
   MODAL DE TELÉFONO V2
   ========================================== */
.chatbot-phone-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: calc(var(--chatbot-z-index) + 1);
    animation: fadeIn 0.3s ease;
}

.phone-modal-content {
    background: var(--chatbot-bg-light);
    border-radius: var(--chatbot-border-radius);
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.4s ease;
}

.phone-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.phone-modal-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: var(--chatbot-primary);
    font-weight: 600;
}

.phone-modal-header p {
    margin: 5px 0;
    font-size: 1rem;
    color: var(--chatbot-text-dark);
}

.phone-modal-subtitle {
    font-size: 0.85rem !important;
    color: var(--chatbot-text-light) !important;
}

.phone-modal-body {
    margin-bottom: 20px;
}

.phone-input-group {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid var(--chatbot-border);
    border-radius: 8px;
    padding: 0;
    transition: var(--chatbot-transition);
    gap: 0;
}

.phone-input-group:focus-within {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

/* ⭐ NUEVO: Selector de país */
.country-selector-wrapper {
    position: relative;
}

.country-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 15px;
    background: var(--chatbot-bg-dark);
    border-right: 2px solid var(--chatbot-border);
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    user-select: none;
    transition: var(--chatbot-transition);
    min-width: 100px;
}

.country-selector:hover {
    background: #e9ecef;
}

.country-flag {
    font-size: 1.2rem;
    line-height: 1;
}

.country-code {
    font-weight: 600;
    color: var(--chatbot-text-dark);
    font-size: 1rem;
}

.country-dropdown-icon {
    font-size: 0.7rem;
    color: var(--chatbot-text-light);
    margin-left: 2px;
}

/* ⭐ NUEVO: Dropdown de países */
.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    max-height: 300px;
    background: var(--chatbot-bg-light);
    border: 2px solid var(--chatbot-border);
    border-radius: 8px;
    box-shadow: var(--chatbot-shadow);
    z-index: 10000;
    margin-top: 5px;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.country-dropdown-search {
    padding: 10px;
    border-bottom: 1px solid var(--chatbot-border);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--chatbot-bg-dark);
}

.country-dropdown-search i {
    color: var(--chatbot-text-light);
    font-size: 0.9rem;
}

.country-dropdown-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--chatbot-text-dark);
}

.country-dropdown-search input::placeholder {
    color: var(--chatbot-text-light);
}

.country-dropdown-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 5px 0;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--chatbot-transition);
    border-bottom: 1px solid #f0f0f0;
}

.country-item:hover {
    background: var(--chatbot-bg-dark);
}

.country-item.selected {
    background: rgba(139, 69, 19, 0.1);
    font-weight: 600;
}

.country-item .country-flag {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.country-item .country-name {
    flex: 1;
    color: var(--chatbot-text-dark);
    font-size: 0.9rem;
}

.country-item .country-code-text {
    color: var(--chatbot-text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Scrollbar personalizado para el dropdown */
.country-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.country-dropdown-list::-webkit-scrollbar-track {
    background: var(--chatbot-bg-dark);
}

.country-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
}

.country-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-text-light);
}

.phone-input-group input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--chatbot-text-dark);
    background: transparent;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
}

.phone-input-group input::placeholder {
    color: var(--chatbot-text-light);
}

.phone-input-error {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-input-error::before {
    content: "⚠️";
}

.phone-modal-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-phone-submit {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: var(--chatbot-text-white);
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--chatbot-transition);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-phone-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-phone-submit:active {
    transform: translateY(0);
}

.phone-modal-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--chatbot-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.phone-modal-footer i {
    color: var(--chatbot-success);
}

/* ==========================================
   BANNER DE DATOS FALTANTES V2
   ========================================== */
.chatbot-missing-data {
    padding: 6px 12px;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    margin: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: #1976d2;
    animation: slideInLeft 0.4s ease;
    max-height: 60px; /* Altura máxima reducida */
    overflow: hidden; /* Ocultar overflow para el scroll interno */
    width: calc(100% - 24px); /* Asegurar que se adapte al ancho */
    box-sizing: border-box; /* Incluir padding en el ancho */
}

.chatbot-missing-data i {
    font-size: 0.9rem;
    margin-top: 1px;
    flex-shrink: 0; /* No se comprime el ícono */
}

.missing-data-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0; /* Permite que el contenido se comprima */
    max-width: 100%; /* No exceder el ancho disponible */
    overflow: hidden; /* Prevenir overflow horizontal */
}

.missing-data-label {
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.75rem;
    line-height: 1.2;
    word-wrap: break-word; /* Permitir salto de línea */
    overflow-wrap: break-word; /* Asegurar salto de línea */
}

.missing-data-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 35px; /* Altura máxima reducida para la lista */
    overflow-y: auto; /* Scroll vertical cuando hay muchos elementos */
    overflow-x: hidden; /* NO permitir scroll horizontal */
    padding-right: 3px;
    width: 100%; /* Asegurar que use todo el ancho disponible */
    box-sizing: border-box;
}

/* Scrollbar personalizado para la lista */
.missing-data-list::-webkit-scrollbar {
    width: 4px;
}

.missing-data-list::-webkit-scrollbar-track {
    background: rgba(33, 150, 243, 0.1);
    border-radius: 2px;
}

.missing-data-list::-webkit-scrollbar-thumb {
    background: #2196f3;
    border-radius: 2px;
}

.missing-data-list::-webkit-scrollbar-thumb:hover {
    background: #1976d2;
}

.missing-data-item {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    font-size: 0.7rem;
    line-height: 1.3;
    word-wrap: break-word; /* Permitir salto de línea */
    overflow-wrap: break-word; /* Asegurar salto de línea */
    word-break: break-word; /* Forzar salto de palabra si es necesario */
    white-space: normal; /* Permitir múltiples líneas */
    width: 100%; /* Usar todo el ancho disponible */
    box-sizing: border-box;
    max-width: 100%; /* No exceder el ancho del contenedor */
}

/* Responsive - Móvil */
@media (max-width: 480px) {
    .chatbot-missing-data {
        margin: 4px 8px;
        padding: 5px 10px;
        max-height: 50px;
        font-size: 0.75rem;
    }
    
    .missing-data-list {
        max-height: 30px;
    }
    
    .missing-data-item {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    
    .missing-data-label {
        font-size: 0.7rem;
    }
}

/* ==========================================
   ANIMACIONES
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   RESPONSIVE - MODAL DE TELÉFONO
   ========================================== */
@media (max-width: 480px) {
    .phone-modal-content {
        padding: 25px 20px;
        width: 95%;
    }
    
    .phone-modal-header h3 {
        font-size: 1.3rem;
    }
    
    .btn-phone-submit {
        width: 100%;
    }
}

