/* Chatbot widget — floating asistent v pravém dolním rohu */

.chatbot-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1050;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-root[aria-hidden="true"] .chatbot-panel {
    display: none;
}

/* ── Toggle tlačítko ───────────────────────────────────────────── */
.chatbot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #003f7d 0%, #0064d2 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 63, 125, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 63, 125, 0.45);
}

.chatbot-toggle:focus-visible {
    outline: 3px solid #ffc107;
    outline-offset: 3px;
}

.chatbot-toggle i {
    font-size: 18px;
}

.chatbot-root.is-open .chatbot-toggle {
    display: none;
}

/* ── Panel ─────────────────────────────────────────────────────── */
.chatbot-panel {
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatbot-slide-in 0.25s ease-out;
}

@keyframes chatbot-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ─────────────────────────────────────────────────────── */
.chatbot-header {
    background: linear-gradient(135deg, #003f7d 0%, #0064d2 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-title i {
    font-size: 24px;
    opacity: 0.9;
}

.chatbot-header-title strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.chatbot-header-title small {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ── Zprávy ─────────────────────────────────────────────────────── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f6f8fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chatbot-msg.is-user {
    align-self: flex-end;
    background: #0064d2;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg.is-assistant {
    align-self: flex-start;
    background: #fff;
    color: #222;
    border: 1px solid #e3e8ef;
    border-bottom-left-radius: 4px;
}

.chatbot-msg.is-error {
    align-self: flex-start;
    background: #fff4f4;
    color: #b42318;
    border: 1px solid #f8d7da;
    border-bottom-left-radius: 4px;
}

.chatbot-msg a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.chatbot-msg.is-assistant a {
    color: #0064d2;
}

.chatbot-typing {
    align-self: flex-start;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    gap: 4px;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #8aa2c0;
    border-radius: 50%;
    animation: chatbot-dot 1.4s infinite ease-in-out both;
}

.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatbot-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

/* ── Status řádek ───────────────────────────────────────────────── */
.chatbot-status {
    min-height: 18px;
    padding: 0 16px;
    font-size: 12px;
    color: #6b7a90;
    flex-shrink: 0;
}

.chatbot-status.is-error {
    color: #b42318;
}

/* ── Formulář ───────────────────────────────────────────────────── */
.chatbot-form {
    display: flex;
    gap: 8px;
    padding: 12px 14px 10px;
    border-top: 1px solid #e3e8ef;
    background: #fff;
    flex-shrink: 0;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #d4dbe5;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    outline: none;
    transition: border-color 0.15s ease;
}

.chatbot-input:focus {
    border-color: #0064d2;
    box-shadow: 0 0 0 3px rgba(0, 100, 210, 0.12);
}

.chatbot-input:disabled {
    background: #f6f8fb;
    color: #8aa2c0;
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: #0064d2;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    background: #00509b;
}

.chatbot-send:active:not(:disabled) {
    transform: scale(0.95);
}

.chatbot-send:disabled {
    background: #b4c5dc;
    cursor: not-allowed;
}

/* Honeypot — úplně mimo viewport, ale pro bota vypadá normálně */
#chatbot-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.chatbot-footer {
    padding: 8px 16px 12px;
    font-size: 11px;
    color: #8aa2c0;
    background: #fff;
    text-align: center;
    border-top: 1px solid #f0f3f7;
    flex-shrink: 0;
}

.chatbot-footer a {
    color: #0064d2;
}

/* ── Mobile: full screen modal ──────────────────────────────────── */
@media (max-width: 767px) {
    .chatbot-root {
        right: 16px;
        bottom: 16px;
    }

    .chatbot-root.is-open {
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
    }

    .chatbot-root.is-open .chatbot-panel {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .chatbot-toggle {
        padding: 12px 18px;
        font-size: 14px;
    }

    .chatbot-toggle-label {
        display: none;
    }
}

/* Pod sociální lištou, aby se nepřekrývaly */
@media (min-width: 992px) {
    .chatbot-root {
        right: 80px;
    }
}

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