/* AI Career Assistant */

.chatbot-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    font: 14px/1.5 Arial, Helvetica, sans-serif;
    color: #111827;
}

.chatbot-container button,
.chatbot-container input {
    font: inherit;
}

.chatbot-container button {
    cursor: pointer;
}

.chatbot-container :focus-visible {
    outline: 3px solid #b77900;
    outline-offset: 3px;
}

/* Floating chatbot button */

.chatbot-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #fbbf24;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    padding: 12px 20px;
    font-weight: 700 !important;
    box-shadow: 0 6px 24px #11182733;
}

.chatbot-toggle svg {
    color: #fbbf24;
    width: 24px;
    height: 24px;
}

/* Main chatbot window */

.chatbot-box {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: min(390px, calc(100vw - 32px));
    height: min(610px, calc(100vh - 100px));
    height: min(610px, calc(100dvh - 100px));
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 48px #11182738;
}

.chatbot-container .hidden,
.chatbot-container [hidden] {
    display: none !important;
}

/* Chatbot header */

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(
        135deg,
        #111827,
        #1e3a5f
    );
    color: #ffffff;
}

.chatbot-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    background: #fbbf24;
    color: #111827;
    border-radius: 50%;
}

.chatbot-avatar svg {
    width: 26px;
    height: 26px;
}

.chatbot-header h3 {
    font-size: 15px;
    margin: 0;
    color: #ffffff;
    line-height: 1.3;
}

.chatbot-header p {
    font-size: 11px;
    color: #e5e7eb;
    margin-top: 4px;
}

.chatbot-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 26px !important;
    min-width: 36px;
    min-height: 36px;
}

/* Conversation messages */

.chatbot-messages {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    padding: 16px;
    overscroll-behavior: contain;
}

.bot-message,
.user-message {
    padding: 12px 14px;
    max-width: 94%;
    border-radius: 14px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.55;
}

.bot-message {
    background: #eaf1f8;
    color: #111827;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background: #1e3a5f;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Suggested recruiter questions */

.chatbot-suggestions {
    display: grid;
    gap: 7px;
    width: 100%;
    align-self: flex-start;
}

.chatbot-suggestions p {
    font-size: 12px;
    color: #4b5563;
    font-weight: 700;
}

.chatbot-suggestions button {
    padding: 9px 12px;
    text-align: left;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1e3a5f;
    font-weight: 600;
}

.chatbot-suggestions button:hover:not(:disabled) {
    background: #fff3c4;
    border-color: #e3a713;
}

/* CV, LinkedIn and GitHub links */

.chatbot-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #1e3a5f;
    font-weight: 700;
}

/* Message input area */

.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
}

.chatbot-input-area input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    padding: 10px;
    font-size: 16px;
}

.chatbot-input-area button {
    background: #fbbf24;
    color: #111827;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    font-weight: 700;
}

.chatbot-container button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* AI disclaimer */

.chatbot-note {
    padding: 0 12px 10px;
    text-align: center;
    color: #4b5563;
    font-size: 10px;
}

/* Animated typing indicator */

.chatbot-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    min-height: 40px;
}

.chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1e3a5f;
    animation: chatbot-pulse 1.2s infinite ease-in-out;
}

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

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatbot-pulse {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Mobile responsive design */

@media (max-width: 480px) {

    .chatbot-container {
        right: 12px;
        bottom: 12px;
    }

    .chatbot-box {
        width: calc(100vw - 24px);
        height: min(610px, calc(100dvh - 90px));
    }

}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {

    .chatbot-typing span {
        animation: none;
    }

}
