/* ============================================================
   Support Widget — 3 variants (A: Chat, B: Glass modal, C: Popover)
   Admin választja a varianset: /admin/site-animation.php
   Frontend fetcheli az /_demo/clients/api.php-ból és mutatja
   ============================================================ */

.sw-root {
    --sw-pink:    #E11762;
    --sw-pink-2:  #EC5323;
    --sw-grad-69: linear-gradient(69deg, #e70e6c 0%, #f1651f 100%);
    --sw-grad-215: linear-gradient(215deg, #E11762 0%, #EC5323 100%);
    --sw-content-max: 1500px;     /* .support-wrapper max-width */
    /* Számolt jobb-offset: a gomb FELE (48px = 96px/2) túlnyúljon a tartalom jobb szélén.
       Keskeny viewport-on (≤1596) a max() fallback 20px-re tartja (különben kilógna a viewporból). */
    --sw-right: max(20px, calc((100vw - var(--sw-content-max)) / 2 - 48px));
    font-family: 'Source Sans Pro', system-ui, sans-serif;
}

/* Trigger — közös mind a 3 variansnak */
.sw-trigger {
    position: fixed;
    right: var(--sw-right); bottom: 24px;
    width: 96px; height: 96px;
    border-radius: 50%;
    border-bottom-right-radius: 0;
    background: var(--sw-grad-215);
    border: 4px solid #fff;
    color: #fff;
    font-weight: 700; font-size: 13px; line-height: 1.2;
    text-align: center;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(225, 23, 98, 0.35), 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 200ms ease, box-shadow 200ms ease;
    z-index: 100;
    font-family: inherit;
}
.sw-trigger:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 32px rgba(225, 23, 98, 0.45);
}

/* Közös field stylings (mind a 3 variansra) */
.sw-field { position: relative; }
.sw-field input {
    width: 100%; font-size: 14px; font-family: inherit;
    border: 1.5px solid #e5e7eb; border-radius: 10px;
    background: #fafafa; outline: none;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.sw-field input:focus { border-color: var(--sw-pink); background: #fff; }
.sw-field label {
    position: absolute; color: #9ca3af;
    pointer-events: none;
    transition: all 150ms ease;
}
.sw-field .sw-ic {
    position: absolute; color: #9ca3af;
    transition: color 150ms ease;
}
.sw-field input:focus ~ .sw-ic { color: var(--sw-pink); }

.sw-submit {
    width: 100%;
    border: none;
    background: var(--sw-grad-69);
    color: #fff; font-weight: 700; font-family: inherit;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.sw-submit:hover { transform: translateY(-1px); }

/* ============================================================
   A) CHAT WIDGET — bottom-right slide-up panel
   ============================================================ */
.sw-A {
    position: fixed;
    right: var(--sw-right); bottom: 140px;
    width: 340px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0,0,0,0.08);
    overflow: hidden;
    display: none;
    transform: translateY(20px); opacity: 0;
    transition: transform 280ms cubic-bezier(.2,.9,.3,1.2), opacity 220ms ease;
    z-index: 101;
}
.sw-A.is-open { display: block; }
.sw-A.is-shown { transform: translateY(0); opacity: 1; }
.sw-A .sw-head {
    background: var(--sw-grad-69);
    color: #fff;
    padding: 18px 20px;
    display: flex; align-items: center; gap: 12px;
}
.sw-A .sw-head .sw-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.sw-A .sw-head .sw-text { flex: 1; }
.sw-A .sw-head .sw-text strong { display: block; font-size: 15px; }
.sw-A .sw-head .sw-text small  { display: block; font-size: 12px; opacity: 0.85; }
.sw-A .sw-close {
    background: none; border: none; color: #fff;
    font-size: 22px; cursor: pointer; padding: 0 4px; opacity: 0.8;
}
.sw-A .sw-close:hover { opacity: 1; }
.sw-A .sw-body { padding: 20px; }
.sw-A .sw-field { margin-bottom: 14px; }
.sw-A .sw-field input { height: 48px; padding: 18px 14px 6px 40px; }
.sw-A .sw-field label { left: 40px; top: 14px; font-size: 13px; }
.sw-A .sw-field input:focus + label,
.sw-A .sw-field input:not(:placeholder-shown) + label {
    top: 5px; font-size: 10px; color: var(--sw-pink); font-weight: 700; letter-spacing: 0.3px;
}
.sw-A .sw-field .sw-ic { left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.sw-A .sw-submit { height: 48px; border-radius: 10px; font-size: 14px; box-shadow: 0 4px 14px rgba(225, 23, 98, 0.35); }
.sw-A .sw-submit:hover { box-shadow: 0 6px 20px rgba(225, 23, 98, 0.45); }

/* ============================================================
   B) GLASS MORPHISM MODAL — center, dark backdrop
   ============================================================ */
.sw-B {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 200ms ease;
}
.sw-B.is-open { display: flex; }
.sw-B.is-shown { opacity: 1; }
.sw-B .sw-card {
    width: 100%; max-width: 400px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 32px 28px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    transform: scale(0.92);
    transition: transform 260ms cubic-bezier(.2,.9,.3,1.2);
}
.sw-B.is-shown .sw-card { transform: scale(1); }
.sw-B .sw-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: rgba(0,0,0,0.08); border: none; border-radius: 50%;
    color: #6b7280; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 150ms ease;
}
.sw-B .sw-close:hover { background: rgba(0,0,0,0.15); color: #1f2937; }
.sw-B .sw-icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    background: var(--sw-grad-69);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 26px;
    box-shadow: 0 8px 24px rgba(225, 23, 98, 0.35);
}
.sw-B .sw-title { text-align: center; margin: 0 0 6px; font-size: 20px; font-weight: 700; color: #1f2937; letter-spacing: 0.5px; }
.sw-B .sw-sub   { text-align: center; margin: 0 0 24px; font-size: 13px; color: #6b7280; }
.sw-B .sw-field { margin-bottom: 14px; }
.sw-B .sw-field input { height: 52px; padding: 18px 14px 6px 44px; border-radius: 12px; background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.08); }
.sw-B .sw-field input:focus { box-shadow: 0 0 0 4px rgba(225, 23, 98, 0.12); }
.sw-B .sw-field label { left: 44px; top: 16px; font-size: 13px; }
.sw-B .sw-field input:focus + label,
.sw-B .sw-field input:not(:placeholder-shown) + label {
    top: 6px; font-size: 10px; color: var(--sw-pink); font-weight: 700; letter-spacing: 0.3px;
}
.sw-B .sw-field .sw-ic { left: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; }
.sw-B .sw-submit { height: 52px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 18px rgba(225, 23, 98, 0.4); margin-top: 8px; }

/* ============================================================
   C) MINIMAL POPOVER — small, no backdrop, above the trigger
   ============================================================ */
.sw-C {
    position: fixed;
    right: var(--sw-right); bottom: 140px;
    width: 300px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.05);
    overflow: visible;
    display: none;
    transform: translateY(8px) scale(0.96); opacity: 0;
    transition: transform 220ms cubic-bezier(.2,.9,.3,1.2), opacity 180ms ease;
    z-index: 101;
}
.sw-C.is-open { display: block; }
.sw-C.is-shown { transform: translateY(0) scale(1); opacity: 1; }
.sw-C::after {
    content: ''; position: absolute;
    bottom: -8px; right: 36px;
    width: 16px; height: 16px;
    background: #1f2937;
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.06);
}
.sw-C .sw-head {
    background: #1f2937; color: #fff;
    padding: 12px 18px;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 14px 14px 0 0;
    font-size: 13px; font-weight: 600;
}
.sw-C .sw-close {
    background: none; border: none; color: #fff; opacity: 0.7;
    font-size: 18px; cursor: pointer; padding: 0 2px;
}
.sw-C .sw-close:hover { opacity: 1; }
.sw-C .sw-body { padding: 16px 18px 18px; }
.sw-C .sw-field { margin-bottom: 12px; }
.sw-C .sw-field label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
    position: static;
}
.sw-C .sw-field input { height: 38px; padding: 6px 12px; font-size: 14px; border: 1.5px solid #e5e7eb; border-radius: 8px; background: #fff; }
.sw-C .sw-field input:focus { box-shadow: 0 0 0 3px rgba(225, 23, 98, 0.12); }
.sw-C .sw-submit {
    width: 100%; height: 40px;
    border: 1.5px solid var(--sw-pink);
    background: #fff; color: var(--sw-pink);
    border-radius: 8px;
    font-weight: 700; font-size: 13px;
    margin-top: 4px;
}
.sw-C .sw-submit:hover { background: var(--sw-grad-69); color: #fff; border-color: transparent; }
