/**
 * Cuttalo AI25 - Minimal Theme
 * Design ultra-minimalista, pulito e zen
 */

.cuttalo-ai25-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 9999;
}

.cuttalo-ai25-position-bottom-right {
    position: fixed;
    bottom: 24px;
    right: 24px;
}

.cuttalo-ai25-position-bottom-left {
    position: fixed;
    bottom: 24px;
    left: 24px;
}

/* Pulsante minimalista */
.cuttalo-ai25-chat-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cuttalo-ai25-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cuttalo-ai25-button-icon {
    fill: white;
}

.cuttalo-ai25-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #000;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat window minimalista */
.cuttalo-ai25-chat-window {
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 580px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    border: 1px solid #e0e0e0;
}

.cuttalo-ai25-position-bottom-left .cuttalo-ai25-chat-window {
    right: auto;
    left: 0;
}

.cuttalo-ai25-position-inline .cuttalo-ai25-chat-window {
    position: relative;
    bottom: auto;
    right: auto;
    margin: 0 auto;
}

/* Header minimalista */
.cuttalo-ai25-chat-header {
    background: #fff;
    color: #000;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
}

.cuttalo-ai25-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cuttalo-ai25-bot-avatar-wrapper {
    position: relative;
}

.cuttalo-ai25-bot-avatar {
    width: 40px;
    height: 40px;
    color: #000;
}

.cuttalo-ai25-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #4caf50;
    border: 2px solid #fff;
    border-radius: 50%;
}

.cuttalo-ai25-header-text h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    letter-spacing: -0.2px;
}

.cuttalo-ai25-status-text {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: #666;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cuttalo-ai25-status-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cuttalo-ai25-close-button {
    background: transparent;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.cuttalo-ai25-close-button:hover {
    background: #f5f5f5;
    color: #000;
}

/* Messages area minimalista */
.cuttalo-ai25-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}

.cuttalo-ai25-messages::-webkit-scrollbar {
    width: 4px;
}

.cuttalo-ai25-messages::-webkit-scrollbar-track {
    background: transparent;
}

.cuttalo-ai25-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* Messaggi ultra-puliti con avatar */
.cuttalo-ai25-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
    margin-bottom: 16px;
}

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

.cuttalo-ai25-message-bot {
    align-self: flex-start;
}

.cuttalo-ai25-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.cuttalo-ai25-message-avatar {
    flex-shrink: 0;
    color: #666;
}

.cuttalo-ai25-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cuttalo-ai25-message-text {
    padding: 10px 14px;
    border-radius: 4px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.cuttalo-ai25-message-bot .cuttalo-ai25-message-text {
    background: #f5f5f5;
    color: #000;
    border-left: 2px solid #000;
}

.cuttalo-ai25-message-user .cuttalo-ai25-message-text {
    background: #000;
    color: #fff;
}

.cuttalo-ai25-message-time {
    font-size: 10px;
    color: #999;
    padding: 0 4px;
}

.cuttalo-ai25-message-user .cuttalo-ai25-message-time {
    text-align: right;
}

.cuttalo-ai25-message a {
    color: #000;
    text-decoration: underline;
    font-weight: 500;
}

.cuttalo-ai25-message-bot a {
    color: #000;
}

.cuttalo-ai25-message-user a {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

/* Input area pulita con textarea */
.cuttalo-ai25-input-area {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.cuttalo-ai25-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 6px;
}

.cuttalo-ai25-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    line-height: 1.4;
}

.cuttalo-ai25-input:focus {
    border-color: #000;
}

.cuttalo-ai25-input-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.cuttalo-ai25-char-counter {
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

.cuttalo-ai25-char-counter.warning {
    color: #ff5722;
    font-weight: 600;
}

.cuttalo-ai25-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cuttalo-ai25-send-button svg {
    fill: #fff;
}

.cuttalo-ai25-send-button:hover:not(:disabled) {
    transform: scale(1.05);
}

.cuttalo-ai25-send-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cuttalo-ai25-input-hint {
    font-size: 10px;
    color: #999;
    text-align: center;
    font-style: italic;
}

/* Typing indicator minimalista - dentro messages area */
.cuttalo-ai25-typing .cuttalo-ai25-message-avatar {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cuttalo-ai25-typing-wrapper {
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 4px;
    border-left: 2px solid #000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 220px;
}

.cuttalo-ai25-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.cuttalo-ai25-typing-dots span {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    animation: minimalDot 1s infinite;
}

.cuttalo-ai25-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.cuttalo-ai25-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

.cuttalo-ai25-typing-text {
    font-size: 10px;
    color: #666;
    font-style: italic;
    opacity: 0;
    animation: fadeInText 0.5s ease-in forwards;
    animation-delay: 1s;
}

.cuttalo-ai25-typing-progress {
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    border-radius: 1px;
    overflow: hidden;
    margin-top: 2px;
}

.cuttalo-ai25-typing-progress-bar {
    height: 100%;
    background: #000;
    border-radius: 1px;
    animation: progressGrow 12s ease-out forwards;
}

@keyframes minimalDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressGrow {
    from {
        width: 0%;
    }
    to {
        width: 90%;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .cuttalo-ai25-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 80px);
        bottom: 16px;
        right: 16px;
    }

    .cuttalo-ai25-position-bottom-right,
    .cuttalo-ai25-position-bottom-left {
        right: 16px;
        left: auto;
    }

    .cuttalo-ai25-message {
        max-width: 85%;
    }
}
