#polidicom-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#polidicom-chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

#polidicom-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(13, 71, 161, 0.6);
}

#polidicom-chat-box {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 370px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: polidicom-slide-up 0.3s ease;
}

@keyframes polidicom-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#polidicom-chat-header {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}

#polidicom-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f7fb;
}

.polidicom-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.polidicom-msg.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.polidicom-msg.user {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.polidicom-msg.error {
    background: #ffebee;
    color: #c62828;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    font-size: 13px;
}

.polidicom-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.polidicom-typing span {
    width: 8px;
    height: 8px;
    background: #90a4ae;
    border-radius: 50%;
    animation: polidicom-bounce 1.4s infinite both;
}

.polidicom-typing span:nth-child(2) { animation-delay: 0.2s; }
.polidicom-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes polidicom-bounce {
    0%, 80%, 100% { transform: scale(0.6); }
    40% { transform: scale(1); }
}

#polidicom-chat-input-area {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid #e8eaf6;
    background: white;
    gap: 8px;
}

#polidicom-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#polidicom-chat-input:focus {
    border-color: #1a237e;
}

#polidicom-chat-input-area button {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#polidicom-chat-input-area button:hover {
    transform: scale(1.1);
}

#polidicom-chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#polidicom-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.polidicom-quick-btn {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.polidicom-quick-btn:hover {
    background: #4338ca;
    color: white;
    border-color: #4338ca;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #polidicom-chat-box {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
        border-radius: 12px;
    }
}

.polidicom-link {
    color: #4338ca;
    text-decoration: underline;
    word-break: break-all;
    font-weight: 600;
}
.polidicom-link:hover {
    color: #3730a3;
}
.polidicom-msg.bot strong {
    font-weight: 700;
}
