/* ═══════════════════════════════════════════════════════════════
   WerkTalent AI Chatbot — Design V4
   Brand: WerkTalent.com — Black #0d0d0d + Lime #DBE200
   Source confirmed from logo.svg
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset & Variables ─────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* WerkTalent Brand — confirmed from werktalent.com logo.svg */
    --wt-lime:          #DBE200;
    --wt-lime-dark:     #b8c000;
    --wt-lime-soft:     rgba(219, 226, 0, 0.10);
    --wt-lime-glow:     rgba(219, 226, 0, 0.22);
    --wt-lime-border:   rgba(219, 226, 0, 0.35);

    --wt-black:         #0d0d0d;
    --wt-black-mid:     #1a1a1a;
    --wt-black-soft:    #2d2d2d;

    /* Neutrals */
    --wt-white:         #ffffff;
    --wt-bg:            #f5f5f5;
    --wt-bg-alt:        #eeeeee;
    --wt-card:          #ffffff;
    --wt-text:          #1a1a1a;
    --wt-text-muted:    #6b7280;
    --wt-text-light:    #9ca3af;
    --wt-border:        #e0e0e0;
    --wt-border-mid:    #d0d0d0;

    /* Shadows */
    --shadow-xs:   0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.10);
    --shadow-md:   0 4px 20px rgba(0,0,0,0.14);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.18);
    --shadow-lime: 0 4px 16px rgba(219,226,0,0.30);

    /* Radii */
    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   18px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* Header height */
    --header-h: 64px;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--wt-bg);
    color: var(--wt-text);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Header ────────────────────────────────────────────────── */
.header {
    background: var(--wt-black);
    border-bottom: none;
    padding: 0 32px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 28px;
    width: auto;
}

/* Fallback text logo when SVG is missing */
.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--wt-white);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--wt-lime);
}

/* Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.70);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--wt-lime);
    background: var(--wt-lime-soft);
}

.nav-link.active {
    color: var(--wt-lime);
    background: var(--wt-lime-soft);
    font-weight: 600;
}

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--wt-lime-soft);
    border: 1px solid var(--wt-lime-border);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--wt-lime);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wt-lime);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(219,226,0,0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(219,226,0,0); }
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: rgba(255,255,255,0.65);
}

.btn-icon:hover {
    border-color: var(--wt-lime);
    color: var(--wt-lime);
    background: var(--wt-lime-soft);
}

/* ─── Main Layout ───────────────────────────────────────────── */
.main-container {
    display: flex;
    height: calc(100vh - var(--header-h));
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.chat-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0;
}

.chat-panel {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    background: var(--wt-white);
    border-left: 1px solid var(--wt-border);
    border-right: 1px solid var(--wt-border);
}

/* ─── Chat Messages Area ────────────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    scroll-behavior: smooth;
    background: var(--wt-bg);
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--wt-border);
    border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--wt-border-mid);
}

/* ─── Message Layout ────────────────────────────────────────── */
.message {
    display: flex;
    gap: 12px;
    max-width: 82%;
    animation: msg-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.bot {
    align-self: flex-start;
}

/* ─── Avatars ───────────────────────────────────────────────── */
.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 700;
}

.bot-avatar {
    background: var(--wt-black);
    color: var(--wt-lime);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.message.user .message-avatar {
    background: var(--wt-black-soft);
    color: var(--wt-lime);
}

/* ─── Message Bubbles ───────────────────────────────────────── */
.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.message-bubble {
    padding: 14px 18px;
    line-height: 1.65;
    font-size: 14.5px;
    word-break: break-word;
}

/* Bot messages — white card */
.message.bot .message-bubble {
    background: var(--wt-white);
    color: var(--wt-text);
    border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--wt-border);
}

/* User messages — black */
.message.user .message-bubble {
    background: var(--wt-black);
    color: var(--wt-white);
    border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.message-bubble p {
    margin-bottom: 8px;
}
.message-bubble p:last-child {
    margin-bottom: 0;
}

/* Welcome title */
.welcome-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--wt-text) !important;
    margin-bottom: 4px !important;
}

/* Bold in bot messages — dark, not lime (bad contrast on white) */
.message.bot .message-bubble strong {
    color: var(--wt-black);
    font-weight: 700;
}

/* Links in bot messages */
.message.bot .message-bubble a {
    color: var(--wt-black);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid var(--wt-lime);
    transition: all 0.2s;
    padding-bottom: 1px;
}
.message.bot .message-bubble a:hover {
    color: var(--wt-black-soft);
    border-bottom-color: var(--wt-lime-dark);
    background: var(--wt-lime-soft);
    border-radius: 2px;
    padding: 0 2px 1px;
}

/* Message timestamp */
.message-time {
    font-size: 11px;
    color: var(--wt-text-light);
    padding: 0 4px;
}
.message.user .message-time {
    text-align: right;
}

/* ─── Quick Action Buttons ──────────────────────────────────── */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1.5px solid var(--wt-border);
    background: var(--wt-white);
    color: var(--wt-text);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    text-align: left;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.quick-action-btn:hover {
    border-color: var(--wt-black);
    background: var(--wt-black);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn:hover .qa-text strong {
    color: var(--wt-lime);
}

.quick-action-btn:hover .qa-text small {
    color: rgba(255,255,255,0.65);
}

.qa-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wt-bg);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.quick-action-btn:hover .qa-icon {
    background: var(--wt-lime-soft);
}

.qa-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qa-text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--wt-text);
    transition: color 0.2s;
}

.qa-text small {
    font-size: 12px;
    color: var(--wt-text-muted);
    font-weight: 400;
    transition: color 0.2s;
}

.qa-arrow {
    margin-left: auto;
    color: var(--wt-text-light);
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.quick-action-btn:hover .qa-arrow {
    color: var(--wt-lime);
    transform: translateX(3px);
}

/* ─── Typing Indicator ──────────────────────────────────────── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px 16px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    background: var(--wt-white);
    border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--wt-border);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--wt-lime);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30%           { transform: translateY(-8px); opacity: 1; }
}

/* ─── Chat Input Area ───────────────────────────────────────── */
.chat-input-area {
    padding: 16px 28px 18px;
    background: var(--wt-white);
    border-top: 1px solid var(--wt-border);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--wt-bg);
    border: 1.5px solid var(--wt-border);
    border-radius: var(--radius-full);
    padding: 5px 5px 5px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--wt-black);
    box-shadow: 0 0 0 3px var(--wt-lime-glow);
    background: var(--wt-white);
}

#chat-input {
    flex: 1;
    padding: 9px 0;
    background: transparent;
    border: none;
    color: var(--wt-text);
    font-size: 14.5px;
    font-family: var(--font);
    outline: none;
}

#chat-input::placeholder {
    color: var(--wt-text-light);
}

.btn-send {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--wt-black);
    color: var(--wt-lime);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.btn-send:hover {
    background: var(--wt-black-soft);
    transform: scale(1.06);
    box-shadow: var(--shadow-lime);
}

.btn-send:active {
    transform: scale(0.94);
}

.input-footer {
    text-align: center;
    font-size: 11.5px;
    color: var(--wt-text-light);
    margin-top: 10px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.input-footer a {
    color: var(--wt-black-mid);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--wt-lime);
}

.input-footer a:hover {
    color: var(--wt-black);
}

/* ─── Debug Panel ───────────────────────────────────────────── */
.debug-panel {
    width: 340px;
    background: var(--wt-white);
    border-left: 1px solid var(--wt-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--wt-black);
    border-bottom: 2px solid var(--wt-lime);
}

.debug-header h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--wt-lime);
}

.debug-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: var(--wt-bg);
}

.debug-section {
    margin-bottom: 16px;
}

.debug-section h4 {
    font-size: 10px;
    font-weight: 700;
    color: var(--wt-black);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.debug-section pre {
    background: var(--wt-white);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--wt-text-muted);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
    border: 1px solid var(--wt-border);
}

/* ─── Vacancy Cards (rendered by frontend from structured data) ─ */

/* List container — sits inside .message-content, below the bubble */
.vc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

/* Individual card */
.vc-card {
    display: flex;
    gap: 12px;
    background: var(--wt-white);
    border: 1.5px solid var(--wt-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    animation: msg-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.vc-card:hover {
    border-color: var(--wt-black);
    box-shadow: var(--shadow-sm);
}

/* Number badge */
.vc-num {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: var(--wt-black);
    color: var(--wt-lime);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* Card body */
.vc-body {
    flex: 1;
    min-width: 0;
}

.vc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--wt-text);
    margin-bottom: 6px;
    line-height: 1.35;
}

/* Meta chips row */
.vc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.vc-chip {
    font-size: 11.5px;
    color: var(--wt-text-muted);
    background: var(--wt-bg);
    border: 1px solid var(--wt-border);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    white-space: nowrap;
}

/* Summary snippet */
.vc-summary {
    font-size: 12.5px;
    color: var(--wt-text-muted);
    line-height: 1.55;
    margin-bottom: 10px;
}

/* Action buttons */
.vc-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.vc-btn-detail {
    padding: 6px 14px;
    background: var(--wt-bg);
    border: 1.5px solid var(--wt-border-mid);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--wt-text);
    cursor: pointer;
    transition: all 0.18s;
}

.vc-btn-detail:hover {
    background: var(--wt-black);
    border-color: var(--wt-black);
    color: var(--wt-white);
}

.vc-btn-apply {
    padding: 6px 16px;
    background: var(--wt-lime);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: var(--wt-black);
    text-decoration: none;
    transition: background 0.18s;
    white-space: nowrap;
}

.vc-btn-apply:hover {
    background: var(--wt-lime-dark);
}

/* Footer note when results were trimmed */
.vc-footer-note {
    font-size: 12px;
    color: var(--wt-text-light);
    padding: 8px 4px 0;
    font-style: italic;
}

/* ─── Scrollbar global ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--wt-border); border-radius: 3px; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .header-nav { display: none; }
    .debug-panel { display: none !important; }
}

@media (max-width: 768px) {
    .header { padding: 0 16px; height: 56px; }
    .main-container { height: calc(100vh - 56px); }
    .chat-panel { max-width: 100%; border: none; }
    .chat-messages { padding: 20px 16px; }
    .chat-input-area { padding: 12px 16px 14px; }
    .message { max-width: 90%; }
}

@media (max-width: 480px) {
    .status-badge { display: none; }
    .chat-messages { padding: 16px 12px; gap: 16px; }
    .message-bubble { padding: 12px 14px; font-size: 14px; }
    .input-wrapper { padding: 4px 4px 4px 16px; }
}
