/* ===================================
   CHAT BOX WIDGET
   =================================== */

.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-body);
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer !important;
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    animation: chatPulse 2s ease-in-out infinite;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 243, 255, 0.6);
}

@keyframes chatPulse {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(0, 243, 255, 0.4);
    }

    50% {
        box-shadow: 0 10px 40px rgba(0, 243, 255, 0.7), 0 0 20px rgba(180, 0, 255, 0.3);
    }
}

.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideIn 0.3s ease-out;
}

.chat-box.active {
    display: flex;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    background: var(--gradient-primary);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(0, 243, 255, 0.3);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.chat-header-text p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer !important;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-cyan);
    border-radius: 10px;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background: var(--gradient-primary);
    color: white;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

.chat-quick-replies {
    padding: 0 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-reply-btn {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--primary-cyan);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer !important;
    transition: all 0.3s ease;
}

.quick-reply-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    border-color: var(--primary-cyan);
    transform: translateY(-2px);
}

.chat-input-container {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-cyan);
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .chat-box {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        right: 20px;
    }
}