/* AI Copilot Styles - Uses theme CSS variables */

#ai-copilot-button {
    z-index: 9999;
    bottom: 20px; /* Default position for sidebar mode */
}

#ai-copilot-window {
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    bottom: 80px; /* Default position for sidebar mode */
}

/* Theme-aware button and elements */
.ai-copilot-btn {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

.ai-copilot-btn:hover {
    filter: brightness(1.1);
}

.ai-copilot-btn:focus {
    ring-color: var(--primary-color, #2563eb);
}

.ai-copilot-ping {
    background-color: var(--primary-color, #2563eb);
}

.ai-copilot-badge {
    background-color: var(--primary-color, #2563eb);
}

.ai-copilot-header {
    background: linear-gradient(90deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

.ai-copilot-footer {
    background: linear-gradient(90deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

.ai-copilot-icon {
    color: var(--primary-color, #2563eb);
}

.ai-copilot-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.ai-copilot-context-icon {
    color: var(--primary-color, #2563eb);
}

.ai-copilot-send-btn {
    background: linear-gradient(90deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

.ai-copilot-send-btn:hover {
    filter: brightness(1.1);
}

.ai-copilot-send-btn:focus {
    ring-color: var(--primary-color, #2563eb);
}

.ai-copilot-input:focus {
    ring-color: var(--primary-color, #2563eb);
    border-color: transparent;
}

.ai-copilot-clear:hover {
    color: var(--primary-color, #2563eb);
}

.ai-copilot-ai-avatar {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

.ai-copilot-user-bubble {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

.ai-copilot-typing-avatar {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--accent-color, #10b981) 100%);
}

/* Microphone button */
.ai-copilot-mic-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    min-width: 44px;
    z-index: 10;
    position: relative;
    background-color: transparent;
    color: white;
}

.ai-copilot-mic-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ai-copilot-mic-btn.listening {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Voice output toggle button */
.ai-copilot-voice-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    min-width: 44px;
    z-index: 10;
    position: relative;
    background-color: transparent;
    color: white;
}

.ai-copilot-voice-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ai-copilot-voice-btn.active {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

.ai-copilot-send-btn {
    flex-shrink: 0;
    min-width: 44px;
    z-index: 10;
    position: relative;
}

.ai-copilot-mic-btn.listening {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* Message styling */
#ai-copilot-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#ai-copilot-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-copilot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ai-copilot-messages::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#ai-copilot-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

/* Input field */
#ai-copilot-input:focus {
    outline: none;
}

/* Action buttons in messages */
#ai-copilot-messages button {
    font-size: 0.75rem;
}

/* Code blocks in messages */
#ai-copilot-messages code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Typing indicator animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* Ensure copilot appears above taskbar */
body.launcher-mode #ai-copilot-button {
    bottom: 90px !important; /* Above taskbar with extra space */
}

body.launcher-mode #ai-copilot-window {
    bottom: 150px !important; /* Above taskbar with extra space */
}

/* Dark mode adjustments */
.dark #ai-copilot-window {
    background-color: #1f2937;
    border: 1px solid #374151;
}

.dark #ai-copilot-messages {
    scrollbar-color: rgba(75, 85, 99, 0.5) transparent;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    #ai-copilot-window {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
        max-height: 70vh;
    }
    
    #ai-copilot-button {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Pulse animation for AI badge */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Smooth transitions */
#ai-copilot-window,
#ai-copilot-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Message bubble hover effect */
#ai-copilot-messages > div:hover {
    transform: translateX(2px);
    transition: transform 0.2s ease;
}
