/* Masurian Gold WhatsApp Widget v2 – Frontend */

#mg-wa-widget {
    position: fixed;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
#mg-wa-widget.mg-wa-left  { align-items: flex-start; }
#mg-wa-widget.mg-wa-right { align-items: flex-end; }
#mg-wa-widget.mg-wa-visible { opacity: 1; transform: translateY(0); pointer-events: all; }

@media (max-width: 768px) {
    #mg-wa-widget.mg-wa-hide-mobile { display: none !important; }
}

/* ── FAB Button ─────────────────────────────────────────────── */
.mg-wa-fab {
    width: 60px; height: 60px; border-radius: 50%;
    background: #25D366; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(37,211,102,0.45);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    position: relative; flex-shrink: 0; color: white;
}
.mg-wa-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(37,211,102,0.55); }
.mg-wa-fab.mg-wa-fab-active { background: #1C3B2A; box-shadow: 0 4px 20px rgba(28,59,42,0.4); }

.mg-wa-fab-icon { transition: opacity 0.2s, transform 0.2s; position: absolute; display: flex; align-items: center; justify-content: center; }
.mg-wa-icon-open  { opacity: 1; transform: scale(1) rotate(0deg); }
.mg-wa-icon-close { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.mg-wa-fab-active .mg-wa-icon-open  { opacity: 0; transform: scale(0.5) rotate(90deg); }
.mg-wa-fab-active .mg-wa-icon-close { opacity: 1; transform: scale(1) rotate(0deg); }

.mg-wa-pulse {
    position: absolute; inset: -4px; border-radius: 50%;
    border: 3px solid rgba(37,211,102,0.5);
    animation: mg-wa-pulse 2s ease-out infinite; pointer-events: none;
}
@keyframes mg-wa-pulse {
    0%   { transform: scale(1);    opacity: 1; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}
.mg-wa-fab-active .mg-wa-pulse { display: none; }

/* ── Popup ──────────────────────────────────────────────────── */
.mg-wa-popup {
    background: #fff; border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    width: 310px; overflow: hidden;
    transform: scale(0.85) translateY(12px);
    transform-origin: bottom right;
    opacity: 0; pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
}
.mg-wa-left .mg-wa-popup { transform-origin: bottom left; }
.mg-wa-popup.mg-wa-popup-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

/* Header */
.mg-wa-popup-header {
    background: #1C3B2A; padding: 14px 16px;
    display: flex; align-items: center; gap: 12px; position: relative;
}
.mg-wa-avatar { position: relative; flex-shrink: 0; }
.mg-wa-online {
    position: absolute; bottom: 0; right: 0;
    width: 10px; height: 10px; background: #25D366;
    border-radius: 50%; border: 2px solid #1C3B2A;
}
.mg-wa-popup-info strong { display: block; color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.mg-wa-popup-info span   { color: rgba(255,255,255,0.65); font-size: 11px; }
.mg-wa-close {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; color: rgba(255,255,255,0.65);
    cursor: pointer; padding: 4px; line-height: 1;
    display: flex; align-items: center; transition: color 0.2s;
}
.mg-wa-close:hover { color: #fff; }

/* Chat Body */
.mg-wa-popup-body { background: #ECE5DD; padding: 14px; }
.mg-wa-bubble {
    background: #fff; border-radius: 0 10px 10px 10px;
    padding: 10px 14px 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative; max-width: 90%;
}
.mg-wa-bubble::before {
    content: ''; position: absolute; top: 0; left: -8px;
    border: 8px solid transparent;
    border-right-color: #fff; border-top-color: #fff; border-radius: 2px 0 0 0;
}
.mg-wa-bubble p { font-size: 13.5px; color: #111; line-height: 1.5; margin: 0 0 4px; }
.mg-wa-time { font-size: 10px; color: #999; float: right; margin-left: 12px; }

/* Eingabefeld */
.mg-wa-input-row {
    padding: 12px 14px;
    background: #f0f0f0;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    border-top: 1px solid #ddd;
}
.mg-wa-input {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-family: -apple-system, sans-serif;
    color: #111;
    resize: none;
    outline: none;
    line-height: 1.4;
    background: #fff;
    transition: border-color 0.2s;
    max-height: 100px;
    overflow-y: auto;
}
.mg-wa-input:focus { border-color: #25D366; }
.mg-wa-input::placeholder { color: #aaa; }

.mg-wa-send-btn {
    background: #25D366; color: #fff;
    border: none; border-radius: 50%;
    width: 40px; height: 40px; min-width: 40px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
    font-size: 0;
}
.mg-wa-send-btn:hover { background: #1ebe5d; transform: scale(1.08); }
.mg-wa-send-btn svg { flex-shrink: 0; }
