/* Frumkin Brothers Chat Widget */

#frumkin-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    font-family: 'Lato', sans-serif;
}

/* Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a2a3a, #0f1a24);
    border: 2px solid #c9a959;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}

.chat-icon {
    font-size: 1.75rem;
}

.chat-close {
    display: none;
    font-size: 1.5rem;
    color: #c9a959;
}

#frumkin-chat.open .chat-icon { display: none; }
#frumkin-chat.open .chat-close { display: block; }

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-height: 500px;
    background: #f8f6f1;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#frumkin-chat.open .chat-window {
    display: flex;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #1a2a3a, #0f1a24);
    color: white;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #c9a959;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #c9a959;
    font-size: 1rem;
}

.chat-title strong {
    display: block;
    font-size: 1rem;
}

.chat-title span {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 300px;
    background: white;
}

.chat-welcome {
    background: #f0ede6;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-welcome p {
    margin: 0 0 8px 0;
}

.chat-welcome p:last-child {
    margin-bottom: 0;
}

/* Individual Messages */
.chat-message {
    margin-bottom: 12px;
    max-width: 85%;
}

.chat-message p {
    margin: 0;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.user {
    margin-left: auto;
}

.chat-message.user p {
    background: #1a2a3a;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant p {
    background: #f0ede6;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-message.typing p {
    color: #999;
    font-style: italic;
}

/* Input Area */
.chat-input-area {
    padding: 12px 16px;
    background: #f8f6f1;
    border-top: 1px solid #e8e4db;
}

/* Loading State */
.chat-loading {
    text-align: center;
    padding: 8px 0;
}

.chat-loading > p:first-child {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.loading-bar {
    height: 6px;
    background: #e8e4db;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c9a959, #d4bc7a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-status {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.chat-input {
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
}

.chat-input input:focus {
    border-color: #c9a959;
}

.chat-input button {
    padding: 10px 18px;
    background: #c9a959;
    color: #1a2a3a;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-input button:hover {
    background: #d4bc7a;
}

/* Mobile */
@media (max-width: 480px) {
    #frumkin-chat {
        bottom: 16px;
        right: 16px;
    }

    .chat-window {
        width: calc(100vw - 32px);
        right: 0;
        bottom: 70px;
    }
}
