/* Root container */
#njdoe-chatbot-widget {
    z-index: 10000;
    position: fixed;
    right: 100px;
    bottom: 30px;
}

/* Launcher button */
#njdoe-chat-button {
    height: 50px;
    background: var(--njdoe-primary-color, #011E3D);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    gap: 10px;
}

/* Chat window shell */
#njdoe-chat-window {
    width: 450px;
    height: min(650px, calc(100vh - 115px));
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0px;
    bottom: 70px;
}

/* Header bar */
#njdoe-chat-header {
    background: var(--njdoe-primary-color, #011E3D);
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#njdoe-chat-header .njdoe-header-button {
    padding: 16px 24px;
    font-size: 1.5em;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
}

#njdoe-chat-header .njdoe-header-button.njdoe-menu-button {
    padding-top: 12px;
}

#njdoe-chat-header .njdoe-header-button#njdoe-clear-btn.njdoe-menu-button:hover {
    background-color: #CCCCCC;
}

#njdoe-chat-header .njdoe-header-button:hover, #njdoe-chat-header .njdoe-header-button:focus {
    color: #CCCCCC;
}

.njdoe-chat-header-menu {
    position: relative;
}

.njdoe-clear-btn:hover {
    background-color: #CCCCCC;
}

#njdoe-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 190px;
    z-index: 1000;
}

.njdoe-menu-item {
    border-bottom: 1px solid #e9ecef;
    padding: 12px 8px;
}

.njdoe-menu-button {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    color: #333333;
}

.njdoe-chat-title {
    width: auto;
    flex: 1;
    object-fit: contain;
    padding: 0;
    margin: 0;
    color: #ffffff;
}

.njdoe-chat-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 1.5em;
}

/* Messages area */
.njdoe-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.njdoe-chat-message {
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    max-width: 80%;
}

.njdoe-chat-message > p {
    margin-bottom: 0;
}

.njdoe-chat-message.njdoe-chat-message-user {
    background: var(--njdoe-primary-color, #011E3D);
    color: white;
    margin-left: auto;
}

/* Typing indicator */
#njdoe-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    letter-spacing: 2px;
}

#njdoe-typing .njdoe-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #999999;
    opacity: 0.2;
    animation: njdoe-typing-bounce 1s infinite ease-in-out;
}

#njdoe-typing .njdoe-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

#njdoe-typing .njdoe-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes njdoe-typing-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.2;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Disclaimer text */
.njdoe-chat-disclaimer {
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 10px;
    color: #212529;
    line-height: 1.4;
    text-align: center;
}

.njdoe-chat-disclaimer a {
    color: #212529;
    text-decoration: underline;
}

/* Input row */
.njdoe-chat-input-row {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
}

/* Link styling for linkified content */
.njdoe-chat-link {
    color: var(--njdoe-primary-color, #011E3D);
    text-decoration: underline;
}

button.njdoe-chat-send {
    color: white;
    background-color: var(--njdoe-primary-color, #011E3D);;
    border-color: var(--njdoe-primary-color, #011E3D);;
}

button.njdoe-chat-send:disabled {
    opacity: 0.6;
    color: white;
    background-color: var(--njdoe-primary-color, #011E3D);;
    border-color: var(--njdoe-primary-color, #011E3D);;
}

button.njdoe-chat-send:hover, button.njdoe-chat-send:focus {
    background-color: #013A75;
    border-color: #013A75;
}

/* Mobile layout */
@media (max-width: 600px) {
    #njdoe-chat-window {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 100px !important;
        top: 60px !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        border-radius: 12px !important;
    }

    .njdoe-chat-messages {
        padding: 12px !important;
    }
}