/* AI Assistant Styles */

.top-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.ai-search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.ai-search-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.8);
}

.ai-search-icon {
    font-size: 14px;
    color: white;
    opacity: 0.9;
}

.ai-search-text {
    color: white;
    font-size: 13px;
    font-family: 'Lexend', sans-serif;
    white-space: nowrap;
    opacity: 0.9;
}

.ai-dropdown-icon {
    font-size: 10px;
    color: white;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.ai-search-container:hover .ai-dropdown-icon {
    transform: translateY(2px);
}

/* AI Assistant Panel */
.ai-assistant-panel {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 500px;
    max-width: 90vw;
    height: 600px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(40px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.ai-assistant-panel.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-assistant-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ai-assistant-title i {
    font-size: 18px;
    color: white;
}

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

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-close-btn i {
    font-size: 14px;
    color: white;
}

.ai-chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chat-container::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

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

.ai-chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Welcome Screen */
.ai-welcome {
    text-align: center;
    padding: 40px 20px;
}

.ai-welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-welcome-icon i {
    font-size: 36px;
    color: white;
}

.ai-welcome h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
}

.ai-welcome p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.ai-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.ai-suggestion {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-suggestion i {
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.ai-suggestion:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
}

/* Chat Messages */
.ai-message-wrapper {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

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

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

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.ai-avatar.user {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    color: white;
}

.ai-avatar.assistant {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
}

.ai-avatar.assistant img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.ai-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: white;
}

.ai-message-wrapper.user .ai-message-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.ai-message-wrapper.assistant .ai-message-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    color: white;
    border-radius: 16px 16px 16px 4px;
}

.ai-message-content p {
    margin: 0 0 8px 0;
    color: white;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: white;
}

.ai-message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.ai-message-content pre code {
    background: none;
    padding: 0;
    color: white;
}

.ai-message-content strong {
    color: white;
    font-weight: 600;
}

.ai-message-content a {
    color: white;
    text-decoration: underline;
}

.ai-message-content ul,
.ai-message-content ol {
    color: white;
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message-content li {
    color: white;
    margin: 4px 0;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.ai-typing-dots {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    padding: 12px 20px;
    border-radius: 16px 16px 16px 4px;
    display: flex;
    gap: 6px;
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0.6;
    animation: typingDot 1.4s infinite;
}

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

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

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

/* Action Response */
.ai-action-response {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
}

.ai-action-title {
    font-weight: 600;
    color: white;
    margin-bottom: 6px;
    font-size: 13px;
}

.ai-action-detail {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Input Container */
.ai-input-container {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-input {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    font-family: 'Lexend', sans-serif;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: all 0.2s ease;
}

.ai-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: white;
}

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

.ai-send-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: white;
}

.ai-send-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.ai-send-btn:active {
    transform: translateY(0);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-send-btn:disabled:hover {
    transform: none;
    background: transparent;
}

.ai-send-btn i {
    font-size: 16px;
    color: white;
}

/* System Message */
.ai-system-message {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: white;
    text-align: center;
}

/* Error Message */
.ai-error-message {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: white;
}

/* Success Message */
.ai-success-message {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: white;
    white-space: pre-wrap;
    line-height: 1.6;
}

.ai-success-message strong {
    font-weight: 600;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-search-container {
        padding: 5px 14px;
    }
    
    .ai-search-text {
        font-size: 12px;
    }
    
    .ai-search-icon {
        font-size: 13px;
    }
    
    .ai-assistant-panel {
        width: 95vw;
        height: 80vh;
        max-height: 600px;
    }
    
    .ai-suggestions {
        grid-template-columns: 1fr;
    }
    
    .ai-message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .ai-search-text {
        display: none;
    }
    
    .ai-search-container {
        padding: 5px 10px;
        gap: 6px;
    }
    
    .ai-search-icon {
        font-size: 14px;
    }
}