/* ============================================================
   CHATBOT DISPROAVÍCOLA - ESTILOS COMPLETOS
   ============================================================ */

#chatbot-dispro-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ============================================================
   BOTÓN PRINCIPAL - SIN TEXTO "CHAT"
   ============================================================ */
.chatbot-button {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #2d7d46;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(45, 125, 70, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.chatbot-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(45, 125, 70, 0.4);
}

.chatbot-button:active {
    transform: scale(0.95);
}

/* ============================================================
   ANILLOS GIRATORIOS
   ============================================================ */
.chatbot-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid transparent;
}

.chatbot-ring:nth-child(1) {
    width: 100%;
    height: 100%;
    border-color: rgba(45, 125, 70, 0.2);
    animation: chatbot-spin 8s linear infinite;
}

.chatbot-ring:nth-child(2) {
    width: 120%;
    height: 120%;
    border-color: rgba(45, 125, 70, 0.1);
    border-style: dashed;
    animation: chatbot-spin 12s linear infinite reverse;
}

.chatbot-ring:nth-child(3) {
    width: 140%;
    height: 140%;
    border-color: rgba(166, 130, 65, 0.12);
    border-style: dotted;
    animation: chatbot-spin 16s linear infinite;
}

@keyframes chatbot-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================
   ICONO / LOGO
   ============================================================ */
.chatbot-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-icon img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2d7d46;
}

.chatbot-icon .fa-comment {
    font-size: 28px;
    color: #2d7d46;
}

/* ============================================================
   BURBUJA DE NOTIFICACIÓN
   ============================================================ */
.chatbot-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #25D366;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.4);
    z-index: 10;
    animation: chatbot-notif-bounce 2s ease-in-out infinite;
}

@keyframes chatbot-notif-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================================
   ONDA AL HACER CLIC
   ============================================================ */
.chatbot-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(45, 125, 70, 0.25);
    pointer-events: none;
    animation: chatbot-wave-expand 0.8s ease forwards;
    z-index: 1;
}

@keyframes chatbot-wave-expand {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ============================================================
   PARTÍCULAS
   ============================================================ */
.chatbot-particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9998;
    animation: chatbot-particle-rise 1.5s ease forwards;
}

@keyframes chatbot-particle-rise {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* ============================================================
   VENTANA DEL CHAT
   ============================================================ */
.chatbot-window {
    display: none;
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 370px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(45, 125, 70, 0.1);
}

.chatbot-window.open {
    display: flex;
    animation: chatbot-slide-up 0.3s ease;
}

@keyframes chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   HEADER DEL CHAT
   ============================================================ */
.chatbot-header {
    background: #2d7d46;
    color: #ffffff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-header span {
    font-size: 15px;
    font-weight: 600;
}

#chatbotClose {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

#chatbotClose:hover {
    opacity: 1;
}

/* ============================================================
   MENSAJES DEL CHAT
   ============================================================ */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #e8ecf1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #2d7d46;
    border-radius: 4px;
}

.message-bot {
    background: #ffffff;
    padding: 10px 15px;
    border-radius: 12px 12px 12px 4px;
    max-width: 85%;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    color: #2d3748;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.message-bot strong {
    color: #2d7d46;
}

.message-bot a {
    color: #2d7d46;
    text-decoration: underline;
}

.message-bot a[href*="wa.me"] {
    display: inline-block;
    background: #25D366;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none !important;
    font-weight: 600;
    margin-top: 4px;
}

.message-user {
    background: #2d7d46;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 12px 12px 4px 12px;
    max-width: 85%;
    align-self: flex-end;
    font-size: 14px;
    word-wrap: break-word;
}

/* ============================================================
   BOTONES DE RESPUESTA RÁPIDA
   ============================================================ */
.quick-replies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.quick-reply {
    background: #ffffff;
    border: 2px solid #2d7d46;
    color: #2d7d46;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.25s ease;
}

.quick-reply:hover {
    background: #2d7d46;
    color: #ffffff;
    transform: scale(1.04);
}

/* ============================================================
   INPUT DEL CHAT
   ============================================================ */
.chatbot-input {
    display: flex;
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #e8ecf1;
    gap: 8px;
    flex-shrink: 0;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

.chatbot-input input:focus {
    border-color: #2d7d46;
}

.chatbot-input input::placeholder {
    color: #a0aec0;
}

.chatbot-input button {
    background: #2d7d46;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chatbot-input button:hover {
    background: #1a5a33;
    transform: scale(1.05);
}

.chatbot-input button:active {
    transform: scale(0.95);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    #chatbot-dispro-widget {
        bottom: 18px;
        right: 18px;
    }
    
    .chatbot-button {
        width: 58px;
        height: 58px;
    }
    
    .chatbot-icon img {
        width: 36px;
        height: 36px;
    }
    
    .chatbot-icon .fa-comment {
        font-size: 22px;
    }
    
    .chatbot-window {
        width: calc(100vw - 30px);
        height: 450px;
        max-height: 75vh;
        bottom: 68px;
        right: 0;
    }
}

@media (max-width: 480px) {
    .chatbot-button {
        width: 52px;
        height: 52px;
        border-width: 2px;
    }
    
    .chatbot-icon img {
        width: 32px;
        height: 32px;
    }
    
    .chatbot-icon .fa-comment {
        font-size: 18px;
    }
    
    .chatbot-notification {
        font-size: 8px;
        padding: 2px 6px;
        min-width: 18px;
        top: -3px;
        right: -3px;
    }
    
    .chatbot-window {
        width: calc(100vw - 24px);
        height: 400px;
        max-height: 70vh;
        bottom: 62px;
        right: 0;
        border-radius: 12px;
    }
    
    .chatbot-header span {
        font-size: 13px;
    }
    
    .message-bot,
    .message-user {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .quick-reply {
        font-size: 12px;
        padding: 5px 12px;
    }
}