/* === Floating Chat Button & Widget === */

/* Chat FAB (Floating Action Button) */
.chat-fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-tooltip {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chat-fab-container:hover .chat-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.chat-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(167, 139, 250, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #a78bfa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3),
        0 0 40px rgba(167, 139, 250, 0.2);
    animation: float 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-fab i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-fab:hover {
    transform: scale(1.1);
    background: rgba(167, 139, 250, 0.3);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4),
        0 0 60px rgba(167, 139, 250, 0.3);
}

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    max-height: 600px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(167, 139, 250, 0.1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow: hidden;
}

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

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(167, 139, 250, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-info i {
    font-size: 1.5rem;
    color: #a78bfa;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.chat-status {
    font-size: 0.75rem;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.chat-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
    border-radius: 8px;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 350px;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(167, 139, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    flex-shrink: 0;
}

.message-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    max-width: 75%;
}

.message-content p {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message-content p+p {
    margin-top: 0.5rem;
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send {
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send:hover:not(:disabled) {
    background: rgba(167, 139, 250, 0.3);
    transform: translateY(-2px);
}

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

/* Quick Actions */
.chat-quick-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem 1.5rem;
}

.quick-action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.quick-action-btn i {
    font-size: 1.2rem;
    color: #a78bfa;
}

.quick-action-btn:hover {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 1rem;
        max-height: 500px;
    }

    .chat-fab-container {
        right: 1rem;
        bottom: 1rem;
    }

    .chat-tooltip {
        display: none;
    }
}