/* --- Floating Chat Support Widget --- */
.support-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: 'Poppins', sans-serif;
}

/* Toggle Button */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(200, 169, 107, 0.3);
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    position: relative;
}

.chat-toggle-btn:hover {
    background: var(--gold-hover);
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 12px 30px rgba(200, 169, 107, 0.45);
}

.chat-toggle-btn .unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #080808;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* Chat Box Container */
.chat-box-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    border-radius: 16px;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(200, 169, 107, 0.2);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.chat-box-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Header */
.chat-box-header {
    background: rgba(200, 169, 107, 0.08);
    border-bottom: 1px solid rgba(200, 169, 107, 0.15);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-box-header .agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-box-header .agent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--gold);
    background: rgba(200,169,107,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.chat-box-header .agent-details h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    font-family: 'Playfair Display', serif;
}

.chat-box-header .agent-details span {
    font-size: 0.72rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-box-header .agent-details span::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

.chat-box-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.chat-box-close:hover {
    color: var(--gold);
}

/* Chat Body (Messages Area) */
.chat-box-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    scroll-behavior: smooth;
}

/* Chat Input Bar */
.chat-box-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 10, 10, 0.5);
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 6px 14px;
    transition: border-color 0.3s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--gold);
}

.chat-input-wrapper textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    resize: none;
    height: 24px;
    max-height: 80px;
    line-height: 24px;
    padding: 0;
}

/* Mic & Send Buttons */
.chat-action-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    outline: none;
}

.chat-action-btn:hover {
    color: var(--gold);
}

.chat-action-btn.send-msg-btn {
    color: var(--gold);
}

.chat-action-btn.send-msg-btn:hover {
    transform: scale(1.1);
}

/* Registration Form Card */
.chat-reg-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 10px;
}

.chat-reg-form h4 {
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 8px;
    text-align: center;
}

.chat-reg-form p {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 25px;
}

.chat-reg-form .form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.chat-reg-form label {
    font-size: 0.72rem;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.chat-reg-form input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.3s;
}

.chat-reg-form input:focus {
    border-color: var(--gold);
}

.chat-reg-btn {
    background: var(--gold);
    color: #000;
    border: none;
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: background 0.3s;
}

.chat-reg-btn:hover {
    background: var(--gold-hover);
}

/* --- Message Bubbles (WhatsApp Style) --- */
.chat-msg-row {
    display: flex;
    width: 100%;
}

.chat-msg-row.msg-customer {
    justify-content: flex-end;
}

.chat-msg-row.msg-admin {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.chat-msg-row.msg-customer .chat-bubble {
    background: rgba(200, 169, 107, 0.16);
    border: 1px solid rgba(200, 169, 107, 0.25);
    color: #fff;
    border-top-right-radius: 2px;
}

.chat-msg-row.msg-admin .chat-bubble {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #dcdcdc;
    border-top-left-radius: 2px;
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 0.65rem;
    color: #888;
    margin-top: 4px;
    text-align: right;
}

/* Status Ticks */
.msg-tick {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
}

.msg-tick.tick-sent {
    color: #888;
}

.msg-tick.tick-delivered {
    color: #888;
}

.msg-tick.tick-seen {
    color: #34b7f1; /* WhatsApp Blue */
}

/* Voice Message Bubble Player */
.voice-player-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
    padding: 4px 2px;
}

.voice-play-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    outline: none;
}

.voice-play-btn:hover {
    background: var(--gold-hover);
}

.voice-progress-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.voice-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gold);
    border-radius: 2px;
}

.voice-time-label {
    font-size: 0.65rem;
    color: #aaa;
}

/* Mic Recording UI Overlay */
.recording-overlay {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 4px 10px;
}

.recording-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 1.2s infinite;
}

.recording-timer {
    font-size: 0.85rem;
    color: var(--danger);
    font-weight: 600;
}

.recording-hint {
    flex-grow: 1;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Responsive adjustments for chat box widget */
@media (max-width: 480px) {
    .chat-box-container {
        width: calc(100vw - 40px);
        right: -10px;
        height: 480px;
    }
    .support-chat-widget {
        bottom: 15px;
        right: 20px;
    }
}
