/**
 * VANNY CHAT - Styles v1.3.1
 */

/* PULSANTE AVATAR */
#vanny-chat-button {
    position: fixed;
    bottom: 20px;
    right: -80px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a0df 0%, #0077b6 100%);
    box-shadow: 0 8px 25px rgba(0, 160, 223, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    transition: all 0.3s ease;
    opacity: 0;
    border: 3px solid #fff;
}

#vanny-chat-button.vanny-show {
    opacity: 1;
    animation: slideInButton 1s ease-out forwards;
}

@keyframes slideInButton {
    0% { right: -80px; transform: scale(0.8); }
    60% { right: 110px; transform: scale(1.1); }
    100% { right: 100px; transform: scale(1); }
}

#vanny-chat-button img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

#vanny-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 160, 223, 0.6);
}

.vanny-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* FUMETTO - ALLINEATO VICINO AVATAR */
#vanny-help-bubble {
    position: fixed;
    bottom: 90px;
    right: -350px;
    background: white;
    padding: 12px 18px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 99997;
    opacity: 0;
    font-weight: bold;
    color: #333;
    max-width: 250px;
    white-space: nowrap;
    transition: all 0.8s ease-out;
    cursor: pointer;
}

#vanny-help-bubble.vanny-show {
    right: 175px;
    opacity: 1;
}

#vanny-help-bubble:after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

#vanny-help-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(0, 0, 0, 0.2);
}

/* CHAT CONTAINER - ALLARGATA */
#vanny-chat-widget {
    position: fixed;
    bottom: -700px;
    right: 100px;
    width: 420px;
    max-height: calc(100vh - 20px);
    z-index: 99999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#vanny-chat-widget.vanny-show {
    opacity: 1;
    animation: slideUpChat 1s ease-out forwards;
}

@keyframes slideUpChat {
    0% { bottom: -700px; transform: scale(0.8); }
    50% { bottom: 30px; transform: scale(1.05); }
    70% { bottom: 15px; transform: scale(0.98); }
    100% { bottom: 20px; transform: scale(1); }
}

#vanny-chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 650px;
    overflow: hidden;
}

/* HEADER */
#vanny-chat-header {
    background: linear-gradient(135deg, #00a0df 0%, #0077b6 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.vanny-header-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.vanny-header-text h3 {
    margin: 0;
    font-size: 20px;
}

.vanny-header-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

#vanny-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#vanny-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* MESSAGES */
#vanny-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f7fa;
}

.vanny-message {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    animation: fadeIn 0.4s ease;
}

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

.vanny-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vanny-message-content {
    background: white;
    padding: 15px;
    border-radius: 15px;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
}

/* INPUT CONTAINER (senza fumetto) */
.vanny-input-container {
    margin-bottom: 15px;
    animation: fadeIn 0.4s ease;
}

.vanny-user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.vanny-user-message-content {
    background: linear-gradient(135deg, #00a0df 0%, #0077b6 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 15px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 160, 223, 0.3);
}

/* TYPING INDICATOR */
.vanny-typing-indicator {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.vanny-typing-dots {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    display: flex;
    gap: 5px;
}

.vanny-typing-dots span {
    width: 8px;
    height: 8px;
    background: #00a0df;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.vanny-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.vanny-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
    30% { transform: translateY(-10px); opacity: 1; }
}

/* OPTIONS */
.vanny-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* GRIGLIA 2x3 PER FAMIGLIA */
.vanny-options.vanny-family-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.vanny-option-btn {
    background: white;
    border: 2px solid #00a0df;
    color: #00a0df;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.vanny-option-btn:hover {
    background: #00a0df;
    color: white;
    transform: translateX(5px);
}

.vanny-option-icon {
    font-size: 20px;
}

/* INPUTS */
.vanny-input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #00a0df;
    border-radius: 10px;
    font-size: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #333333;
    font-weight: 500;
}

.vanny-input-field::placeholder {
    color: #666666;
    font-weight: 400;
}

.vanny-input-field:focus {
    outline: none;
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0, 160, 223, 0.1);
}

.vanny-submit-btn {
    background: linear-gradient(135deg, #00a0df 0%, #0077b6 100%);
    color: white;
    border: none;
    padding: 14px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.vanny-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 160, 223, 0.4);
}

.vanny-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* OFFER BOX */
.vanny-offer-box {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border: 3px solid #ff9800;
    border-radius: 15px;
    padding: 25px;
    margin-top: 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.2);
}

.vanny-offer-box:before {
    content: '🎁';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 50px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-15px); }
}

.vanny-offer-box h3 {
    color: #ff9800;
    margin: 0 0 15px 0;
    font-size: 22px;
}

.vanny-offer-box p {
    margin: 10px 0;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

/* CHECKBOX */
.vanny-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    text-align: left;
}

.vanny-checkbox-wrapper input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.vanny-checkbox-wrapper label {
    font-size: 13px;
    color: #666;
    cursor: pointer;
    line-height: 1.4;
}

/* PRIVACY TEXT */
.vanny-privacy-text {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.vanny-privacy-text a {
    color: #00a0df;
    text-decoration: none;
}

.vanny-privacy-text a:hover {
    text-decoration: underline;
}

/* SUCCESS & ERROR */
.vanny-success-message {
    background: #4caf50;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    animation: fadeIn 0.5s ease;
}

.vanny-error {
    background: #ff4757;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
}

/* LOADING */
.vanny-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SCROLLBAR */
#vanny-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#vanny-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#vanny-chat-messages::-webkit-scrollbar-thumb {
    background: #00a0df;
    border-radius: 3px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #vanny-chat-widget {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: -100vh;
    }
    
    #vanny-chat-widget.vanny-show {
        animation: slideUpMobile 0.8s ease-out forwards;
    }
    
    @keyframes slideUpMobile {
        100% { bottom: 5px; }
    }
    
    #vanny-chat-container {
        height: calc(100vh - 20px);
        max-height: none;
    }
    
    #vanny-chat-button {
        bottom: 5px;
        right: -80px;
    }
    
    #vanny-help-bubble {
        bottom: 85px;
        right: -300px;
        max-width: 200px;
        font-size: 14px;
    }
    
    #vanny-help-bubble.vanny-show {
        right: 100px;
    }
}
