/* Floating live support widget */
.live-support {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9998;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.live-support-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.15rem;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.live-support-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(16, 185, 129, 0.5);
}

.live-support-fab i {
    font-size: 1.15rem;
}

.live-support-fab-pulse {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: live-support-pulse 2s infinite;
}

@keyframes live-support-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.live-support-fab-label {
    display: none;
}

@media (min-width: 480px) {
    .live-support-fab-label {
        display: inline;
    }
}

.live-support-panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    width: min(320px, calc(100vw - 2rem));
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    transform-origin: bottom right;
    animation: live-support-panel-in 0.25s ease;
}

.live-support-panel[hidden] {
    display: none;
}

@keyframes live-support-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.live-support-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, #0c1e3d, #1e40af);
    color: #fff;
}

.live-support-panel-title {
    font-weight: 800;
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-support-panel-sub {
    font-size: 0.75rem;
    opacity: 0.85;
    margin: 0.2rem 0 0;
}

.live-support-close {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.live-support-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.live-support-panel-body {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.live-support-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.65rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.live-support-online-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

.live-support-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.live-support-action:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.live-support-action--primary {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.live-support-action--primary:hover {
    background: #dbeafe;
}

.live-support-action i {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    background: #f1f5f9;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-support-action--primary i {
    background: #2563eb;
    color: #fff;
}

.live-support-action strong {
    display: block;
    font-size: 0.85rem;
    color: #0f172a;
}

.live-support-action small {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.1rem;
    word-break: break-all;
}

.live-support-panel-foot {
    margin: 0;
    padding: 0.65rem 1rem;
    font-size: 0.7rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.live-support.is-open .live-support-fab {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
}

.live-support--chat-ready .live-support-fab {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.45);
}

.live-support-action--chat {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.live-support-menu-link {
    display: block;
    margin-top: 0.35rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    text-align: center;
    width: 100%;
}

.live-support-menu-link:hover {
    color: #2563eb;
}

[data-theme="dark"] .live-support-menu-link {
    color: #94a3b8;
}

/* Hide Smartsupp default bubble — we use the site Live Chat button */
.live-chat-smartsupp-active #smartsupp-widget-container .widget-button,
.live-chat-smartsupp-active #smartsupp-widget-container .widget-launcher,
.live-chat-smartsupp-active .smartsupp-widget-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Dark mode */
[data-theme="dark"] .live-support-panel {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .live-support-action {
    border-color: #334155;
    background: #0f172a;
}

[data-theme="dark"] .live-support-action:hover {
    background: #334155;
}

[data-theme="dark"] .live-support-action--primary {
    background: #1e3a5f;
    border-color: #2563eb;
}

[data-theme="dark"] .live-support-action strong {
    color: #f1f5f9;
}

[data-theme="dark"] .live-support-action small {
    color: #94a3b8;
}

[data-theme="dark"] .live-support-action i {
    background: #334155;
    color: #93c5fd;
}

[data-theme="dark"] .live-support-action--primary i {
    background: #2563eb;
    color: #fff;
}

[data-theme="dark"] .live-support-status {
    background: #064e3b;
    border-color: #047857;
    color: #a7f3d0;
}

[data-theme="dark"] .live-support-panel-foot {
    background: #0f172a;
    border-top-color: #334155;
    color: #64748b;
}

@media (max-width: 640px) {
    .live-support {
        bottom: 1rem;
        right: 1rem;
    }

    .live-support-fab {
        padding: 0.9rem;
        border-radius: 50%;
        width: 3.5rem;
        height: 3.5rem;
        justify-content: center;
    }
}
