#chat-widget {
    width: 100%;
    margin: 2rem auto;
    border: 2px solid rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 50%, rgba(15, 23, 42, 0.3) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

#chat-widget::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

#chat-widget:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(168, 85, 247, 0.15);
    transform: translateY(-3px);
}

#chat-header {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid rgba(168, 85, 247, 0.2);
    position: relative;
    z-index: 1;
}

#chat-header .icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

#chat-header .icon svg {
    width: 22px;
    height: 22px;
    fill: #0f172a;
}

#chat-header .title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

#chat-header .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

#chat-header .status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#chat-header .status-dot {
    width: 8px;
    height: 8px;
    background: #a855f7;
    border-radius: 50%;
    box-shadow: 0 0 10px #a855f7;
    animation: status-pulse 2s infinite ease-in-out;
}

@keyframes status-pulse {
    0%, 100% { opacity: 0.6; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 14px #a855f7; }
}

#messages {
    height: 380px;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    position: relative;
    z-index: 1;
}

#messages::-webkit-scrollbar {
    width: 6px;
}

#messages::-webkit-scrollbar-track {
    background: transparent;
}

#messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.user {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.msg.assistant .msg-avatar {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    color: #0f172a;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}

.msg.user .msg-avatar {
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.msg-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.msg.assistant .msg-bubble {
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-main);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-top-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.msg.user .msg-bubble {
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.msg-bubble p {
    margin: 0 0 10px;
}

.msg-bubble p:last-child {
    margin: 0;
}

.msg-bubble strong {
    color: var(--accent);
    font-weight: 600;
}

.msg-bubble a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1.5px solid rgba(245, 158, 11, 0.3);
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.msg-bubble a:hover {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.msg-bubble code {
    background: var(--bg-main);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: 'Fira Code', 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.msg-bubble ul {
    padding-left: 18px;
    margin: 8px 0;
}

.msg-bubble li {
    margin: 6px 0;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px 14px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

#suggested-questions {
    padding: 0 24px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.suggestion-btn {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
    color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

#input-area {
    padding: 16px 20px;
    border-top: 1px solid rgba(168, 85, 247, 0.15);
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

#user-input {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s ease;
    line-height: 1.5;
}

#user-input::placeholder {
    color: var(--text-muted);
}

#user-input:focus {
    border-color: #a855f7;
}

#send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

#send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    filter: brightness(1.1);
}

#send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

#send-btn:disabled {
    background: var(--border);
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

#send-btn svg {
    width: 18px;
    height: 18px;
    fill: #0f172a;
}

#disclaimer {
    padding: 12px 24px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
}
