/**
 * DAG-USA Chat Assistant UI
 * Following DAG design system: gold (#c4a46a), compact spacing, no blue
 */

.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #c4a46a;
    border: 2px solid #a68954;
    color: #1a140c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(196, 164, 106, 0.4);
    transition: all 0.2s ease;
    z-index: 9998;
}

.chat-bubble:hover {
    background: #d4b47a;
    box-shadow: 0 6px 16px rgba(196, 164, 106, 0.6);
    transform: translateY(-2px);
}

.chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: #070707;
    border: 1px solid rgba(196, 164, 106, 0.5);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 9999;
}

.chat-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a140c 0%, #2a2010 100%);
    border-bottom: 1px solid rgba(196, 164, 106, 0.3);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header strong {
    display: block;
    color: #c4a46a;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.chat-header span {
    display: block;
    color: #8893ab;
    font-size: 12px;
}

.chat-close {
    background: rgba(196, 164, 106, 0.1);
    border: 1px solid rgba(196, 164, 106, 0.3);
    border-radius: 6px;
    color: #c4a46a;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.chat-close:hover {
    background: rgba(196, 164, 106, 0.2);
    border-color: #c4a46a;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
}

.chat-message-user {
    align-items: flex-end;
}

.chat-message-assistant {
    align-items: flex-start;
}

.chat-message-content {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message-user .chat-message-content {
    background: rgba(196, 164, 106, 0.15);
    border: 1px solid rgba(196, 164, 106, 0.3);
    color: #e6edf7;
}

.chat-message-assistant .chat-message-content {
    background: #0d0d0d;
    border: 1px solid rgba(136, 147, 171, 0.2);
    color: #d4dae8;
}

.chat-message-assistant .chat-message-content a {
    color: #c4a46a;
    text-decoration: underline;
}

.chat-message-assistant .chat-message-content a:hover {
    color: #d4b47a;
}

.chat-typing {
    display: inline-block;
    animation: chatTyping 1.4s infinite;
}

@keyframes chatTyping {
    0%, 60%, 100% { opacity: 1; }
    30% { opacity: 0.4; }
}

.chat-input-wrap {
    padding: 12px;
    border-top: 1px solid rgba(196, 164, 106, 0.3);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    background: #0d0d0d;
    border: 1px solid rgba(196, 164, 106, 0.3);
    border-radius: 8px;
    color: #e6edf7;
    font-size: 14px;
    padding: 10px 12px;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    min-height: 44px;
    max-height: 100px;
}

#chat-input:focus {
    outline: none;
    border-color: #c4a46a;
}

#chat-input::placeholder {
    color: #6b7589;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: #c4a46a;
    border: 1px solid #a68954;
    border-radius: 8px;
    color: #1a140c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: #d4b47a;
    transform: translateY(-1px);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .chat-bubble {
        bottom: 16px;
        right: 16px;
    }
}
