/* Glassmorphic Chat Widget - restored old glassy style */
:root {
    --chat-accent: #60A5FA;
    --chat-accent-glow: rgba(96, 165, 250, 0.4);
    --chat-bg-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    --chat-glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --chat-backdrop-blur: 20px;
    --chat-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --chat-text: #FFFFFF;
    --chat-text-muted: rgba(255, 255, 255, 0.6);
    --chat-user-msg-bg: rgba(37, 99, 235, 0.6);
    --chat-agent-msg-bg: rgba(255, 255, 255, 0.1);
    --chat-btn-bg: rgba(255, 255, 255, 0.1);
    --chat-btn-hover: rgba(255, 255, 255, 0.15);
}

.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: var(--chat-bg-gradient);
    backdrop-filter: blur(var(--chat-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--chat-backdrop-blur));
    border-radius: 20px;
    border: var(--chat-glass-border);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

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

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

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

.chat-close-btn,
.chat-config-btn {
    background: none;
    border: none;
    color: var(--chat-text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close-btn:hover,
.chat-config-btn:hover {
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--chat-text);
    line-height: 1.4;
    word-wrap: break-word;
    animation: fadeInMsg 0.3s ease-out;
}

.message.agent {
    background: var(--chat-agent-msg-bg);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background: var(--chat-user-msg-bg);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Markdown Styles */
.code-container {
    position: relative;
    margin: 12px 0;
}

.message pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 14px;
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
}

.message code {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #93C5FD;
    line-height: 1.4;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.copy-btn:hover {
    background: var(--chat-accent);
    border-color: var(--chat-accent);
}

/* Options Buttons */
.message-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -10px;
    animation: fadeInMsg 0.4s ease-out;
}

.option-btn {
    background: var(--chat-btn-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--chat-btn-hover);
    border-color: var(--chat-accent);
    transform: translateY(-1px);
}

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

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

.chat-input-area {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: background 0.2s;
}

.chat-input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.chat-send-btn {
    background: var(--chat-accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--chat-accent-glow);
}

@media (max-width: 480px) {
    .chat-widget-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}