/* Bottone chatbot */
#ccc-chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #13597c 0%, #0f4460 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(19, 89, 124, 0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#ccc-chatbot-button:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #166a93 0%, #13597c 100%);
    box-shadow: 0 6px 16px rgba(19, 89, 124, 0.4);
}

#ccc-chatbot-button svg {
    width: 30px;
    height: 30px;
    fill: #c5f900;
}

/* Container chatbot */
#ccc-chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(19, 89, 124, 0.2);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #13597c;
}

#ccc-chatbot-container.active {
    display: flex;
}

/* Header */
.ccc-chatbot-header {
    background: linear-gradient(135deg, #13597c 0%, #0f4460 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ccc-chatbot-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #c5f900;
}

.ccc-chatbot-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

.ccc-close-btn {
    background: rgba(197, 249, 0, 0.2);
    border: none;
    color: #c5f900;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ccc-close-btn:hover {
    background: rgba(197, 249, 0, 0.3);
    transform: rotate(90deg);
}

/* Messages area */
.ccc-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ccc-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.ccc-message.user {
    flex-direction: row-reverse;
}

.ccc-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.ccc-message.assistant .ccc-message-content {
    background: white;
    color: #333;
    box-shadow: 0 2px 4px rgba(19, 89, 124, 0.1);
    border-left: 3px solid #c5f900;
}

.ccc-message.user .ccc-message-content {
    background: linear-gradient(135deg, #13597c 0%, #0f4460 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(19, 89, 124, 0.2);
}

/* Avatar icons (opzionale) */
.ccc-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ccc-message.assistant .ccc-message-avatar {
    background: linear-gradient(135deg, #13597c 0%, #0f4460 100%);
    color: #c5f900;
}

.ccc-message.user .ccc-message-avatar {
    background: #c5f900;
    color: #13597c;
    font-weight: bold;
}

/* Input area */
.ccc-chatbot-input {
    padding: 20px;
    border-top: 2px solid #e0e0e0;
    background: white;
}

.ccc-input-wrapper {
    display: flex;
    gap: 10px;
}

#ccc-user-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#ccc-user-input:focus {
    border-color: #13597c;
    box-shadow: 0 0 0 3px rgba(19, 89, 124, 0.1);
}

#ccc-send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #13597c 0%, #0f4460 100%);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#ccc-send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(197, 249, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

#ccc-send-btn:hover::before {
    width: 300px;
    height: 300px;
}

#ccc-send-btn:hover {
    box-shadow: 0 4px 12px rgba(19, 89, 124, 0.3);
    background: linear-gradient(135deg, #166a93 0%, #13597c 100%);
}

#ccc-send-btn span {
    position: relative;
    z-index: 1;
}

#ccc-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#ccc-send-btn:disabled:hover::before {
    width: 0;
    height: 0;
}

/* Loading animation */
.ccc-loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #13597c;
    animation: pulse 1.4s infinite ease-in-out;
    margin: 0 2px;
}

.ccc-loading:nth-child(2) {
    background: #c5f900;
}

.ccc-loading:nth-child(3) {
    background: #13597c;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

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

.ccc-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ccc-chatbot-messages::-webkit-scrollbar-thumb {
    background: #13597c;
    border-radius: 3px;
}

.ccc-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #0f4460;
}

/* Badge "Klinika Bike Garage" */
.ccc-chatbot-badge {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #999;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.ccc-chatbot-badge strong {
    color: #13597c;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #ccc-chatbot-container {
        width: calc(100% - 40px);
        height: calc(100% - 140px);
        bottom: 90px;
        right: 20px;
        border-radius: 12px;
    }
    
    #ccc-chatbot-button {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }
}

/* Animazione di apertura */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#ccc-chatbot-container.active {
    animation: slideUp 0.3s ease;
}

/* Stati di typing */
.ccc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-left: 3px solid #c5f900;
    width: fit-content;
}

.ccc-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #13597c;
    animation: typingBounce 1.4s infinite;
}

.ccc-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
    background: #c5f900;
}

.ccc-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Welcome message highlight */
.ccc-welcome-message {
    background: linear-gradient(135deg, rgba(19, 89, 124, 0.05) 0%, rgba(197, 249, 0, 0.05) 100%);
    border: 1px solid rgba(19, 89, 124, 0.1);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.ccc-welcome-message h4 {
    color: #13597c;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.ccc-welcome-message p {
    color: #666;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Lista dentro i messaggi */
.ccc-message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ccc-message-content li {
    margin: 5px 0;
}

.ccc-message-content strong {
    color: #13597c;
}

.ccc-message.assistant .ccc-message-content strong {
    color: #13597c;
}

.ccc-message.user .ccc-message-content strong {
    color: #c5f900;
}
