/* Chatbot Widget Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Chatbot Icon Button */
.chatbot-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #009dd9;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 157, 217, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10002; /* Ensure icon stays on top of window */
}

    .chatbot-icon:hover {
        background-color: #0b2d71;
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(11, 45, 113, 0.5);
    }

    .chatbot-icon i {
        line-height: 1;
    }

    .chatbot-icon.open {
        background-color: #0b2d71;
    }

/* Chatbot Window */
.chatbot-window {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 140px);
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    z-index: 10000; /* Below icon but above other content */
}

    .chatbot-window.show {
        display: flex;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #009dd9 0%, #0b2d71 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .chatbot-header-title i {
        font-size: 24px;
    }

    .chatbot-header-title h5 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }

.chatbot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

    .chatbot-close:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    .chatbot-messages::-webkit-scrollbar {
        width: 6px;
    }

    .chatbot-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chatbot-messages::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

        .chatbot-messages::-webkit-scrollbar-thumb:hover {
            background: #aaa;
        }

/* Message Bubbles */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-message.bot .chatbot-avatar {
    background-color: #009dd9;
    color: #fff;
}

.chatbot-message.user .chatbot-avatar {
    background-color: #0b2d71;
    color: #fff;
}

.chatbot-bubble {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.0;
}

.chatbot-message.bot .chatbot-bubble {
    flex: 1;
    min-width: 0;
    background-color: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chatbot-message.user .chatbot-bubble {
    background-color: #009dd9;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-bubble a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

    .chatbot-bubble a:hover {
        text-decoration: none;
    }

.chatbot-message.bot .chatbot-bubble a {
    color: #0b2d71;
}

.chatbot-bubble .link-icon {
    margin-left: 4px;
    font-size: 12px;
}

.chatbot-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

/* Loading Indicator */
.chatbot-loading {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
}

.chatbot-loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chatbot-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #009dd9;
    animation: bounce 1.4s infinite ease-in-out both;
}

    .chatbot-loading-dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .chatbot-loading-dot:nth-child(2) {
        animation-delay: -0.16s;
    }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background-color: #fff;
    border-top: 1px solid #e8e8e8;
}

.chatbot-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 11px;
    outline: none;
    transition: border-color 0.2s;
}

    .chatbot-input:focus {
        border-color: #009dd9;
    }

    .chatbot-input:disabled {
        background-color: #f5f5f5;
        cursor: not-allowed;
    }

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #009dd9;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

    .chatbot-send-btn:hover:not(:disabled) {
        background-color: #0b2d71;
    }

    .chatbot-send-btn:disabled {
        background-color: #ccc;
        cursor: not-allowed;
    }

/* Welcome Message */
.chatbot-welcome {
    text-align: center;
    color: #666;
    font-size: 11px;
/*    padding: 20px;
*/
}

    .chatbot-welcome h6 {
        color: #0b2d71;
        margin-bottom: 8px;
        font-weight: 600;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        right: 20px;
        bottom: 90px;
    }

    .chatbot-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
}

/* Error Message */
.chatbot-error {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    font-size: 11px;
    text-align: center;
}

/* Response Type Specific Styles */
.response-text {
    line-height: 1.6;
    margin-bottom: 0;
    font-weight: 700;
}

.response-link {
    margin-top: 12px;
}

    .response-link:first-child {
        margin-top: 0;
    }

.link-document,
.link-external {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background-color: #f0f8ff;
    border: 1px solid #009dd9;
    border-radius: 6px;
    color: #0b2d71;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .link-document:hover,
    .link-external:hover {
        background-color: #009dd9;
        color: #fff;
        text-decoration: none;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 157, 217, 0.3);
    }

    .link-document i,
    .link-external i {
        font-size: 12px;
    }

/* Link icon styling */
.link-icon {
    margin-right: 4px;
    vertical-align: middle;
}

/* Combination response spacing */
.response-text + .response-link {
    margin-top: 12px;
}

/* ========================================
   Hierarchical Navigation Styles
   ======================================== */

/* Option header text */
.chatbot-header-text {
    font-weight: 600;
    color: #0b2d71;
    margin-bottom: 15px;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

/* Options container */
.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

/* Option button styling */
.chatbot-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f0f8ff;
    border: 1px solid #009dd9;
    border-radius: 8px;
    color: #0b2d71;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    /*width: 100%;*/
}

    .chatbot-option-btn:hover {
        background-color: #009dd9;
        color: #fff;
        transform: translateX(5px);
        box-shadow: 0 2px 8px rgba(0, 157, 217, 0.3);
    }

    .chatbot-option-btn:active {
        transform: translateX(3px);
    }

/* Option icon */
.option-icon {
    font-size: 12px;
    flex-shrink: 0;
    min-width: 24px;
    text-align: center;
}

/* Option text */
.option-text {
    flex: 1;
    line-height: 1.4;
}

/* Hover effect for icon */
.chatbot-option-btn:hover .option-icon {
    transform: scale(1.1);
}

/* Chat Footer */
.chatbot-footer {
    padding: 12px 16px;
    background-color: #f9f9f9;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
    text-align: center;
}

/* Go to Main Menu link */
.go-to-main-menu {
    display: none;
    color: #009dd9;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .go-to-main-menu.show {
        display: inline-block;
    }

    .go-to-main-menu:hover {
        color: #0b2d71;
        background-color: #e8f4f8;
        text-decoration: underline;
    }

    .go-to-main-menu:active {
        opacity: 0.8;
    }

/* Modal Overlay */
.chatbot-modal-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    border-radius: 12px;
}

    .chatbot-modal-overlay.show {
        display: block;
    }

/* End Conversation Modal */
.chatbot-end-conversation-modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    width: 85%;
    max-width: 350px;
    padding: 0;
    animation: slideDown 0.3s ease-out;
}

    .chatbot-end-conversation-modal.show {
        display: block;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translate(-50%, -60%);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }

/* Modal Header */
/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f8f8;
}

    .modal-header h3 {
        margin: 0;
        font-size: 12px;
        font-weight: 600;
        color: #0b2d71;
    }

.modal-close {
    background: none;
    border: none;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

/* Body */
.modal-body {
    padding: 20px 16px;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    text-align: center;
}

/* Footer */
.modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #f8f8f8;
}

/* Buttons */
.modal-btn {
    min-width: 90px;
    height: 38px;
    padding: 0 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.modal-btn-primary {
    background-color: #2d6d7f;
    color: #fff;
}

    .modal-btn-primary:hover {
        background-color: #245766;
    }

.modal-btn-secondary {
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
}

    .modal-btn-secondary:hover {
        background-color: #d5d5d5;
    }

/* Modal Width */
.custom-modal .modal-dialog {
    max-width: 380px;
}

.custom-modal .modal-content {
    border-radius: 8px;
    overflow: hidden;
}
/* ============================================
   RESPONSIVE STYLES - Scale Down for Standard Resolution
   ============================================ */

/* For standard screens (1920px and below) - reduce size by 15% */
@media screen and (max-width: 1920px) {
    .chatbot-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .chatbot-window {
        width: 340px;
        height: 480px;
        bottom: 70px;
    }

    .chatbot-header {
        padding: 14px 18px;
    }

    .chatbot-header-title h5 {
        font-size: 15px;
    }

    .chatbot-header-title i {
        font-size: 22px;
    }

    .chatbot-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .chatbot-messages {
        padding: 14px;
    }

    .message {
        font-size: 12px;
        padding: 10px 14px;
        max-width: 75%;
    }

    .chatbot-input {
        font-size: 12px;
        padding: 10px 14px;
    }

    .chatbot-send-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .option-button {
        font-size: 12px;
        padding: 10px 14px;
    }

    .document-link {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* For laptop screens (1366px and below) - reduce size by 25% */
@media screen and (max-width: 1366px) {
    .chatbot-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .chatbot-window {
        width: 320px;
        height: 450px;
        bottom: 65px;
    }

    .chatbot-header {
        padding: 12px 16px;
    }

    .chatbot-header-title h5 {
        font-size: 14px;
    }

    .chatbot-header-title i {
        font-size: 20px;
    }

    .chatbot-close {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .message {
        font-size: 12px;
        padding: 9px 12px;
        max-width: 75%;
    }

    .chatbot-input {
        font-size: 12px;
        padding: 9px 12px;
    }

    .chatbot-send-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .option-button {
        font-size: 12px;
        padding: 9px 12px;
    }

    .document-link {
        font-size: 11px;
        padding: 7px 10px;
    }

    .chatbot-footer {
        padding: 10px 16px;
    }

    .go-to-main-menu {
        font-size: 12px;
    }
}

/* For tablets and small laptops (1024px and below) - reduce size by 35% */
@media screen and (max-width: 1024px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .chatbot-window {
        width: 300px;
        height: 420px;
        bottom: 60px;
        right: 15px;
    }

    .chatbot-header {
        padding: 10px 14px;
    }

    .chatbot-header-title h5 {
        font-size: 13px;
    }

    .chatbot-header-title i {
        font-size: 18px;
    }

    .chatbot-close {
        width: 24px;
        height: 24px;
        font-size: 15px;
    }

    .chatbot-messages {
        padding: 10px;
    }

    .message {
        font-size: 11px;
        padding: 8px 10px;
        max-width: 78%;
    }

    .chatbot-input-area {
        padding: 10px;
    }

    .chatbot-input {
        font-size: 11px;
        padding: 8px 10px;
    }

    .chatbot-send-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .option-button {
        font-size: 11px;
        padding: 8px 10px;
    }

    .document-link {
        font-size: 10px;
        padding: 6px 9px;
    }

    .chatbot-footer {
        padding: 8px 14px;
    }

    .go-to-main-menu {
        font-size: 11px;
    }
}

/* For mobile devices (768px and below) - compact mode */
@media screen and (max-width: 768px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .chatbot-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-height: 500px;
        bottom: 65px;
        right: 10px;
    }

    .chatbot-header {
        padding: 12px;
    }

    .chatbot-header-title h5 {
        font-size: 14px;
    }

    .chatbot-header-title i {
        font-size: 20px;
    }

    .chatbot-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .message {
        font-size: 13px;
        padding: 10px 12px;
        max-width: 80%;
    }

    .chatbot-input-area {
        padding: 12px;
    }

    .chatbot-input {
        font-size: 13px;
        padding: 10px 12px;
    }

    .chatbot-send-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .option-button {
        font-size: 13px;
        padding: 10px 12px;
    }

    .document-link {
        font-size: 12px;
        padding: 8px 10px;
    }

    .chatbot-footer {
        padding: 10px 12px;
    }

    .go-to-main-menu {
        font-size: 12px;
    }
}

/* For very small mobile devices (480px and below) */
@media screen and (max-width: 480px) {
    .chatbot-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        max-height: 450px;
        bottom: 60px;
    }

    .message {
        font-size: 12px;
        padding: 9px 11px;
        max-width: 85%;
    }

    .chatbot-input {
        font-size: 12px;
        padding: 9px 11px;
    }

    .option-button {
        font-size: 12px;
        padding: 9px 11px;
    }
}

/* Email Submission Form Styles */
.chatbot-bubble-with-form {
    padding: 15px;
}

.chatbot-email-form {
    margin-top: 12px;
    width: 100%;
}

.chatbot-form-group {
    margin-bottom: 15px;
}

.chatbot-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 10px;
    color: #333;
}

.chatbot-form-input,
.chatbot-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 10px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.chatbot-form-input:focus,
.chatbot-form-textarea:focus {
    outline: none;
    border-color: #009dd9;
    box-shadow: 0 0 0 3px rgba(0, 157, 217, 0.1);
}

.chatbot-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.chatbot-form-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #009dd9 0%, #0b2d71 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.chatbot-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 157, 217, 0.3);
}

.chatbot-form-submit:active {
    transform: translateY(0);
}

.chatbot-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px) {
    .chatbot-form-input,
    .chatbot-form-textarea {
        font-size: 13px;
        padding: 9px 11px;
    }

    .chatbot-form-submit {
        font-size: 13px;
        padding: 11px;
    }
}

