/* =============================================================================
   WerkTalent AI Chatbot — WordPress Widget Styles
   Variables are injected via JS (--wt-primary, --wt-z).
   ============================================================================= */

#wt-chatbot-root {
    --wt-primary: #dbe200;
    --wt-primary-dk: #bcc216;
    --wt-primary-glow: rgba(219, 226, 0, 0.22);
    --wt-black: #0d0d0d;
    --wt-black-soft: #1a1a1a;
    --wt-text: #1a1a1a;
    --wt-muted: #6b7280;
    --wt-bg: #f5f5f5;
    --wt-bg-user: #0d0d0d;
    --wt-bg-bot: #ffffff;
    --wt-border: #e5e7eb;
    --wt-radius: 16px;
    --wt-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --wt-z: 9999;
    position: fixed;
    bottom: 70px;
    right: 24px;
    z-index: var(--wt-z);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

/* Position: left */
#wt-chatbot-root.wt-pos-left {
    right: auto;
    left: 24px;
}

#wt-chatbot-root *,
#wt-chatbot-root *::before,
#wt-chatbot-root *::after {
    box-sizing: inherit;
}

/* ── Toggle button ──────────────────────────────────────────────────────────── */

#wt-chat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--wt-primary);
    color: #000;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

#wt-chat-toggle:hover {
    background: var(--wt-primary-dk);
    transform: translateY(-2px);
}

#wt-chat-toggle:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.wt-btn-label {
    letter-spacing: 0.01em;
}

/* ── Chat panel ─────────────────────────────────────────────────────────────── */

#wt-chat-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--wt-bg);
    border-radius: var(--wt-radius);
    box-shadow: var(--wt-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wt-slide-up 0.22s ease;
}

#wt-chatbot-root.wt-pos-left #wt-chat-panel {
    right: auto;
    left: 0;
}

@keyframes wt-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.wt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--wt-black);
    color: #ffffff;
    flex-shrink: 0;
}

.wt-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wt-header-avatar {
    width: 36px;
    height: 36px;
    background: rgba(219, 226, 0, 0.15);
    color: var(--wt-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wt-header-name {
    font-weight: 700;
    font-size: 15px;
}

.wt-header-status {
    font-size: 12px;
    font-weight: 500;
}

.wt-header-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: opacity 0.15s;
    font-family: inherit;
}

.wt-header-close:hover {
    opacity: 1;
}

.wt-header-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
}

/* ── Messages area ──────────────────────────────────────────────────────────── */

.wt-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.wt-messages::-webkit-scrollbar {
    width: 4px;
}

.wt-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wt-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* ── Message rows ───────────────────────────────────────────────────────────── */

.wt-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 100%;
}

.wt-msg-user {
    flex-direction: row-reverse;
}

.wt-msg-avatar {
    width: 28px;
    height: 28px;
    background: var(--wt-black);
    color: var(--wt-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wt-msg-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: calc(100% - 40px);
}

.wt-msg-bubble {
    padding: 10px 13px;
    border-radius: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.55;
    font-weight: 400;
}

.wt-msg-bot .wt-msg-bubble {
    background: var(--wt-bg-bot);
    color: var(--wt-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--wt-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wt-msg-user .wt-msg-bubble {
    background: var(--wt-black);
    color: #fff;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.wt-msg-bubble a {
    color: inherit;
    text-decoration: underline;
}

/* ── Typing indicator ───────────────────────────────────────────────────────── */

.wt-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    flex-shrink: 0;
}

.wt-typing-avatar {
    width: 28px;
    height: 28px;
    background: var(--wt-black);
    border-radius: 50%;
    flex-shrink: 0;
}

.wt-typing-dots {
    background: var(--wt-bg-bot);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.wt-typing-dots span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--wt-primary);
    border-radius: 50%;
    animation: wt-bounce 1.2s infinite;
}

.wt-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.wt-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wt-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

/* ── Input area ─────────────────────────────────────────────────────────────── */

.wt-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--wt-border);
    flex-shrink: 0;
    background: var(--wt-bg);
}

.wt-input {
    flex: 1;
    border: 1px solid var(--wt-border);
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    outline: none;
    color: var(--wt-text);
    background: #fff;
    transition: border-color 0.15s;
    max-height: 120px;
    overflow-y: hidden;
}

.wt-input:focus {
    border-color: var(--wt-black);
    box-shadow: 0 0 0 3px var(--wt-primary-glow);
}

.wt-input::placeholder {
    color: #9ca3af;
}

.wt-send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: var(--wt-black);
    color: var(--wt-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
}

.wt-send-btn:hover {
    background: var(--wt-black-soft);
    box-shadow: 0 4px 12px var(--wt-primary-glow);
}

.wt-send-btn:active {
    transform: scale(0.93);
}

.wt-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wt-send-btn:focus-visible {
    outline: 3px solid var(--wt-primary);
    outline-offset: 2px;
}

/* ── Vacancy cards ──────────────────────────────────────────────────────────── */

.wt-vc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    width: 100%;
}

.wt-vc-card {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--wt-border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wt-vc-num {
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: var(--wt-black);
    color: var(--wt-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
}

#wt-chat-toggle span {
    display: grid;
}

.wt-vc-body {
    flex: 1;
    min-width: 0;
}

.wt-vc-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--wt-text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.wt-vc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
}

.wt-chip {
    background: #f3f4f6;
    color: #374151;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    white-space: nowrap;
}

.wt-vc-summary {
    font-size: 12px;
    color: var(--wt-muted);
    line-height: 1.45;
    margin-bottom: 6px;
}

.wt-vc-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.wt-vc-detail {
    background: transparent;
    border: 1.5px solid var(--wt-border);
    color: var(--wt-text);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.wt-vc-detail:hover {
    background: var(--wt-black);
    border-color: var(--wt-black);
    color: #fff;
}

.wt-vc-apply {
    background: var(--wt-primary);
    color: var(--wt-black) !important;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
}

.wt-vc-apply:hover {
    background: var(--wt-primary-dk);
}

.wt-vc-note {
    font-size: 11px;
    color: var(--wt-muted);
    text-align: center;
    padding: 4px 0;
    margin: 0;
}

/* ── Powered-by footer ──────────────────────────────────────────────────────── */

.wt-input-footer {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    padding: 6px 12px 8px;
    background: var(--wt-bg);
    border-top: 1px solid var(--wt-border);
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.wt-input-footer a {
    color: var(--wt-black);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--wt-primary);
}

.wt-input-footer a:hover {
    color: var(--wt-black-soft);
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    #wt-chatbot-root {
                bottom: 10px;
        right: 19px;
    }

    #wt-chatbot-root.wt-pos-left {
        right: auto;
        left: 12px;
    }

    #wt-chat-panel {
        width: calc(100vw - 24px);
        right: -6px;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }

    #wt-chatbot-root.wt-pos-left #wt-chat-panel {
        right: auto;
        left: -6px;
    }

    .wt-btn-label {
        display: none;
        /* Show icon only on small screens */
    }

    #wt-chat-toggle {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
}