/* AI Coach Floating Button */
.ai-coach-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.ai-coach-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.6);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(139, 92, 246, 0.8);
    }
}

/* Notification Badge */
.ai-coach-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #DC2626;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 3px solid white;
    animation: bounce 0.5s ease;
}

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

/* AI Coach Chat Panel */
.ai-coach-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9998;
    animation: slideIn 0.3s ease;
}

.ai-coach-panel.active {
    display: flex;
}

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

/* Panel Header */
.ai-coach-header {
    padding: 20px;
    border-bottom: 2px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #F8FAFC, #EFF6FF);
}

.ai-coach-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-coach-info {
    flex: 1;
}

.ai-coach-name {
    font-weight: 700;
    color: #1E293B;
    font-size: 16px;
}

.ai-coach-status {
    font-size: 12px;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

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

.ai-coach-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748B;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.ai-coach-close:hover {
    color: #1E293B;
}

/* Messages Area */
.ai-coach-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.ai-message {
    display: flex;
    gap: 12px;
    align-items: start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-bubble {
    background: #F8FAFC;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    color: #1E293B;
    line-height: 1.5;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 4px;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #F8FAFC;
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94A3B8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-action-btn {
    padding: 8px 12px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 12px;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: #3B82F6;
    color: #3B82F6;
    background: #EFF6FF;
}

/* Input Area */
.ai-coach-input-area {
    padding: 16px 20px;
    border-top: 2px solid #E2E8F0;
    display: flex;
    gap: 12px;
}

.ai-coach-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.ai-coach-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.ai-coach-send {
    padding: 12px 20px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-coach-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-coach-panel {
        width: calc(100vw - 32px);
        right: 16px;
        left: 16px;
        height: calc(100vh - 150px);
    }
}