/* ============================================
   Bienen Chatbot – Stylesheet
   ============================================ */

:root {
    --bee-yellow: #FFD700;
    --bee-dark:   #1a1a1a;
    --bee-honey:  #e5a000;
    --bee-light:  #fff9e6;
    --bee-white:  #ffffff;
    --bee-shadow: 0 8px 32px rgba(0,0,0,0.18);
    --bee-radius: 20px;
    --bee-font:   'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Wrapper ── */
#bienen-chatbot-wrapper {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: var(--bee-font);
}
#bienen-chatbot-wrapper.bienen-right { right: 24px; }
#bienen-chatbot-wrapper.bienen-left  { left: 24px; }

/* ── Toggle Button ── */
#bienen-toggle-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #e5a000 100%);
    border: none;
    cursor: pointer;
    box-shadow: var(--bee-shadow), 0 0 0 0 rgba(255,215,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: bienen-pulse 3s ease-in-out infinite;
}
#bienen-toggle-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: var(--bee-shadow), 0 0 0 8px rgba(255,215,0,0.2);
}
#bienen-toggle-btn:focus-visible {
    outline: 3px solid #333;
    outline-offset: 3px;
}

/* ── Bee SVG & Wing Animation ── */
.bee-animation-wrapper { width: 46px; height: 46px; }
.bee-svg { width: 100%; height: 100%; }

.wing-left, .wing-right {
    transform-origin: center;
    animation: wing-flap 0.18s ease-in-out infinite alternate;
}
.wing-right { animation-direction: alternate-reverse; }

@keyframes wing-flap {
    from { transform: rotate(-25deg) scaleY(1); }
    to   { transform: rotate(-25deg) scaleY(0.6) translateY(-2px); }
}
.wing-right {
    animation-name: wing-flap-right;
}
@keyframes wing-flap-right {
    from { transform: rotate(25deg) scaleY(1); }
    to   { transform: rotate(25deg) scaleY(0.6) translateY(-2px); }
}

/* hover: faster flap */
#bienen-toggle-btn:hover .wing-left,
#bienen-toggle-btn:hover .wing-right {
    animation-duration: 0.08s;
}

@keyframes bienen-pulse {
    0%, 100% { box-shadow: var(--bee-shadow), 0 0 0 0 rgba(255,215,0,0.5); }
    50%       { box-shadow: var(--bee-shadow), 0 0 0 10px rgba(255,215,0,0); }
}

/* ── Notification Badge ── */
.bienen-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53e3e;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: badge-bounce 0.5s ease;
}
.bienen-badge.hidden { display: none; }

@keyframes badge-bounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ── Chat Window ── */
#bienen-chat-window {
    position: absolute;
    bottom: 86px;
    width: 360px;
    max-height: 520px;
    background: var(--bee-white);
    border-radius: var(--bee-radius);
    box-shadow: var(--bee-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.85) translateY(20px);
    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;
}
#bienen-chatbot-wrapper.bienen-left #bienen-chat-window {
    transform-origin: bottom left;
    right: auto;
    left: 0;
}
#bienen-chatbot-wrapper.bienen-right #bienen-chat-window {
    right: 0;
}
#bienen-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Mobile */
@media (max-width: 420px) {
    #bienen-chat-window {
        width: calc(100vw - 48px);
        right: 0 !important;
        left: 0 !important;
        margin: 0 auto;
    }
    #bienen-chatbot-wrapper.bienen-right,
    #bienen-chatbot-wrapper.bienen-left {
        right: 16px;
        left: 16px;
    }
}

/* ── Header ── */
#bienen-chat-header {
    background: linear-gradient(135deg, #FFD700 0%, #e5a000 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.bienen-header-bee svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.bienen-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.bienen-header-info strong {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 700;
}
.bienen-header-info span {
    font-size: 11px;
    color: rgba(0,0,0,0.6);
}

#bienen-close-btn {
    background: rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
    color: #1a1a1a;
    font-size: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#bienen-close-btn:hover { background: rgba(0,0,0,0.2); }
#bienen-close-btn:focus-visible { outline: 2px solid #333; }

/* ── Messages ── */
#bienen-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    background: var(--bee-light);
}
#bienen-chat-messages::-webkit-scrollbar { width: 4px; }
#bienen-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}

/* Bubbles */
.bienen-msg {
    max-width: 82%;
    animation: msg-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes msg-in {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bienen-msg.bot  { align-self: flex-start; }
.bienen-msg.user { align-self: flex-end; }

.bienen-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.bienen-msg.bot  .bienen-bubble {
    background: white;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.bienen-msg.user .bienen-bubble {
    background: linear-gradient(135deg, #FFD700, #e5a000);
    color: #1a1a1a;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Disclaimer */
.bienen-disclaimer {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    padding: 0 4px;
    line-height: 1.4;
}

/* Typing indicator */
.bienen-typing .bienen-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
}
.bienen-dot {
    width: 7px;
    height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: dot-bounce 1.2s ease-in-out infinite;
}
.bienen-dot:nth-child(2) { animation-delay: 0.2s; }
.bienen-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
    0%, 80%, 100% { transform: translateY(0); background: #bbb; }
    40%            { transform: translateY(-6px); background: #e5a000; }
}

/* ── Suggestions ── */
.bienen-suggestions {
    display: flex;
    gap: 6px;
    padding: 8px 12px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #f0e68c;
}
.bienen-suggest-btn {
    background: var(--bee-light);
    border: 1px solid #FFD700;
    color: #7a5c00;
    font-size: 11.5px;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--bee-font);
}
.bienen-suggest-btn:hover {
    background: #FFD700;
    color: #1a1a1a;
    transform: translateY(-1px);
}
.bienen-suggestions.hidden { display: none; }

/* ── Input Area ── */
#bienen-chat-input-area {
    background: white;
    border-top: 1px solid #f0e68c;
    flex-shrink: 0;
}
.bienen-input-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
}

#bienen-user-input {
    flex: 1;
    padding: 9px 14px;
    border: 1.5px solid #e0c840;
    border-radius: 24px;
    font-size: 13.5px;
    font-family: var(--bee-font);
    background: var(--bee-light);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1a1a1a;
}
#bienen-user-input:focus {
    border-color: #e5a000;
    box-shadow: 0 0 0 3px rgba(229,160,0,0.15);
}
#bienen-user-input::placeholder { color: #bba840; }

#bienen-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #e5a000);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}
#bienen-send-btn svg { width: 18px; height: 18px; }
#bienen-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(229,160,0,0.4);
}
#bienen-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
#bienen-send-btn:focus-visible { outline: 2px solid #333; }

/* ============================================
   Link Cards (Website-Suche Ergebnisse)
   ============================================ */

.bienen-link-cards {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bienen-link-cards-label {
    font-size: 11px;
    font-weight: 600;
    color: #7a5c00;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 2px;
    margin-bottom: 2px;
}

.bienen-link-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: white;
    border: 1.5px solid #f0e68c;
    border-radius: 12px;
    padding: 9px 11px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
    animation: msg-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.bienen-link-card:hover {
    border-color: #e5a000;
    box-shadow: 0 2px 10px rgba(229,160,0,0.2);
    transform: translateY(-1px);
    text-decoration: none;
}
.bienen-link-card:focus-visible {
    outline: 2px solid #e5a000;
    outline-offset: 2px;
}

.bienen-link-card-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    line-height: 1;
}

.bienen-link-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bienen-link-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bienen-link-card-meta {
    font-size: 10.5px;
    color: #e5a000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bienen-link-card-snippet {
    font-size: 11.5px;
    color: #555;
    line-height: 1.4;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bienen-link-card-snippet mark {
    background: rgba(255, 215, 0, 0.45);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.bienen-link-card-arrow {
    color: #e5a000;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    align-self: center;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    transform: translateX(-4px);
}
.bienen-link-card:hover .bienen-link-card-arrow {
    opacity: 1;
    transform: translateX(0);
}
