/* Who We Are — Chatbot Styles */

.mkn-chatbot {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 90vh;
    height: 90dvh;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-text-size-adjust: 100%;
}

/* ===========================
   Welcome / Gradient Screen
   =========================== */

.mkn-chatbot-welcome {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    overflow: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.mkn-chatbot-welcome.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated gradient blobs */
.mkn-chatbot-welcome::before,
.mkn-chatbot-welcome::after,
.mkn-chatbot-blob-3 {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.85;
    will-change: transform;
}

.mkn-chatbot-welcome::before {
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(23, 111, 193, 0.9), transparent 70%); /* #176FC1 Blau */
    bottom: -10%;
    left: -10%;
    animation: mkn-blob-drift-1 25s ease-in-out infinite;
}

.mkn-chatbot-welcome::after {
    width: 55vw;
    height: 55vw;
    max-width: 550px;
    max-height: 550px;
    background: radial-gradient(circle, rgba(239, 45, 56, 0.85), transparent 70%); /* #EF2D38 Rot */
    bottom: -5%;
    left: 30%;
    animation: mkn-blob-drift-2 30s ease-in-out infinite;
}

.mkn-chatbot-blob-3 {
    width: 50vw;
    height: 50vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(89, 194, 90, 0.85), transparent 70%); /* #59C25A Grün */
    bottom: -8%;
    right: -5%;
    animation: mkn-blob-drift-3 28s ease-in-out infinite;
}

.mkn-chatbot-blob-4 {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.75;
    will-change: transform;
    width: 45vw;
    height: 45vw;
    max-width: 450px;
    max-height: 450px;
    background: radial-gradient(circle, rgba(252, 210, 5, 0.85), transparent 70%); /* #FCD205 Gelb */
    bottom: 5%;
    left: 15%;
    animation: mkn-blob-drift-1 22s ease-in-out infinite reverse;
}

/* White fade overlay on top half */
.mkn-chatbot-welcome-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #fff 0%, rgba(255, 255, 255, 0.7) 35%, rgba(255, 255, 255, 0) 65%);
    pointer-events: none;
}

/* Logo + title */
.mkn-chatbot-welcome-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 0 24px;
}

.mkn-chatbot-welcome-logo {
    width: 140px;
    height: auto;
    opacity: 0.9;
}

.mkn-chatbot-welcome-title {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

/* Blob animations — gentle, slow drifts */
@keyframes mkn-blob-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-20px, -15px) scale(0.97); }
}

@keyframes mkn-blob-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-30px, -25px) scale(1.03); }
    50% { transform: translate(20px, -40px) scale(0.98); }
    75% { transform: translate(-10px, -15px) scale(1.06); }
}

@keyframes mkn-blob-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-35px, -20px) scale(1.04); }
    70% { transform: translate(15px, -35px) scale(0.96); }
}

/* ===========================
   Messages area
   =========================== */

.mkn-chatbot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Message wrapper */
.mkn-chatbot-msg {
    display: flex;
    flex-direction: column;
    max-width: 72%;
    animation: mkn-chatbot-fade-in 0.3s ease;
}

.mkn-chatbot-msg-user {
    align-self: flex-end;
}

.mkn-chatbot-msg-assistant {
    align-self: flex-start;
}

/* Bubbles */
.mkn-chatbot-bubble {
    padding: 14px 20px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mkn-chatbot-msg-user .mkn-chatbot-bubble {
    background: #1a1a2e;
    color: #fff;
    border-bottom-right-radius: 6px;
}

.mkn-chatbot-msg-assistant .mkn-chatbot-bubble {
    background: #f4f4f8;
    color: #2a2a3e;
    border-bottom-left-radius: 6px;
}

/* ===========================
   Referenced Post Tiles
   =========================== */

.mkn-chatbot-tiles {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-top: 4px;
    padding-bottom: 4px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.mkn-chatbot-tiles::-webkit-scrollbar {
    display: none;
}

.mkn-chatbot-tile {
    flex: 0 0 auto;
    width: 380px;
    height: 100px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 18px;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.15s, box-shadow 0.15s;
}

.mkn-chatbot-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.mkn-chatbot-tile-img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.35);
}

.mkn-chatbot-tile-title {
    flex: 1 1 auto;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Thinking indicator — neural network animation */
.mkn-chatbot-thinking .mkn-chatbot-bubble {
    background: transparent;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 0;
}

.mkn-chatbot-thinking .mkn-chatbot-bubble .mkn-neural-loader {
    width: 36px;
    height: 38px;
    display: block;
}

/* Neural signal lines animate with staggered dash offsets */
.mkn-neural-loader .mkn-neural-line {
    stroke-dasharray: 12 200;
    stroke-dashoffset: 0;
    animation: mkn-neural-pulse 2.4s ease-in-out infinite;
}

.mkn-neural-loader .mkn-neural-line:nth-child(1) { animation-delay: 0s; }
.mkn-neural-loader .mkn-neural-line:nth-child(2) { animation-delay: 0.3s; }
.mkn-neural-loader .mkn-neural-line:nth-child(3) { animation-delay: 0.6s; }
.mkn-neural-loader .mkn-neural-line:nth-child(4) { animation-delay: 0.15s; }
.mkn-neural-loader .mkn-neural-line:nth-child(5) { animation-delay: 0.45s; }
.mkn-neural-loader .mkn-neural-line:nth-child(6) { animation-delay: 0.75s; }
.mkn-neural-loader .mkn-neural-line:nth-child(7) { animation-delay: 0.9s; }
.mkn-neural-loader .mkn-neural-line:nth-child(8) { animation-delay: 0.2s; }

@keyframes mkn-neural-pulse {
    0% {
        stroke-dasharray: 0 300;
        stroke-dashoffset: 0;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    40% {
        stroke-dasharray: 60 300;
        stroke-dashoffset: -30;
    }
    70% {
        stroke-dasharray: 60 300;
        stroke-dashoffset: -120;
        opacity: 1;
    }
    100% {
        stroke-dasharray: 0 300;
        stroke-dashoffset: -200;
        opacity: 0;
    }
}

/* Prevent page scroll when chatbot is on screen */
body:has(.mkn-chatbot) {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Hide .onetap-toggle on chatbot page */
.mkn-chatbot ~ .onetap-toggle,
body:has(.mkn-chatbot) .onetap-toggle {
    display: none !important;
}

/* Error */
.mkn-chatbot-error .mkn-chatbot-bubble {
    background: #fef2f2;
    color: #b91c1c;
}

/* Links in messages */
.mkn-chatbot-bubble a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mkn-chatbot-bubble a:hover {
    opacity: 0.7;
}

/* ===========================
   Input area
   =========================== */

.mkn-chatbot-input {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 24px 8px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    position: relative;
    z-index: 20;
}

.mkn-chatbot-input textarea {
    flex: 1 1 auto;
    resize: none;
    border: 1.5px solid #e0e0e5;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.45;
    max-height: 120px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.mkn-chatbot-input textarea:focus {
    border-color: #a0a0d0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(160, 160, 208, 0.15);
}

.mkn-chatbot-input textarea:disabled {
    opacity: 0.5;
}

.mkn-chatbot-input button[type="submit"] {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    aspect-ratio: 1 !important;
    border: none !important;
    background: #1a1a2e !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s, transform 0.15s, opacity 0.2s !important;
    overflow: visible !important;
    padding: 0 !important;
}

#mkn-chatbot-send {
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mkn-chatbot-send-icon {
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #fff !important;
    display: block !important;
}
.mkn-chatbot-input button[type="submit"]:hover {
    background: #2e2e50;
    transform: scale(1.05);
}

.mkn-chatbot-input button[type="submit"]:active {
    transform: scale(0.96);
}

.mkn-chatbot-input button[type="submit"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.mkn-chatbot-input button[type="submit"]:focus-visible {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

.mkn-chatbot-tile:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
    box-shadow: 0 0 0 4px rgba(74, 108, 247, 0.6);
}


/* ===========================
   Footer notice
   =========================== */

.mkn-chatbot-footer {
    text-align: center;
    padding: 6px 24px 16px;
    font-size: 0.72rem;
    color: #767676;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 20;
    background: #fff;
}

.mkn-chatbot-footer a {
    color: #767676;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mkn-chatbot-footer a:hover {
    color: #555;
}

/* ===========================
   Utilities
   =========================== */

.mkn-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes mkn-chatbot-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Reduced motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
    .mkn-chatbot-welcome::before,
    .mkn-chatbot-welcome::after,
    .mkn-chatbot-blob-3,
    .mkn-chatbot-blob-4 {
        animation: none;
    }

    .mkn-neural-loader .mkn-neural-line {
        animation: none;
        stroke-dasharray: 60 300;
        opacity: 0.6;
    }

    .mkn-chatbot-msg {
        animation: none;
    }

    .mkn-chatbot-welcome.is-hidden {
        transition: none;
    }

    .mkn-chatbot-tile {
        transition: none;
    }

    .mkn-chatbot-input textarea,
    .mkn-chatbot-input button[type="submit"] {
        transition: none !important;
    }
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 600px) {
    .mkn-chatbot {
        height: 100vh;
        height: 100dvh;
    }

    .mkn-chatbot-messages {
        padding: 20px 16px;
    }

    .mkn-chatbot-msg {
        max-width: 90%;
    }

    /* Prevent iOS zoom on focus — font-size must be >= 16px */
    .mkn-chatbot-input textarea {
        font-size: 16px;
    }

    .mkn-chatbot-input {
        padding: 12px 16px 6px;
    }

    .mkn-chatbot-footer {
        padding: 4px 16px 14px;
    }

    .mkn-chatbot-welcome-logo {
        width: 100px;
    }

    .mkn-chatbot-tile {
        width: 300px;
        padding: 12px 16px;
    }

    .mkn-chatbot-tile-img {
        flex: 0 0 58px;
        width: 58px;
        height: 58px;
    }

    /* Gradient blobs — spread across all corners on mobile */
    .mkn-chatbot-welcome::before,
    .mkn-chatbot-welcome::after,
    .mkn-chatbot-blob-3,
    .mkn-chatbot-blob-4 {
        width: 55vw;
        height: 55vw;
        max-width: 240px;
        max-height: 240px;
        filter: blur(40px);
    }

    /* Blau — unten links */
    .mkn-chatbot-welcome::before {
        bottom: -10%;
        left: -15%;
        top: auto;
        right: auto;
    }

    /* Rot — oben rechts */
    .mkn-chatbot-welcome::after {
        bottom: auto;
        left: auto;
        top: -10%;
        right: -10%;
    }

    /* Grün — unten rechts */
    .mkn-chatbot-blob-3 {
        bottom: -5%;
        right: -10%;
        top: auto;
        left: auto;
    }

    /* Gelb — oben links */
    .mkn-chatbot-blob-4 {
        bottom: auto;
        right: auto;
        top: -5%;
        left: -10%;
    }

    .mkn-chatbot-welcome-content {
        gap: 16px;
        padding: 0 16px;
    }
}
