/* =============================================================
   Vitalibera Chat-Widget
   Design 1:1 aus https://vitalibera.org/chat/ (style.css) übernommen,
   nur in einen schwebenden Panel-Container verpackt.
   Eigener Namespace (vc-...) damit nichts mit dem WP-Theme kollidiert.
============================================================= */

#vc-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* -----------------------------------------------------------
   Schwebender Toggle-Button (Avatar)
----------------------------------------------------------- */

#vc-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: #4A90E2;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

#vc-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

#vc-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#vc-toggle .vc-close-icon {
    display: none;
    color: #fff;
    font-size: 26px;
    line-height: 1;
}

#vc-widget.vc-open #vc-toggle img {
    display: none;
}

#vc-widget.vc-open #vc-toggle .vc-close-icon {
    display: block;
}

#vc-toggle::after {
    content: "";
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #4CD964;
    border: 2px solid #fff;
    border-radius: 50%;
}

#vc-widget.vc-open #vc-toggle::after {
    display: none;
}


/* -----------------------------------------------------------
   Chat-Panel (entspricht #chat-wrapper, nur floating & begrenzt)
----------------------------------------------------------- */

#vc-panel {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #f7f8fa;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#vc-widget.vc-open #vc-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 480px) {
    #vc-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 110px);
        right: -12px;
    }
}


/* -----------------------------------------------------------
   Fixierter Chat-Header mit Avatar (= #chat-header im Original)
----------------------------------------------------------- */

#vc-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffffcc;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

#vc-header img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

#vc-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #357ABD;
    flex: 1;
}

#vc-header-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 20px;
    line-height: 1;
    padding: 4px;
}

#vc-header-close:hover {
    color: #333;
}


/* -----------------------------------------------------------
   Nachrichtenverlauf (= #results im Original)
----------------------------------------------------------- */

#vc-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* -----------------------------------------------------------
   USER-BUBBLE – Soft Glass (identisch zu .user-card)
----------------------------------------------------------- */

.vc-user-card {
    max-width: 75%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px 20px 20px 6px;
    color: #222;
    align-self: flex-start;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    position: relative;
}


/* -----------------------------------------------------------
   BOT-BUBBLE (identisch zu .bot-card)
----------------------------------------------------------- */

.vc-bot-card {
    max-width: 75%;
    padding: 18px 22px;
    background: rgba(74,144,226,0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 20px 20px 6px 20px;
    color: #fff;
    align-self: flex-end;
    font-size: 16px;
    line-height: 1.55;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.vc-bot-card.vc-visible {
    opacity: 1;
    transform: translateY(0);
}

.vc-bot-card a {
    color: #fff;
    text-decoration: underline;
}


/* -----------------------------------------------------------
   Notfall-Hervorhebung (identisch zu .bot-card.emergency)
----------------------------------------------------------- */

.vc-bot-card.vc-emergency {
    border: 2px solid #ff4d4d;
    box-shadow:
        0 0 12px rgba(255, 77, 77, 0.35),
        0 0 22px rgba(255, 77, 77, 0.25),
        inset 0 0 8px rgba(255, 77, 77, 0.25);
    position: relative;
}

.vc-bot-card.vc-emergency::before {
    content: "⚠️ Notfall-Thema";
    position: absolute;
    top: -22px;
    right: 0;
    background: #ff4d4d;
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}


/* -----------------------------------------------------------
   Typing-Bubble (identisch zu .bot-typing)
----------------------------------------------------------- */

.vc-bot-typing {
    max-width: 75%;
    padding: 14px 18px;
    background: rgba(74,144,226,0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 20px 20px 6px 20px;
    color: #fff;
    align-self: flex-end;
    display: flex;
    gap: 6px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.vc-dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    animation: vc-blink 1.4s infinite ease-in-out;
}

.vc-dot:nth-child(2) { animation-delay: 0.2s; }
.vc-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes vc-blink {
    0%, 20% { opacity: 0.2; }
    50%     { opacity: 1; }
    100%    { opacity: 0.2; }
}


/* -----------------------------------------------------------
   Tipp-Bubble (identisch zu .tip-card)
----------------------------------------------------------- */

.vc-tip-card {
    max-width: 75%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 18px;
    color: #333;
    align-self: flex-end;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.vc-tip-card.vc-visible {
    opacity: 1;
    transform: translateY(0);
}

.vc-tip-card::before {
    content: "ℹ️";
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.vc-tip-extra {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vc-tip-extra-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vc-tip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.vc-tip-btn:hover {
    background: rgba(255,255,255,0.95);
}


/* -----------------------------------------------------------
   Buttons (identisch zu .chat-btn)
----------------------------------------------------------- */

.vc-chat-btn {
    display: inline-block;
    margin: 6px 4px 0 0;
    padding: 10px 16px;
    font-size: 15px;
    border-radius: 14px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;
    color: #357ABD;
    font-weight: 600;
    transition: all 0.25s ease;
}

.vc-chat-btn:hover {
    background: #357ABD;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}


/* -----------------------------------------------------------
   Weiterlesen-Link (identisch zu .readmore)
----------------------------------------------------------- */

.vc-readmore {
    margin-top: 12px;
    text-align: right;
}

.vc-readmore a {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.vc-readmore a:hover {
    background: linear-gradient(135deg, #5AA0F2, #3F8BD0);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.vc-readmore a:active {
    transform: translateY(0px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}


/* -----------------------------------------------------------
   Footer / Eingabe (identisch zu #chat-footer)
----------------------------------------------------------- */

#vc-footer {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: #fff;
    flex-shrink: 0;
}

#vc-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 15px;
    min-width: 0;
}

#vc-input:focus {
    outline: none;
    border-color: #4A90E2;
}

#vc-send {
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: #4A90E2;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

#vc-send:disabled {
    opacity: 0.6;
    cursor: default;
}
