/* Widget Chat B2Vape - Tema Scuro */
.b2vape-chat-widget {
    position: fixed;
    right: 20px;
    top: 35%;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: Arial, sans-serif;
}

/* Bottone Chat Principale */
.chat-trigger-btn {
    background: linear-gradient(135deg, #c0af6e 0%, #8a7c4a 100%);
    border: none;
    border-radius: 25px 5px 5px 25px;
    padding: 0px 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(192, 175, 110, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.chat-trigger-btn:hover {
    background: linear-gradient(135deg, #d4c788 0%, #c0af6e 100%);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(192, 175, 110, 0.4);
}

.chat-trigger-btn .btn-content {
    display: flex;
    align-items: center;
    color: #2c2c2c;
    font-weight: bold;
    font-size: 14px;
}

.chat-trigger-btn .chat-icon {
    font-size: 50px;
    margin-right: 8px;
}

.chat-trigger-btn .chat-text {
    line-height: 1.2;
}

.chat-trigger-btn .chat-subtext {
    font-size: 11px;
    opacity: 0.8;
    font-weight: normal;
}

/* Indicatore di attività */
.chat-trigger-btn .activity-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Finestra Chat */
.chat-window {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    height: 600px;
    background: #1a1a1a;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10000;
    overflow: hidden;
    border: 2px solid #c0af6e;
}

.chat-window.active {
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateY(-50%) translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

/* Header Chat */
.chat-header {
    background: linear-gradient(135deg, #c0af6e 0%, #8a7c4a 100%);
    padding: 15px 20px;
    color: #2c2c2c;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header .title {
    display: flex;
    align-items: center;
}

.chat-header .title .icon {
    margin-right: 8px;
    font-size: 18px;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #2c2c2c;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.2s;
}

.chat-close-btn:hover {
    background: rgba(44, 44, 44, 0.2);
}

/* Area Messaggi */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #2c2c2c;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c0af6e;
    border-radius: 3px;
}

/* Messaggi */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    word-wrap: break-word;
    line-height: 1.2;
}

.message.user {
    background: #c0af6e;
    color: #2c2c2c;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.claude {
    background: #404040;
    color: #ffffff;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border-left: 3px solid #c0af6e;
font-size: 13px;
}

.message.system {
    background: #8a7c4a;
    color: #ffffff;
    margin: 0 auto;
    text-align: center;
    font-size: 13px;
    border-radius: 20px;
}

/* Indicatore di digitazione */
.typing-indicator {
    display: none;
    background: #404040;
    color: #c0af6e;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border-left: 3px solid #c0af6e;
    padding: 12px 16px;
}

.typing-indicator.active {
    display: block;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #c0af6e;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Area Input */
.chat-input-area {
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid #404040;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: #2c2c2c;
    border: 1px solid #404040;
    border-radius: 20px;
    padding: 10px 15px;
    color: #ffffff;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    font-family: inherit;
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: #c0af6e;
    box-shadow: 0 0 0 2px rgba(192, 175, 110, 0.2);
}

.chat-input::placeholder {
    color: #888;
}

.chat-send-btn {
    background: #c0af6e;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: #2c2c2c;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover:not(:disabled) {
    background: #d4c788;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

/* Modal Controllo Età */
.age-verification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.age-verification-modal.active {
    display: flex;
}

.age-modal-content {
    background: #1a1a1a;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 2px solid #c0af6e;
}

.age-modal-content h3 {
    color: #c0af6e;
    margin-bottom: 15px;
    font-size: 20px;
}

.age-modal-content p {
    color: #ffffff;
    margin-bottom: 25px;
    line-height: 1.5;
}

.age-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.age-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.age-btn.confirm {
    background: #c0af6e;
    color: #2c2c2c;
}

.age-btn.confirm:hover {
    background: #d4c788;
}

.age-btn.deny {
    background: #666;
    color: #ffffff;
}

.age-btn.deny:hover {
    background: #777;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: 95%;
        height: 90%;
        right: 2.5%;
        top: 5%;
        transform: none;
    }
    
    .b2vape-chat-widget {
        right: 15px;
    }
    
    .chat-trigger-btn {
        padding: 12px 15px;
        min-width: 120px;
    }
}

/* Stati di caricamento */
.chat-loading {
    text-align: center;
    padding: 20px;
    color: #888;
}

.chat-error {
    background: #cc4444;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin: 10px;
    text-align: center;
}

/* Animazioni smooth per messaggi */
.message {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Mobile Chat Ottimizzazioni */
@media (max-width: 768px) {
    .b2vape-chat-widget {
        right: 20px !important;
        bottom: 20px !important;
        top: auto !important;
        transform: none !important;
    }
    
    .chat-window {
        width: 100% !important;
        height: 100% !important;
        right: 0 !important;
        top: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }
    
    .age-verification-modal .age-modal-content {
        width: 95% !important;
        max-width: 350px !important;
    }
}
/* Bottone Email Conversazione */
.chat-email-section {
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid #404040;
    text-align: center;
}

.chat-email-btn {
    background: linear-gradient(135deg, #c0af6e 0%, #8a7c4a 100%);
    color: #2c2c2c;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.chat-email-btn:hover {
    background: linear-gradient(135deg, #d4c788 0%, #c0af6e 100%);
    transform: scale(1.05);
}

/* Modal Email */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}

.email-modal.active {
    display: flex;
}

.email-modal-content {
    background: #2c2c2c;
    border-radius: 15px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 2px solid #c0af6e;
    color: #ffffff;
}

.email-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.email-modal-header h3 {
    color: #c0af6e;
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.email-modal-header p {
    color: #cccccc;
    margin: 0;
    font-size: 0.9em;
}

.email-form-group {
    margin-bottom: 20px;
}

.email-form-group label {
    display: block;
    color: #c0af6e;
    font-weight: bold;
    margin-bottom: 8px;
}

.email-form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #555;
    border-radius: 8px;
    background: #404040;
    color: #ffffff;
    font-size: 14px;
    box-sizing: border-box;
}

.email-form-control:focus {
    outline: none;
    border-color: #c0af6e;
    box-shadow: 0 0 0 2px rgba(192, 175, 110, 0.2);
}

.email-form-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.email-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.email-btn-primary {
    background: #c0af6e;
    color: #2c2c2c;
}

.email-btn-primary:hover {
    background: #d4c788;
}

.email-btn-secondary {
    background: #666;
    color: white;
}

.email-btn-secondary:hover {
    background: #777;
}

.email-success {
    text-align: center;
    color: #28a745;
    margin-top: 15px;
    display: none;
}

.email-error {
    text-align: center;
    color: #dc3545;
    margin-top: 15px;
    display: none;
}
.chat-message strong { font-weight: bold; }
.chat-message em { font-style: italic; }
.chat-message ul { margin: 10px 0; padding-left: 20px; }