/* AI Chat Styles */
:root {
    --chat-accent: #00d2d3;
    --chat-bg: rgba(20, 20, 30, 0.95);
    --chat-user-msg: rgba(108, 92, 231, 0.4);
    --chat-bot-msg: rgba(255, 255, 255, 0.1);
}

/* Floating Toggle Button */
.ai-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6c5ce7, #00d2d3);
    /* Theme Gradient */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 210, 211, 0.5);
    /* Cyan shadow */
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
    color: white;
    /* Vital for SVG stroke="currentColor" */
}

.ai-fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 10px 30px rgba(0, 210, 211, 0.8);
    animation: none;
    /* Stop pulse on hover */
}

.ai-fab i {
    font-size: 24px;
    color: white;
}

/* Chat Interface Window */
.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: rgba(20, 20, 30, 0.85);
    /* More transparent */
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ai-chat-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Header */
.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #00d2d3, #6c5ce7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

/* --- Chat Options (Buttons) --- */
#ai-chat-options {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-option-btn {
    background: rgba(255, 255, 255, 0.05);
    /* Glassy button */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-grow: 1;
    text-align: center;
    backdrop-filter: blur(5px);
}

.chat-option-btn:hover {
    background: #00d2d3;
    /* Theme Cyan */
    color: #000;
    border-color: #00d2d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 210, 211, 0.4);
}

/* --- Keyframes --- */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 210, 211, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(0, 210, 211, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 210, 211, 0);
    }
}

/* --- Messages --- */
.chat-message.bot strong {
    color: #0056b3;
}

.chat-message.bot a {
    color: #007bff;
    text-decoration: underline;
}

.chat-info h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.chat-info span {
    font-size: 0.75rem;
    color: #00d2d3;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

/* Messages Area */
.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: fadeInMsg 0.3s ease-out;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-msg);
    color: #e0e0e0;
    border-bottom-left-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-msg);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 16px;
    background: var(--chat-bot-msg);
    border-radius: 12px;
    align-self: flex-start;
    display: none;
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    animation: wave 1.3s linear infinite;
    margin-right: 3px;
}

.typing-dots span:nth-child(2) {
    animation-delay: -1.1s;
}

.typing-dots span:nth-child(3) {
    animation-delay: -0.9s;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: var(--chat-accent);
}

.send-btn {
    background: var(--chat-accent);
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wave {

    0%,
    60%,
    100% {
        transform: initial;
    }

    30% {
        transform: translateY(-5px);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .ai-fab {
        bottom: 20px;
        right: 20px;
    }
}