/**
 * AI Chat Widget Styles
 * Modern, dark-themed chat widget for NewHotMusic.com support
 */

/* Chat Widget Container */
.ai-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 150px);
    background: rgba(15, 15, 20, 0.98);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.ai-chat-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 180, 0, 0.1));
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

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

.ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.ai-chat-title {
    display: flex;
    flex-direction: column;
}

.ai-chat-title h4 {
    color: #FFD700;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.3px;
}

.ai-chat-title span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.ai-status-indicator {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: pulse-status 2s infinite;
}

.ai-status-indicator.offline {
    background: #FF5722;
    animation: none;
}

@keyframes pulse-status {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.ai-chat-close:hover {
    background: rgba(255, 82, 82, 0.3);
    color: #FF5252;
    transform: rotate(90deg);
}

/* Chat Messages Area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

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

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

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

/* Message Bubbles */
.chat-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: message-appear 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.ai {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.ai .message-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 180, 0, 0.9));
    color: #111;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

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

.chat-message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 80px;
}

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

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* FAQ Suggestions */
.faq-suggestion-card {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.faq-suggestion-card:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateX(4px);
}

.faq-question {
    color: #FFD700;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.faq-answer {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.quick-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    color: #FFD700;
}

/* Create Ticket Prompt */
.create-ticket-prompt {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 180, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 14px;
    margin-top: 12px;
    text-align: center;
}

.create-ticket-prompt p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 0 0 10px 0;
}

.create-ticket-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #111;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.create-ticket-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Chat Input Area */
.ai-chat-input-area {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.ai-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 25px;
    padding: 6px 6px 6px 16px;
    transition: all 0.2s;
}

.ai-chat-input-wrapper:focus-within {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.ai-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    outline: none;
    padding: 8px 0;
}

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

.ai-chat-send {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    color: #111;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-chat-send svg {
    width: 18px;
    height: 18px;
}

/* Toggle Button */
.ai-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    z-index: 10001;
    transition: all 0.3s;
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.ai-chat-toggle.active {
    transform: rotate(180deg);
}

.ai-chat-toggle .chat-icon {
    font-size: 24px;
    transition: all 0.3s;
}

.ai-chat-toggle.active .chat-icon {
    transform: rotate(-180deg);
}

/* Notification Badge */
.ai-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF5252;
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-widget {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-width: 100%;
    }

    .ai-chat-toggle {
        bottom: 80px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}