/* Chatbot widget-only styles. No global body, heading, link, or reset rules. */
#smart-chatbot-container,
#smart-chatbot-container * {
    box-sizing: border-box;
}

#smart-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#smart-chatbot-window {
    display: none;
    width: 360px;
    height: 550px;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(212, 241, 244, 0.15);
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: smartChatbotPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes smartChatbotPopIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#smart-chatbot-header {
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    padding: 0 12px;
    font-weight: 600;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 60px;
    z-index: 10;
}

#smart-chatbot-top-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #D4F1F4;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(212, 241, 244, 0.4);
    pointer-events: none;
    white-space: nowrap;
}

#smart-chatbot-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

#smart-chatbot-controls button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

#smart-chatbot-controls button:hover {
    color: #fff;
}

#smart-chatbot-messages {
    flex-grow: 1;
    padding: 18px 18px 8px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#smart-chatbot-messages::-webkit-scrollbar { width: 6px; }
#smart-chatbot-messages::-webkit-scrollbar-track { background: transparent; }
#smart-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
}

#smart-chatbot-container .chat-msg {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

#smart-chatbot-container .bot-msg {
    background: rgba(255, 255, 255, 0.08);
    color: #e8eef9;
    align-self: flex-start;
}

#smart-chatbot-container .user-msg {
    background: #D4F1F4;
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

#smart-chatbot-container .chat-link {
    color: #D4F1F4;
    text-decoration: none;
    border-bottom: 1px solid #D4F1F4;
}

#smart-chatbot-input-area {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 8px;
    background: rgba(10, 10, 10, 0.45);
    border-top: 1px solid rgba(212, 241, 244, 0.1);
    backdrop-filter: blur(12px);
}

#smart-chatbot-input-controls {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

#smart-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    padding: 4px 0;
    width: 100%;
    min-width: 0;
}

#smart-chatbot-container .suggestion-chip {
    box-sizing: border-box;
    flex: 1 1 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    background: rgba(212, 241, 244, 0.1);
    color: #D4F1F4;
    border: 1px solid rgba(212, 241, 244, 0.2);
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: normal;
    text-align: left;
    line-height: 1.25;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

#smart-chatbot-container .suggestion-chip:hover {
    background: rgba(212, 241, 244, 0.25);
    border-color: #D4F1F4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 241, 244, 0.15);
}

#smart-chatbot-container .container {
    --color: rgba(255, 255, 255, 0.6);
    --size: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 24px;
    user-select: none;
    fill: var(--color);
    width: var(--size);
    height: var(--size);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    transition: all 0.2s;
    margin: 0 auto;
}

#smart-chatbot-container .container:hover {
    --color: #D4F1F4;
    background: rgba(212, 241, 244, 0.1);
    border-color: rgba(212, 241, 244, 0.4);
    box-shadow: 0 0 15px rgba(212, 241, 244, 0.2);
    transform: translateY(-2px);
    fill: var(--color);
}

#smart-chatbot-container .container .chevron-down {
    position: absolute;
    transform: rotate(180deg);
    animation: smartChatbotReturn 0.5s;
}

#smart-chatbot-container .container input:checked ~ .chevron-down {
    animation: smartChatbotRotate 0.5s;
    transform: rotate(0deg);
}

#smart-chatbot-container .container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

@keyframes smartChatbotRotate {
    0% { transform: rotate(180deg); }
    100% { transform: rotate(0deg); }
}

@keyframes smartChatbotReturn {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}

#smart-chatbot-input-controls button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    padding: 0;
}

#smart-chatbot-input-controls button:hover {
    background: rgba(212, 241, 244, 0.15);
    border-color: rgba(212, 241, 244, 0.4);
    color: #D4F1F4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 241, 244, 0.15);
}

#smart-chatbot-container .messageBox {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.06);
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: border-color 0.2s;
}

#smart-chatbot-container .messageBox:focus-within {
    border-color: rgba(212, 241, 244, 0.4);
}

#smart-chatbot-input {
    flex: 1;
    height: 100%;
    background-color: transparent;
    outline: none;
    border: none;
    padding: 0 10px;
    color: white;
    font-size: 14px;
    min-width: 0;
}

#smart-chatbot-send {
    width: 32px;
    height: 32px;
    background-color: transparent;
    outline: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    padding: 0;
}

#smart-chatbot-send svg {
    height: 20px;
    width: 20px;
}

#smart-chatbot-send svg path {
    stroke: rgba(255, 255, 255, 0.6);
    transition: stroke 0.2s;
}

#smart-chatbot-send:hover svg path {
    stroke: #D4F1F4;
}

#smart-chatbot-footer-branding {
    text-align: center;
    padding: 2px 0 0;
    margin-top: 2px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#smart-chatbot-footer-branding img {
    height: 48px;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

#smart-chatbot-container .burger {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    transition: 300ms;
    border-radius: 10px;
}

#smart-chatbot-container .burger input[type="checkbox"] {
    appearance: none;
    transition: 300ms;
}

#smart-chatbot-container .burger::before,
#smart-chatbot-container .burger::after {
    content: "";
    transition: 300ms;
    transform-origin: center center;
}

#smart-chatbot-container .burger::before {
    transform: translateY(8px);
}

#smart-chatbot-container .burger::after {
    transform: translateY(-8px);
}

#smart-chatbot-container .burger .line,
#smart-chatbot-container .burger::before,
#smart-chatbot-container .burger::after {
    width: 25px;
    height: 2.1px;
    display: block;
    background-color: rgb(148, 156, 150);
    border-radius: 5px;
    position: absolute;
}

#smart-chatbot-container .burger .line:checked {
    width: 0;
    transition-delay: 100ms;
}

#smart-chatbot-container .burger:has(.line:checked)::before {
    animation: smartChatbotBurgerTop 400ms ease-out 0s 1 both;
}

#smart-chatbot-container .burger:has(.line:checked)::after {
    animation: smartChatbotBurgerBottom 400ms ease-out 0s 1 both;
}

#smart-chatbot-container .burger:hover {
    background: rgba(255, 255, 255, 0.1);
}

#smart-chatbot-container .burger:hover .line,
#smart-chatbot-container .burger:hover::before,
#smart-chatbot-container .burger:hover::after {
    background: #D4F1F4;
}

#smart-chatbot-container .burger:active {
    scale: 0.95;
}

@keyframes smartChatbotBurgerTop {
    0% { transform: translateY(8px) rotate(0deg); }
    50% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(0px) rotate(45deg); }
}

@keyframes smartChatbotBurgerBottom {
    0% { transform: translateY(-8px) rotate(0deg); }
    50% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(0px) rotate(-45deg); }
}

#smart-chatbot-container .button {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#smart-chatbot-container .X,
#smart-chatbot-container .Y {
    position: absolute;
    width: 22px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
}

#smart-chatbot-container .X { transform: rotate(45deg); }
#smart-chatbot-container .Y { transform: rotate(-45deg); }

#smart-chatbot-container .button:hover {
    background-color: rgba(255, 50, 50, 0.2);
}

#smart-chatbot-container .button:hover .X,
#smart-chatbot-container .button:hover .Y {
    background-color: #ff4d4d;
}

#smart-chatbot-container .close {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#smart-chatbot-container .button:hover .close {
    opacity: 1;
}

#smart-chatbot-container .back-button {
    display: block;
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    margin: 0 auto;
}

#smart-chatbot-container .back-button:hover {
    background: rgba(212, 241, 244, 0.1);
    border-color: rgba(212, 241, 244, 0.4);
    box-shadow: 0 0 15px rgba(212, 241, 244, 0.2);
    transform: translateY(-2px);
}

#smart-chatbot-container .back-button-box {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

#smart-chatbot-container .back-button-elem {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0 10px;
    fill: rgba(255, 255, 255, 0.6);
    transform: rotate(180deg);
    transition: fill 0.15s ease;
}

#smart-chatbot-container .back-button:hover .back-button-box {
    transform: translateY(-50%) translateX(-38px);
}

#smart-chatbot-container .back-button:hover .back-button-elem {
    fill: #D4F1F4;
}

#smart-chatbot-toggle {
    background: #D4F1F4;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background 0.2s;
    animation: smartChatbotPulse 2s infinite;
}

#smart-chatbot-container .chatbot-toggle-icon {
    width: 28px;
    height: 28px;
    fill: #111827;
}

#smart-chatbot-toggle:hover {
    transform: scale(1.08);
    background: #C4E1E4;
}

@keyframes smartChatbotPulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 241, 244, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(212, 241, 244, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 241, 244, 0); }
}

#smart-chatbot-context-banner {
    background: rgba(212, 241, 244, 0.05);
    border-bottom: 1px solid rgba(212, 241, 244, 0.1);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#smart-chatbot-context-banner span {
    font-size: 11px;
    color: #94a3b8;
}

#smart-chatbot-company-select {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    max-width: 150px;
    font-family: inherit;
}

@media (max-width: 480px) {
    #smart-chatbot-container {
        right: 10px;
        bottom: 10px;
    }

    #smart-chatbot-window {
        width: min(360px, calc(100vw - 20px));
        height: min(550px, calc(100vh - 20px));
    }
}
