/**
 * AI Copilot Styles
 */

/* ===== TRIGGER BUTTON ===== */
.ai-copilot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 32px rgba(139, 92, 246, 0.4),
        0 0 0 4px rgba(139, 92, 246, 0.1);
    z-index: 99990;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ai-copilot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 
        0 12px 40px rgba(139, 92, 246, 0.5),
        0 0 0 6px rgba(139, 92, 246, 0.15);
}

.ai-copilot-trigger:active {
    transform: scale(0.95);
}

.trigger-icon {
    font-size: 28px;
    z-index: 1;
}

.trigger-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    opacity: 0.4;
    animation: trigger-pulse 2s infinite;
}

@keyframes trigger-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* ===== COPILOT PANEL ===== */
.ai-copilot-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: rgba(15, 15, 20, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 99991;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.ai-copilot-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ===== COPILOT HEADER ===== */
.copilot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.copilot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #fff;
}

.copilot-avatar {
    font-size: 24px;
}

.copilot-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.copilot-status.online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.copilot-actions {
    display: flex;
    gap: 8px;
}

.copilot-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

/* ===== MESSAGES AREA ===== */
.copilot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.copilot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ===== MESSAGE STYLES ===== */
.copilot-message {
    display: flex;
    gap: 10px;
    animation: message-appear 0.3s ease;
}

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

.copilot-message.bot {
    align-items: flex-start;
}

.copilot-message.user {
    flex-direction: row-reverse;
}

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

.message-content {
    max-width: 280px;
}

.message-text {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.copilot-message.bot .message-text {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.copilot-message.user .message-text {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.message-text strong {
    color: #a78bfa;
}

.message-time {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    padding: 0 4px;
}

/* ===== TYPING INDICATOR ===== */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

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

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

/* ===== SUGGESTIONS ===== */
.copilot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copilot-suggestions button {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copilot-suggestions button:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

/* ===== INPUT AREA ===== */
.copilot-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copilot-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.copilot-input-area input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.copilot-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .ai-copilot-panel {
        right: 12px;
        left: 12px;
        bottom: 90px;
        width: auto;
        height: 60vh;
        max-height: 500px;
    }
    
    .ai-copilot-trigger {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .message-content {
        max-width: 240px;
    }
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] .ai-copilot-panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="light"] .copilot-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
}

[data-theme="light"] .copilot-title {
    color: #1f2937;
}

[data-theme="light"] .copilot-message.bot .message-text {
    background: #f3f4f6;
    color: #1f2937;
}

[data-theme="light"] .copilot-input-area {
    background: #f9fafb;
}

[data-theme="light"] .copilot-input-area input {
    background: #fff;
    border-color: #e5e7eb;
    color: #1f2937;
}
