.chat-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-primary, sans-serif);
}

.chat-trigger-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-primary, #c9a84c);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.6);
}

.chat-trigger-btn .unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #f44336;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-bg, #0e0c08);
}

/* Panel */
.chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background-color: var(--color-bg, #0e0c08);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    transform-origin: bottom right;
}

.chat-panel.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--color-primary, #c9a84c), #a38234);
    color: #fff;
    padding: 20px 20px 30px;
    position: relative;
}

/* Curved effect matching the image */
.chat-header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: var(--color-bg, #0e0c08);
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
}

.chat-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.chat-avatar {
    position: relative;
}

.chat-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #4caf50;
    border-radius: 50%;
    border: 2px solid var(--color-primary, #c9a84c);
}

.chat-title h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: #fff;
}

.chat-subtitle p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--color-bg, #0e0c08);
    position: relative;
    z-index: 1; /* Above header curve */
}

.chat-message {
    display: flex;
    max-width: 85%;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background-color: var(--color-contrast-lower, #151515);
    color: var(--color-contrast-higher, #fff);
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid rgba(255,255,255,0.05);
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: 5px;
}

.chat-option-btn {
    background-color: transparent;
    color: var(--color-primary, #c9a84c);
    border: 1px solid var(--color-primary, #c9a84c);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    width: 90%;
    transition: background-color 0.2s, color 0.2s;
}

.chat-option-btn:hover {
    background-color: var(--color-primary, #c9a84c);
    color: #000;
}

/* Footer */
.chat-footer {
    padding: 15px 20px;
    background-color: var(--color-bg, #0e0c08);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
}

.chat-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-contrast-higher, #fff);
    font-size: 0.95rem;
    padding: 10px 0;
    outline: none;
}

.chat-input-wrapper input::placeholder {
    color: var(--color-contrast-medium, #888);
}

.chat-input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.chat-input-icons button {
    background: transparent;
    border: none;
    color: var(--color-contrast-medium, #888);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    margin-right: 5px;
    transition: color 0.2s;
}

.chat-input-icons button:hover {
    color: var(--color-primary, #c9a84c);
}

.powered-by {
    font-size: 0.65rem;
    color: var(--color-contrast-medium, #888);
    letter-spacing: 0.5px;
}

.powered-by strong {
    color: var(--color-contrast-higher, #fff);
}

.send-btn {
    background-color: var(--color-primary, #c9a84c);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.send-btn:hover {
    opacity: 0.8;
}

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