/* Glassmorphism Chat Widget */
:root {
    --chat-primary: #1595b6;
    --chat-bg: rgba(20, 20, 20, 0.6);
    --chat-blur: 15px;
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-text: #ffffff;
    --chat-user-bg: rgba(21, 149, 182, 0.3);
    --chat-ai-bg: rgba(255, 255, 255, 0.05);
}

/* Floating Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--chat-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(21, 149, 182, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(21, 149, 182, 0.6);
}

.chat-toggle i {
    color: white;
    font-size: 24px;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    backdrop-filter: blur(var(--chat-blur));
    -webkit-backdrop-filter: blur(var(--chat-blur));
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header */
.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px 20px 0 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--chat-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h3 i {
    color: var(--chat-primary);
}

.close-chat {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.close-chat:hover {
    color: white;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-bg);
    color: white;
    border-bottom-right-radius: 5px;
    border: 1px solid rgba(21, 149, 182, 0.2);
}

.message.ai {
    align-self: flex-start;
    background: var(--chat-ai-bg);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--chat-border);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: var(--chat-ai-bg);
    padding: 10px 15px;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    gap: 5px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes bounce {

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

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

/* Input Area */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 20px 20px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    outline: none;
    transition: all 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--chat-primary);
    background: rgba(255, 255, 255, 0.1);
}

.chat-input-area button {
    background: var(--chat-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.1);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-window {
        width: 90%;
        right: 5%;
        bottom: 100px;
        height: 60vh;
    }
}
