/* ═══════════════════════════════════════════════════
   G Delivers — Unified Contact FAB + Live Chat Widget
   (livechat.css)
   ═══════════════════════════════════════════════════ */

:root {
    --gdc-brand: #0057FF;
    --gdc-brand-dark: #0040CC;
    --gdc-brand-light: #EBF0FF;
    --gdc-accent: #00C2FF;
    --gdc-wa: #25D366;
    --gdc-wa-dark: #1EB557;
    --gdc-surface: #FFFFFF;
    --gdc-bg: #F4F6FB;
    --gdc-text: #1A1D2E;
    --gdc-muted: #6B7280;
    --gdc-border: #E5E9F2;
    --gdc-bubble-out: #0057FF;
    --gdc-bubble-in: #F0F3FB;
    --gdc-radius: 18px;
    --gdc-shadow: 0 8px 40px rgba(0, 87, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════════
   CONTACT MENU WRAPPER
   ═══════════════════════════════════════════════ */
#gdc-contact-menu {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

/* ═══════════════════════════════════════════════
   MAIN FAB BUTTON
   ═══════════════════════════════════════════════ */
#gdc-fab-main {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gdc-brand), var(--gdc-accent));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0, 87, 255, 0.42), 0 1px 4px rgba(0, 0, 0, 0.10);
    transition: transform 0.25s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.2s;
    overflow: visible;
    flex-shrink: 0;
}

#gdc-fab-main:hover {
    transform: scale(1.10);
    box-shadow: 0 6px 32px rgba(0, 87, 255, 0.55);
}

/* Pulse ring */
#gdc-fab-main::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(0, 87, 255, 0.22);
    animation: gdc-ring-pulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes gdc-ring-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* FAB icons */
.gdc-fab-icon {
    position: absolute;
    transition: opacity 0.2s, transform 0.3s;
}

.gdc-fab-default {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.gdc-fab-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

#gdc-contact-menu.gdc-menu-open .gdc-fab-default {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

#gdc-contact-menu.gdc-menu-open .gdc-fab-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Notification dot */
#gdc-notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 13px;
    height: 13px;
    background: #FF3B3B;
    border: 2.5px solid #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
}

/* ═══════════════════════════════════════════════
   SPEED DIAL ITEMS
   ═══════════════════════════════════════════════ */
#gdc-speed-dial {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
    pointer-events: none;
}

.gdc-dial-item {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(16px) scale(0.88);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
}

/* Stagger: WhatsApp first (at bottom of list), then Chat */
#gdc-wa-item {
    transition-delay: 0.04s;
}

#gdc-chat-item {
    transition-delay: 0.00s;
}

/* Revealed when menu open */
#gdc-contact-menu.gdc-menu-open #gdc-speed-dial {
    pointer-events: all;
}

#gdc-contact-menu.gdc-menu-open .gdc-dial-item {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#gdc-contact-menu.gdc-menu-open #gdc-wa-item {
    transition-delay: 0.06s;
}

#gdc-contact-menu.gdc-menu-open #gdc-chat-item {
    transition-delay: 0.00s;
}

/* Chat window open: hide speed-dial, show close icon on FAB */
#gdc-contact-menu.gdc-chat-active .gdc-fab-default {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

#gdc-contact-menu.gdc-chat-active .gdc-fab-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#gdc-contact-menu.gdc-chat-active #gdc-speed-dial {
    pointer-events: none !important;
}

#gdc-contact-menu.gdc-chat-active .gdc-dial-item {
    opacity: 0 !important;
    transform: translateY(16px) scale(0.88) !important;
    transition-delay: 0s !important;
}

/* Label pill */
.gdc-dial-label {
    background: rgba(20, 24, 38, 0.82);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 20px;
    white-space: nowrap;
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    letter-spacing: 0.01em;
}

/* Dial icon buttons */
.gdc-dial-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.2s;
    text-decoration: none;
}

.gdc-dial-btn:hover {
    transform: scale(1.12);
}

.gdc-dial-wa {
    background: var(--gdc-wa);
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.42);
}

.gdc-dial-wa:hover {
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.55);
}

.gdc-dial-chat {
    background: linear-gradient(135deg, var(--gdc-brand), var(--gdc-accent));
    box-shadow: 0 4px 18px rgba(0, 87, 255, 0.40);
}

.gdc-dial-chat:hover {
    box-shadow: 0 6px 22px rgba(0, 87, 255, 0.52);
}

/* ═══════════════════════════════════════════════
   CHAT WINDOW
   ═══════════════════════════════════════════════ */
#gdc-chat-window {
    position: fixed;
    bottom: 106px;
    right: 28px;
    width: 370px;
    max-height: 580px;
    background: var(--gdc-surface);
    border-radius: 24px;
    box-shadow: var(--gdc-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(.34, 1.56, .64, 1), opacity 0.25s ease;
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
}

#gdc-chat-window.gdc-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.gdc-header {
    background: linear-gradient(120deg, var(--gdc-brand) 0%, #0085FF 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.gdc-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.gdc-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gdc-header-info {
    flex: 1;
    min-width: 0;
}

.gdc-header-name {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gdc-header-status {
    color: rgba(255, 255, 255, 0.80);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.gdc-status-dot {
    width: 7px;
    height: 7px;
    background: #4AFF91;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(74, 255, 145, 0.3);
    animation: gdc-pulse-dot 2s infinite;
}

@keyframes gdc-pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(74, 255, 145, 0.3);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(74, 255, 145, 0.08);
    }
}

.gdc-header-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.gdc-header-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    color: #fff;
    flex-shrink: 0;
}

.gdc-header-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Messages */
#gdc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--gdc-bg);
    min-height: 0;
    max-height: 360px;
    scroll-behavior: smooth;
}

#gdc-messages::-webkit-scrollbar {
    width: 4px;
}

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

#gdc-messages::-webkit-scrollbar-thumb {
    background: #ced5e8;
    border-radius: 4px;
}

/* Bubbles */
.gdc-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: gdc-slide-in 0.28s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes gdc-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gdc-msg-row.gdc-out {
    flex-direction: row-reverse;
}

.gdc-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gdc-brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.gdc-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gdc-bubble {
    max-width: 82%;
    padding: 10px 15px;
    border-radius: var(--gdc-radius);
    line-height: 1.55;
    font-size: 13.5px;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    white-space: pre-wrap;
}

.gdc-bubble.gdc-in {
    background: var(--gdc-bubble-in);
    color: var(--gdc-text);
    border-bottom-left-radius: 5px;
}

.gdc-bubble.gdc-out {
    background: var(--gdc-bubble-out);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 87, 255, 0.28);
}

.gdc-bubble-time {
    font-size: 10.5px;
    color: var(--gdc-muted);
    margin-top: 3px;
    padding: 0 4px;
    align-self: flex-end;
}

.gdc-msg-row.gdc-out .gdc-bubble-time {
    text-align: right;
}

/* Typing */
.gdc-typing-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.gdc-typing-bubble {
    background: var(--gdc-bubble-in);
    border-radius: var(--gdc-radius);
    border-bottom-left-radius: 5px;
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.gdc-typing-bubble span {
    width: 7px;
    height: 7px;
    background: #9DA8C0;
    border-radius: 50%;
    display: inline-block;
    animation: gdc-typing-bounce 1.2s infinite;
}

.gdc-typing-bubble span:nth-child(2) {
    animation-delay: .2s;
}

.gdc-typing-bubble span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes gdc-typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

/* Quick replies */
#gdc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    background: var(--gdc-bg);
}

.gdc-quick-chip {
    padding: 6px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--gdc-brand);
    background: var(--gdc-surface);
    color: var(--gdc-brand);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.gdc-quick-chip:hover {
    background: var(--gdc-brand);
    color: #fff;
    transform: translateY(-1px);
}

/* Footer / input */
.gdc-chat-footer {
    padding: 12px 14px;
    background: var(--gdc-surface);
    border-top: 1px solid var(--gdc-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#gdc-msg-input {
    flex: 1;
    background: var(--gdc-bg);
    border: 1.5px solid var(--gdc-border);
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--gdc-text);
    outline: none;
    resize: none;
    line-height: 1.45;
    max-height: 90px;
    overflow-y: auto;
    transition: border-color 0.2s;
}

#gdc-msg-input:focus {
    border-color: var(--gdc-brand);
}

#gdc-msg-input::placeholder {
    color: #A8B0C2;
}

#gdc-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gdc-brand), var(--gdc-accent));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s;
    box-shadow: 0 2px 12px rgba(0, 87, 255, 0.32);
}

#gdc-send-btn:hover {
    transform: scale(1.1);
}

#gdc-send-btn:disabled {
    opacity: .40;
    cursor: not-allowed;
    transform: none;
}

/* Branding */
.gdc-chat-branding {
    text-align: center;
    font-size: 10.5px;
    color: #B0B8CC;
    padding: 5px 0 8px;
    background: var(--gdc-surface);
    letter-spacing: 0.01em;
}

.gdc-chat-branding a {
    color: var(--gdc-brand);
    text-decoration: none;
    font-weight: 600;
}

/* Welcome card */
.gdc-welcome-card {
    background: linear-gradient(135deg, rgba(0, 87, 255, 0.07), rgba(0, 194, 255, 0.05));
    border: 1px solid rgba(0, 87, 255, 0.11);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--gdc-muted);
    line-height: 1.55;
}

.gdc-welcome-card strong {
    color: var(--gdc-brand);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 480px) {
    #gdc-chat-window {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 96px;
        max-height: 72dvh;
    }

    #gdc-contact-menu {
        right: 16px;
        bottom: 16px;
    }
}