/* Floating Chatbot Button */
.chatbot-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a2540, #1e3a8a);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(10, 37, 64, 0.35),
        0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1080;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.chatbot-float-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(10, 37, 64, 0.4);
    background: linear-gradient(135deg, #051c33, #1e40af);
}

.chatbot-float-btn i {
    font-size: 1.45rem;
    transition: transform 0.3s ease;
}

.chatbot-float-btn:hover i {
    transform: rotate(12deg);
}

/* Chatbot Card */
.chatbot-card {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: min(420px, calc(100vw - 48px));
    max-height: 78vh;
    z-index: 1090;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.chatbot-card.open {
    display: block;
    animation: chatbotPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatbotPopIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chatbot-card .card {
    height: 100%;
    border: none;
    border-radius: 20px;
    overflow: hidden;
}

.chatbot-card .card-header {
    background: #0f172a;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #334155;
}

.chatbot-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.chatbot-card .chatbot-messages {
    padding: 1rem;
    height: 50vh;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #64748b #f1f5f9;
}

/* @media (max-height: 576px) {
    .chatbot-card .chatbot-messages {
        height: 70vh;
    }
} */

.chatbot-card .chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-card .chatbot-messages::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 20px;
}

.chatbot-message {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 89%;
}

.chatbot-message.user {
    justify-content: flex-end;
    margin-left: auto;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.chatbot-bubble {
    padding: 13px 16px;
    border-radius: 20px;
    font-size: 0.97rem;
    line-height: 1.5;
    max-width: 100%;
}

.chatbot-message:not(.user) .chatbot-bubble {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chatbot-message.user .chatbot-bubble {
    background: #0a2540;
    color: white;
    border-bottom-right-radius: 6px;
}

.chatbot-card .chatbot-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #64748b;
    font-size: 0.98rem;
    line-height: 1.6;
}

/* Footer */
.chatbot-card .card-footer {
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.chatbot-card .input-group .form-control {
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.chatbot-card .input-group .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.chatbot-card .btn-dark-blue {
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    background: #0a2540;
    border: none;
}

.chatbot-card .btn-dark-blue:hover {
    background: #051c33;
}

.chatbot-quick-prompts {
    min-height: 72px;
}

.chatbot-quick-prompts .chatbot-prompt-btn {
    border-radius: 9999px;
    padding: 0.45rem 0.85rem;
    white-space: nowrap;
    font-size: 0.82rem;
}

/* New Hierarchical Menu Styles */
.chatbot-options-wrapper {
    background: white;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chatbot-option-btn {
    background: white;
    border: 1px solid #d1fae5;
    color: #334155;
    padding: 10px 5px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.chatbot-option-btn:hover {
    background: #f0fdf4;
    border-color: #10b981;
}

.chatbot-option-btn.full-width {
    grid-column: span 2;
}

.chatbot-option-btn.back-btn {
    background: #d1fae5;
    border: none;
    margin-top: 5px;
}

/* Record Cards */
.chatbot-records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}

.chatbot-record-card {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chatbot-record-header {
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
}

.chatbot-record-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.chatbot-record-field {
    font-size: 0.85rem;
    color: #475569;
}

.chatbot-record-field span {
    font-weight: 600;
    color: #1e293b;
    margin-right: 4px;
}

.chatbot-record-status {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-view-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.chatbot-view-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Dark Mode Chatbot UI */
[data-theme='dark'] .chatbot-card .card {
    background: #1e293b;
}

[data-theme='dark'] .chatbot-card .card-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

[data-theme='dark'] .chatbot-card .chatbot-messages {
    background: #0f172a;
}

[data-theme='dark'] .chatbot-message:not(.user) .chatbot-bubble {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme='dark'] .chatbot-message.user .chatbot-bubble {
    background: #3b82f6; 
}

[data-theme='dark'] .chatbot-card .chatbot-empty-state {
    color: #94a3b8;
}

[data-theme='dark'] .chatbot-card .card-footer {
    background: #1e293b;
    border-top-color: #334155;
}

[data-theme='dark'] .chatbot-card .input-group .form-control {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme='dark'] .chatbot-card .input-group .form-control::placeholder {
    color: #64748b;
}

[data-theme='dark'] .chatbot-options-wrapper {
    background: #1e293b;
    border-color: #334155;
}

[data-theme='dark'] .chatbot-option-btn {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme='dark'] .chatbot-option-btn:hover {
    background: #334155;
    border-color: #475569;
}

[data-theme='dark'] .chatbot-option-btn.back-btn {
    background: #334155;
    color: #f8fafc;
}

[data-theme='dark'] .chatbot-record-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme='dark'] .chatbot-record-header {
    color: #f8fafc;
    border-bottom-color: #334155;
}

[data-theme='dark'] .chatbot-record-field {
    color: #cbd5e1;
}

[data-theme='dark'] .chatbot-record-field span {
    color: #f8fafc;
}

[data-theme='dark'] .chatbot-record-status {
    color: #94a3b8;
}

[data-theme='dark'] .chatbot-view-link {
    color: #60a5fa;
}

[data-theme='dark'] .chatbot-view-link:hover {
    color: #93c5fd;
}