/* Live chat widget — shared across pages */
.support-widget-btn {
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fb923c 0%, #f97316 45%, #ea580c 100%);
    color: #fff;
    border: none;
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.45), 0 2px 8px rgba(249, 115, 22, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    animation: chatBtnPulse 2.8s ease-in-out infinite;
}

.support-widget-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(249, 115, 22, 0.35);
    animation: chatRingPulse 2.8s ease-in-out infinite;
    pointer-events: none;
}

.support-widget-btn svg {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.support-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 32px rgba(249, 115, 22, 0.55), 0 4px 12px rgba(249, 115, 22, 0.3);
    animation: none;
}

.support-widget-btn:hover::before {
    animation: none;
    opacity: 0;
}

@keyframes chatBtnPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(249, 115, 22, 0.45), 0 2px 8px rgba(249, 115, 22, 0.25); }
    50% { box-shadow: 0 8px 32px rgba(249, 115, 22, 0.55), 0 4px 16px rgba(249, 115, 22, 0.35); }
}

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

.support-widget-box {
    position: fixed;
    left: 24px;
    bottom: 94px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 420px;
    max-height: 70vh;
    background: #f1f5f9;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.support-widget-box.is-open {
    display: flex;
    animation: supportPop 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes supportPop {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.support-widget-header {
    background: linear-gradient(135deg, #f97316, #ea580c);
    padding: 16px 44px 16px 16px;
    color: #fff;
    position: relative;
}

.support-widget-header h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.support-widget-header p {
    font-size: 12px;
    opacity: 0.95;
}

.support-widget-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.support-widget-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.support-widget-clear {
    position: absolute;
    bottom: 8px;
    right: 44px;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.support-widget-clear:hover {
    background: rgba(255, 255, 255, 0.35);
}

.support-widget-avatars {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
}

.support-widget-avatars span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #fff;
    margin-right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.support-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-image:
        radial-gradient(circle at 20px 20px, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 40px 40px, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
}

.support-widget-welcome {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    padding: 24px 12px;
}

#supportWidgetMessages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
}

.support-msg-bubble {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    animation: msgIn 0.25s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.support-msg-bubble.visitor {
    align-self: flex-end;
    background: rgba(33, 150, 243, 0.2);
    color: #0f172a;
}

.support-msg-bubble.support {
    align-self: flex-start;
    background: rgba(249, 115, 22, 0.2);
    color: #0f172a;
}

.support-msg-bubble .bubble-time {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.support-widget-footer {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.support-widget-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.support-widget-input-wrap:focus-within {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.support-widget-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 8px;
    font-family: inherit;
    font-size: 14px;
    direction: rtl;
}

.support-widget-input-wrap input::placeholder {
    color: #94a3b8;
}

.support-widget-input-wrap input:focus {
    outline: none;
}

.support-widget-actions {
    display: flex;
    gap: 4px;
}

.support-widget-actions button {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s, transform 0.15s;
}

.support-widget-actions button:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.support-widget-actions button:active {
    transform: scale(0.92);
}

#supportWidgetSend:hover {
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ea580c);
}

@media (max-width: 480px) {
    .support-widget-box {
        left: 12px;
        bottom: 82px;
        width: calc(100vw - 24px);
    }
    .support-widget-btn {
        left: 12px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }
}
