/* ==========================================
   VN Career Pro - AI Chat Styles
   ========================================== */

/* Floating Chat Button */
.vncp-chat-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 115, 170, 0.4);
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vncp-chat-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 115, 170, 0.5);
}

.vncp-chat-floating-btn.active {
    background: #e74c3c;
}

.vncp-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

.vncp-badge-pulse {
    animation: vncp-pulse 1.5s infinite;
}

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

/* Chat Container */
.vncp-ai-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateY(100%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.vncp-ai-chat-container.vncp-chat-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat Header */
.vncp-chat-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vncp-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vncp-chat-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vncp-chat-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.vncp-chat-status {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vncp-status-dot {
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    animation: vncp-blink 2s infinite;
}

@keyframes vncp-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.vncp-chat-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vncp-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Chat Messages */
.vncp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

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

.vncp-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.vncp-chat-messages::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 3px;
}

.vncp-message {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    animation: vncp-slide-in 0.3s ease;
}

@keyframes vncp-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.vncp-message-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.vncp-message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.vncp-message-text {
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
    font-size: 14px;
    color: #333;
}

.vncp-message-user .vncp-message-text {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
}

.vncp-message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.vncp-message-text li {
    margin: 5px 0;
}

.vncp-message-text strong {
    color: #0073aa;
}

.vncp-message-user .vncp-message-text strong {
    color: #fff;
}

.vncp-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

/* Citations */
.vncp-citations {
    margin-top: 10px;
    padding: 12px;
    background: #e7f3f8;
    border-radius: 8px;
    border-left: 3px solid #0073aa;
}

.vncp-citations-header {
    font-size: 12px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 8px;
}

.vncp-citation-link {
    display: block;
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
    padding: 4px 0;
    transition: all 0.2s ease;
}

.vncp-citation-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Suggestions */
.vncp-chat-suggestions {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vncp-suggestion-btn {
    background: #f0f7fa;
    border: 1px solid #c5e4f2;
    color: #0073aa;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.vncp-suggestion-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: translateY(-2px);
}

/* Chat Input */
.vncp-chat-input-wrapper {
    border-top: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 0 0 20px 20px;
}

.vncp-input-container {
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#vncp-chat-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    transition: all 0.2s ease;
}

#vncp-chat-input:focus {
    outline: none;
    border-color: #0073aa;
}

.vncp-send-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vncp-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.3);
}

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

.vncp-chat-footer {
    padding: 8px 15px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.vncp-powered-by {
    font-size: 10px;
    color: #999;
}

/* Loading Indicator */
.vncp-chat-loading {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
}

.vncp-typing-indicator {
    display: flex;
    gap: 4px;
}

.vncp-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #0073aa;
    border-radius: 50%;
    animation: vncp-typing 1.4s infinite;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .vncp-ai-chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .vncp-chat-header {
        border-radius: 0;
    }

    .vncp-chat-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .vncp-message-content {
        max-width: 85%;
    }

    .vncp-chat-suggestions {
        flex-direction: column;
    }

    .vncp-suggestion-btn {
        width: 100%;
        text-align: left;
    }
}
