/* Chat Panel Widget Styles (estratto da JS) */

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.chat-panel .chat-header {
    padding: 10px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-panel .chat-title {
    font-size: 14px;
}

.chat-panel .session-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 12px;
}

.chat-panel .session-timer i {
    font-size: 11px;
}

.chat-panel .session-timer.warning {
    background: #fef3c7;
    color: #d97706;
    animation: timerPulse 1s infinite;
}

.chat-panel .session-timer.expired {
    background: #fee2e2;
    color: #dc2626;
    animation: none;
}

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

.chat-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: none;
    min-height: 60px;
}

.chat-panel .chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.chat-panel .chat-message .message-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.chat-panel .chat-message.user .message-icon {
    background: var(--primary, #2563eb);
    color: white;
}

.chat-panel .chat-message.assistant .message-icon {
    background: #f3f4f6;
    color: #374151;
}

.chat-panel .chat-message .message-content {
    background: #f9fafb;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-width: calc(100% - 40px);
}

.chat-panel .chat-message.user .message-content {
    background: #2563eb;
    color: #fff;
}

.chat-panel .chat-message.user {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.chat-panel .chat-message.assistant {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.chat-panel .chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border, #e5e7eb);
    align-items: center;
    flex-shrink: 0;
}

.chat-panel .chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-panel .chat-input:focus {
    border-color: var(--primary, #2563eb);
}

.chat-panel .chat-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.chat-panel .chat-send-btn,
.chat-panel .chat-voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.chat-panel .chat-send-btn:disabled,
.chat-panel .chat-voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-panel .chat-send-btn {
    background: var(--primary, #2563eb);
    color: white;
}

.chat-panel .chat-send-btn:hover:not(:disabled) {
    background: var(--primary-dark, #1d4ed8);
}

.chat-panel .chat-voice-btn {
    background: #f3f4f6;
    color: #374151;
}

.chat-panel .chat-voice-btn:hover:not(:disabled) {
    background: #e5e7eb;
}

.chat-panel .chat-voice-btn.listening {
    background: #ef4444;
    color: white;
    animation: pulse 1s infinite;
}

.chat-panel .chat-actions {
    margin-top: 8px;
}

.chat-panel .btn-small {
    padding: 6px 12px;
    background: #e5e7eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.chat-panel .btn-small.primary {
    background: var(--primary, #2563eb);
    color: white;
}

.chat-panel .typing-indicator {
    color: #888;
}

.chat-panel .error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.chat-panel .typing-dots span {
    animation: typingDot 1.4s infinite;
    animation-fill-mode: both;
}

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

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

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

@keyframes typingDot {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.chat-panel .chat-list {
    margin: 8px 0;
    padding-left: 20px;
}

/* Avatar panel clickable when expired */
.avatar-panel.clickable-expired {
    cursor: pointer;
    position: relative;
}

.avatar-panel.clickable-expired::after {
    content: "Clicca per continuare";
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--primary, #2563eb);
    background: rgba(255,255,255,0.95);
    padding: 4px 12px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Wave visualizer positioning for chat panel */
.chat-panel .wave-visualizer-overlay.wave-attached {
    position: absolute;
    z-index: 10;
}
