﻿.chatbot-wrapper {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 999999;
    font-family: var(--bs-body-font-family);
    pointer-events: auto;
}

.hidden {
    display:none;
}

.chatbot-window {

    width: 470px; 
    height: 645px; 
    background: var(--bs-component-bg);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    animation: slideInUp 0.3s ease-out;
    position: absolute !important;
    bottom: 0;
    right: 0;
    transform: translate(0px, 0px);
    pointer-events: all;
    left: auto !important;
    top: auto !important;

    max-width: 75;
    max-height: 80vh;
    min-width: 250px; 
    min-height: 350px;
    transition: all 0.3s ease;
}

@media (min-width: 1400px) {
    .chatbot-window {
        width: 550px; 
        height: 750px; 
    }
}

@media (min-width: 1600px) {
    .chatbot-window {
        width: 600px;
        height: 800px;
    }
}

@media (min-width: 1920px) {
    .chatbot-window {
        width: 650px;
        height: 850px;
    }
}

/* Header */
.chatbot-header {
    background: var(--bs-theme);
    color: var(--bs-theme-color);
    padding: 12px 15px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-shrink: 0;
    min-height: 60px; 
}

    .chatbot-header:active {
        cursor: grabbing;
    }

.userinfo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px; 
    height: 45px; 
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details {
    line-height: 1.4;
    min-width: 0; 
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.user-email {
    font-size: 12px; 
    opacity: 0.9;
}

.btn-action {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--bs-theme-color);
    width: 35px; 
    height: 35px; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

    .btn-action:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.1);
    }


.chatbot-content {
    flex: 1;
    background: var(--bs-body-bg);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#webchat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    height: 100%;
}

     #webchat > div {
        flex: 1;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
    }

.webchat__send-box {
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}

.webchat__basic-transcript {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    position: relative !important;
}

.webchat__basic-transcript__scrollable {
    height: 100% !important;
    overflow-y: auto !important;
}

.webchat__basic-send-box {
    flex-shrink: 0 !important;
    position: sticky !important;
    bottom: 0 !important;
    background: var(--bs-body-bg) !important;
    border-top: 1px solid var(--bs-border-color) !important;
    padding: 15px !important; /* 🎯 Más padding */
}

.webchat__send-box-text-box {
    min-height: 45px !important; 
}

.webchat__send-box-text-box__input {
    resize: none !important;
    min-height: 45px !important; 
    max-height: 120px !important;
    font-size: 15px !important; 
}


.webchat__send-box-button {
    flex-shrink: 0 !important;
    min-width: 60px !important; 
}

.chatbot-icon {
    width: 70px; 
    height: 70px; 
    background: var(--bs-theme);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-theme-color);
    cursor: pointer;
    box-shadow: var(--bs-box-shadow-lg);
    transition: all 0.3s ease;
    animation: bounceIn 0.5s ease-out;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 999999;
    pointer-events: all;
}

    .chatbot-icon:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    }

.icon-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px; 
    background: var(--bs-danger);
    border-radius: 50%;
    border: 2px solid var(--bs-component-bg);
}

.chatbot-window {
    transition: transform 0.2s ease;
    cursor: default;
}

    .chatbot-window.dragging {
        transition: none !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }

.chatbot-header {
    cursor: grab;
    user-select: none;
}

    .chatbot-header:active {
        cursor: grabbing;
    }

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.chatbot-icon.pulse {
    animation: pulse 1s infinite;
}


.btn-close-chat {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--bs-theme-color);
    width: 35px; 
    height: 35px; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 10px;
}

    .btn-close-chat:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.1);
    }

#chatbot-container .chatbot-window {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    top: auto !important;
}

#chatbot-container .chatbot-wrapper {
    position: fixed !important;
    bottom: 90px !important;
    right: 20px !important;
    z-index: 999999 !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 576px) {
    .chatbot-wrapper {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .chatbot-window {
        width: calc(100vw - 20px) !important;
        height: 75vh !important; 
        max-width: calc(100vw - 20px) !important;
        max-height: 85vh !important;
        min-width: unset !important; 
        min-height: 400px !important;
    }


    #webchat {
        height: 100%;
    }

    
    .webchat__basic-send-box {
        padding: 12px !important; 
    }

    .chatbot-header {
        padding: 10px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
    }

    .user-name {
        font-size: 14px;
    }

    .user-email {
        font-size: 11px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .chatbot-window {
        width: 450px !important;
        height: 650px !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .chatbot-window {
        width: 480px !important;
        height: 680px !important;
    }
}

@media (max-height: 800px) {
    .chatbot-window {
        height: 85vh !important;
        max-height: 85vh !important;
    }
}

@media (max-height: 700px) {
    .chatbot-window {
        height: 80vh !important;
        max-height: 80vh !important;
    }
}

@media (max-height: 600px) {
    .chatbot-window {
        height: 75vh !important;
        max-height: 75vh !important;
    }

    .chatbot-wrapper {
        bottom: 50px;
    }
}

@media (max-height: 500px) {
    .chatbot-window {
        height: 70vh !important;
        max-height: 70vh !important;
    }

    .chatbot-header {
        padding: 8px 12px;
    }

    .user-avatar {
        width: 35px;
        height: 35px;
    }

    .user-name {
        font-size: 14px;
    }

    .user-email {
        display: none;
    }
}

@media (max-width: 400px) {
    .chatbot-wrapper {
        right: 5px;
        left: 5px;
    }

    .chatbot-window {
        width: calc(100vw - 10px) !important;
        min-height: 350px !important;
    }
}


.chatbot-window.expanded {
    width: 700px !important;
    height: 800px !important;
    max-width: 95vw !important;
    max-height: 95vh !important;
}

.webchat-loading, .webchat-error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--bs-muted);
    text-align: center;
    padding: 20px;
}

.webchat-error {
    color: var(--bs-danger);
}


.webchat__basic-transcript__scrollable {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-border-color) transparent;
}

    .webchat__basic-transcript__scrollable::-webkit-scrollbar {
        width: 8px; 
    }

    .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
        background: transparent;
    }

    .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
        background-color: var(--bs-border-color);
        border-radius: 4px;
    }

.webchat__send-box {
    border-top: 1px solid #e6e6e6 !important;
    background: white !important;
    padding: 15px !important;
    position: sticky !important;
    bottom: 0 !important;
}


.webchat__send-box-text-box__input {
    border: 1px solid #ccc !important;
    border-radius: 6px !important; 
    padding: 10px 14px !important; 
    font-size: 15px !important;
}

.webchat__send-box-button {
    background: #0078d4 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important; 
    padding: 10px 18px !important; 
    margin-left: 10px !important;
    min-width: 70px !important; 

.user-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px; 
    height: 45px;
    border-radius: 50%;
    background: var(--bs-theme) !important;
    color: var(--bs-theme-color) !important;
    font-weight: bold;
    font-size: 16px; 
    text-transform: uppercase;
}

.user-initials-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px; 
    height: 70px;
    border-radius: 50%;
    background: var(--bs-theme) !important;
    color: var(--bs-theme-color) !important;
    font-weight: bold;
    font-size: 20px; 
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

    .user-initials-icon:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0, 120, 212, 0.4);
    }

.webchat__suggested-actions {
    padding: 12px;
}

.webchat__suggested-actions__button {
    background: var(--bs-theme) !important;
    color: var(--bs-theme-color) !important;
    border: none !important;
    border-radius: 6px !important; 
    margin: 6px !important; 
    padding: 10px 18px !important;
    font-size: 14px !important;
}

    .webchat__suggested-actions__button:hover {
        background: #005a9e !important;
    }

.webchat__initialsAvatar {
    background: var(--bs-theme) !important;
    color: var(--bs-theme-color) !important;
}


.webchat__suggested-actions__button {
    background: var(--bs-theme) !important;
    color: var(--bs-theme-color) !important;
    border: none !important;
    border-radius: 6px !important;
    margin: 6px !important;
    padding: 10px 18px !important;
    cursor: pointer !important;
    pointer-events: all !important;
    font-size: 14px !important;
}

    .webchat__suggested-actions__button:hover {
        background: var(--bs-theme) !important;
        color: var(--bs-theme-color) !important;
    }

[class*="suggested-action"] {
    cursor: pointer !important;
    pointer-events: all !important;
    z-index: 1000 !important;
    position: relative !important;
}

.webchat__suggested-actions > * {
    pointer-events: all !important;
}
