/* Global Floating Chat Styles */
:root {
    --chat-accent: #ff9d00;
    --chat-bg: rgba(20, 20, 20, 0.95);
    --chat-glass: rgba(255, 255, 255, 0.05);
    --chat-border: rgba(255, 255, 255, 0.1);
}

/* Floating Icon */
.floating-chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--chat-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 157, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    color: #000;
}

.floating-chat-trigger:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 157, 0, 0.5);
}

.floating-chat-trigger i {
    width: 28px;
    height: 28px;
}

/* Chat Window */
.floating-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: var(--chat-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--chat-accent);
    border-radius: 20px;
    display: none;
    /* Toggled by JS */
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.chat-header {
    background: rgba(255, 157, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--chat-border);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--chat-accent);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.close-chat {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.close-chat:hover {
    opacity: 1;
}

.chat-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Messages */
.chat-bubble {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.chat-bubble.ai {
    background: var(--chat-glass);
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid var(--chat-border);
}

.chat-bubble.user {
    background: var(--chat-accent);
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    font-weight: 600;
}

/* Input Area */
.chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--chat-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
}

.chat-footer input {
    flex: 1;
    background: #000;
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    padding: 12px;
    color: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.chat-footer input:focus {
    border-color: var(--chat-accent);
}

.chat-footer button {
    background: var(--chat-accent);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    transition: transform 0.2s;
}

.chat-footer button:hover {
    transform: scale(1.05);
}

/* Scrollbar */
.chat-body::-webkit-scrollbar {
    width: 5px;
}

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

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 157, 0, 0.2);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 480px) {
    .floating-chat-window {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 90px;
        height: 70vh;
    }
}