/* AVA Widget Styles */

/* CSS Reset for AVA Widget - Prevent site styles from interfering */
.betty-bot-widget,
.betty-bot-widget * {
    box-sizing: border-box !important;
}

.betty-bot-widget input[type="text"],
.betty-bot-widget input[type="email"],
.betty-bot-widget input[type="search"],
.betty-bot-widget textarea {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 60px !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
}

/* Override Bootstrap and other framework button styles - but exclude feedback footer buttons */
.betty-bot-widget .betty-send-button,
.betty-bot-widget .betty-new-chat-btn,
.betty-bot-widget .betty-sidebar-toggle,
.betty-bot-widget .betty-rename-btn,
.betty-bot-widget .betty-load-more-btn,
.betty-bot-widget .betty-feedback-btn,
.betty-bot-widget .betty-feedback-close,
.betty-bot-widget .btn:not([class*="button"]) {
    height: 25px !important;
    width: 25px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: normal !important;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: baseline !important;
    text-align: left !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

    .betty-bot-widget .betty-load-more-btn {
        border: none !important;
        outline: none !important;
        background: none !important;
        height: unset !important;
        width: unset !important;
        border-radius: none !important;
    }

.betty-bot-widget {
    font-family: 'Lato', Arial, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    width: 100%
}

/* General link styling for specific Betty widget links - exclude feedback footer buttons */
.betty-bot-widget .betty-welcome-message a,
.betty-bot-widget .betty-input-container a,
.betty-bot-widget .betty-sidebar a:not(.button) {
    color: #45cc77;
    text-decoration: none;
    font-size: inherit;
    font-weight: normal;
    transition: color 0.2s ease;
}

.betty-bot-widget .betty-welcome-message a:hover,
.betty-bot-widget .betty-input-container a:hover,
.betty-bot-widget .betty-sidebar a:not(.button):hover {
    color: #3bb866;
    text-decoration: underline;
}

.betty-chat-container {
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* Welcome Message */
.betty-welcome-message {
    padding: 24px;
    /* Fallback background for older browsers */
    background: linear-gradient(135deg, #4de085 0%, #45cc77 100%);
    /* Modern gradient using CSS custom properties */
    background: 
        linear-gradient(135deg, 
            var(--betty-header-color, #5cff96) 0%, 
            var(--betty-header-color, #5cff96) 100%
        ),
        linear-gradient(135deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.3) 100%),
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 60%);
    background-blend-mode: normal, multiply, normal, normal;
    color: #fff;
    text-align: center;
    position: relative;
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3),
        1px 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure good contrast for different header colors */
.betty-welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
    z-index: 1;
}

.betty-welcome-message > * {
    position: relative;
    z-index: 2;
}

.betty-welcome-message .hero-image {
    margin-bottom: 16px;
}

.betty-welcome-message .hero-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

.betty-welcome-message h3 {
    margin: 16px 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 1px 6px rgba(0, 0, 0, 0.3);
}

.betty-welcome-message p {
    margin: 12px 0;
    font-size: 14px;
    color: #fff;
    opacity: 0.95;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.2);
}

.betty-welcome-message .static-question {
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 18px;
    margin: 10px auto;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    max-width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-weight: 500;
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3),
        1px 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 3px 10px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.betty-welcome-message .static-question:hover {
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.1) 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.25),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.betty-welcome-message .static-question:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.2),
        0 1px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* Messages Container */
.betty-messages {
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    min-height: 300px;
    max-height: 500px;
}

/* Custom Scrollbar Styling for Chat Container */
.betty-messages::-webkit-scrollbar {
    width: 8px;
}

.betty-messages::-webkit-scrollbar-thumb {
    background: #5CFF96;
    border-radius: 4px;
}

.betty-messages::-webkit-scrollbar-track {
    background: transparent;
}

.betty-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.betty-message-user {
    align-items: flex-end;
}

.betty-message-assistant {
    align-items: flex-start;
}

.betty-message-error {
    align-items: center;
}

.betty-message-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.betty-message-content strong {
    font-weight: 600;
    color: inherit;
}

.betty-message-content a {
    color: #45cc77;
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
    transition: color 0.2s ease;
}

.betty-message-content a:hover {
    color: #3bb866;
    text-decoration: underline;
}

/* Multi-level header formatting */
.betty-message-content h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a3d1f;
    margin: 16px 0 8px 0;
    padding: 0;
    border-bottom: 3px solid #45cc77;
    padding-bottom: 4px;
}

.betty-message-content h2 {
    font-size: 18px;
    font-weight: 650;
    color: #234d28;
    margin: 14px 0 7px 0;
    padding: 0;
    border-bottom: 2px solid #45cc77;
    padding-bottom: 3px;
}

.betty-message-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c5530;
    margin: 12px 0 6px 0;
    padding: 0;
    border-bottom: 2px solid #45cc77;
    padding-bottom: 3px;
}

.betty-message-content h4 {
    font-size: 15px;
    font-weight: 550;
    color: #355d38;
    margin: 10px 0 5px 0;
    padding: 0;
    border-bottom: 1px solid #45cc77;
    padding-bottom: 2px;
}

/* Italic text formatting */
.betty-message-content em {
    font-style: italic;
    color: #4a6b4d;
    font-weight: 500;
}

/* Horizontal rule formatting for --- separators */
.betty-message-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #45cc77, transparent);
    margin: 14px 0;
    opacity: 0.6;
}

.betty-message-user .betty-message-content {
    background: #003552;
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 77, 159, 0.3);
}

.betty-message-assistant .betty-message-content {
    background: #ffffff;
    color: #333;
    border-bottom-left-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.betty-message-error .betty-message-content {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
    text-align: center;
    border-radius: 12px;
}

/* References */
.betty-references {
    margin-top: 12px;
    max-width: 85%;
}

.betty-reference {
    background: #f0f8ff;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 6px 0;
    font-size: 12px;
}

    .betty-reference a {
        color: #003552;
        text-decoration: none;
        font-weight: 500;
    }

.betty-reference a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.betty-typing {
    align-items: flex-start;
}

.betty-typing-indicator {
    background: #ffffff;
    border-radius: 20px;
    /*padding: 12px 16px;*/
    border-bottom-left-radius: 6px;
    /*border: 1px solid #e0e0e0;*/
    display: flex;
    align-items: center;
    gap: 4px;
}

.betty-typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing 1.4s infinite ease-in-out;
}

.betty-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.betty-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Container */
.betty-input-container {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

/* Question Suggestions */
.betty-question-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    transition: all 0.3s ease-in-out;
    opacity: 1;
    max-height: 200px;
    overflow: hidden;
}

.betty-question-suggestions.hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    transform: translateY(-10px);
}

.betty-suggestion-item {
    background: #f8f9fa;
    color: #333;
    padding: 12px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    text-align: center;
}

.betty-suggestion-item:hover {
    background: #e0e0e0;
    border-color: #ccc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Member Access Toggle */
.betty-member-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 8px;
    flex-shrink: 0;
}

.betty-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.betty-member-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.betty-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.betty-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.betty-member-checkbox:checked + .betty-toggle-slider {
    background-color: #003552;
}

.betty-member-checkbox:checked + .betty-toggle-slider:before {
    transform: translateX(20px);
}

.betty-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.betty-member-checkbox:checked ~ .betty-toggle-label {
    color: #003552;
}

.betty-bot-widget .betty-input-wrapper {
    display: flex !important;
    align-items: center !important;
    background: #f8f9fa !important;
    border-radius: 28px !important;
    padding: 6px !important;
    border: 2px solid #e0e0e0 !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 !important;
    position: relative !important;
}

    .betty-bot-widget .betty-input-wrapper:focus-within {
        border-color: #003552 !important;
        box-shadow: 0 0 0 3px rgba(0, 77, 159, 0.1) !important;
    }

/* Betty Bot Input - High specificity to override site styles */
.betty-bot-widget .betty-input-wrapper .betty-message-input,
.betty-bot-widget .betty-message-input {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    outline: none !important;
    resize: none !important;
    font-family: 'Lato', Arial, sans-serif !important;
    color: #333 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: normal !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.betty-bot-widget .betty-input-wrapper .betty-message-input:disabled,
.betty-bot-widget .betty-message-input:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background: transparent !important;
    color: #999 !important;
}

.betty-bot-widget .betty-input-wrapper .betty-message-input::placeholder,
.betty-bot-widget .betty-message-input::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
    font-style: normal !important;
    font-weight: normal !important;
}

.betty-bot-widget .betty-send-button {
    background: #004868 !important;
    color: white !important;
    border: none !important;
    border-radius: 22px !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-family: inherit !important;
    font-weight: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.betty-bot-widget .betty-send-button:hover:not(:disabled) {
    background: #003654 !important;
    transform: scale(1.05) !important;
}

.betty-bot-widget .betty-send-button:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.betty-bot-widget .betty-send-button.betty-sending {
    background: #6c757d !important;
    cursor: wait !important;
    position: relative !important;
    color: transparent !important;
}

.betty-bot-widget .betty-send-button.betty-sending::after {
    content: '●●●' !important;
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    color: #5cff96 !important;
    font-size: 8px !important;
    letter-spacing: 2px !important;
    text-align: center !important;
    line-height: 20px !important;
    animation: betty-spin 2s linear infinite, betty-bounce 1.4s ease-in-out infinite !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    margin-top: -10px !important;
    margin-left: -10px !important;
    z-index: 1 !important;
}

@keyframes betty-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes betty-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Auth Notice */
.betty-auth-notice {
    margin-top: 12px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

.betty-user-info {
    margin-top: 10px;
    text-align: center;
    color: #6c757d;
    font-size: 12px;
}

/* Footer */
.betty-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #6c757d;
    font-size: 11px;
}

.betty-footer a {
    color: #45cc77;
    text-decoration: none;
    font-size: 11px;
    font-weight: normal;
}

.betty-footer a:hover {
    color: #3bb866;
    text-decoration: underline;
}

.betty-debug-info {
    color: #dc3545;
    font-weight: bold;
}

/* Error Message */
.betty-error-message {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    text-align: center;
    font-size: 13px;
}

/* Loading States */
.betty-loading {
    opacity: 0.7;
}

/* Widget Height Control */
.betty-bot-widget[data-height] .betty-messages {
    min-height: var(--betty-height, 300px);
    max-height: var(--betty-height, 500px);
}

/* Custom Container Classes */
.betty-bot-widget.compact .betty-messages {
    min-height: 200px;
    max-height: 300px;
}

.betty-bot-widget.expanded .betty-messages {
    min-height: 400px;
    max-height: 600px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .betty-bot-widget {
        margin: 10px;
        border-radius: 8px;
    }
    
    .betty-messages {
        min-height: 250px;
        max-height: 400px;
        padding: 16px;
    }
    
    .betty-message-content {
        max-width: 90%;
        font-size: 13px;
    }
    
    .betty-references {
        max-width: 90%;
    }
    
    .betty-welcome-message {
        padding: 20px 16px;
    }
    
    .betty-welcome-message h3 {
        font-size: 16px;
    }
    
    .betty-welcome-message .hero-image img {
        max-width: 150px;
    }
    
    .betty-input-container {
        padding: 16px;
    }
    
    .betty-static-question {
        font-size: 13px;
        padding: 8px 14px;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .betty-bot-widget {
        margin: 5px;
        border-radius: 6px;
    }
    
    .betty-messages {
        min-height: 200px;
        max-height: 350px;
        padding: 12px;
    }
    
    .betty-message-content {
        max-width: 95%;
        font-size: 12px;
        padding: 10px 14px;
    }
    
    .betty-welcome-message {
        padding: 16px 12px;
    }
    
    .betty-welcome-message h3 {
        font-size: 14px;
    }
    
    .betty-welcome-message .hero-image img {
        max-width: 120px;
    }
    
    .betty-static-question {
        font-size: 12px;
        padding: 6px 12px;
        max-width: 240px;
    }
    
    .betty-input-container {
        padding: 12px;
    }
    
    .betty-send-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Accessibility Improvements */
.betty-message:focus,
.betty-send-button:focus,
.betty-bot-widget .betty-input-wrapper .betty-message-input:focus,
.betty-bot-widget .betty-message-input:focus,
.betty-static-question:focus {
    outline: 2px solid #004868;
    outline-offset: 2px;
}

.betty-static-question {
    outline: none;
}

.betty-static-question:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .betty-bot-widget {
        border: 2px solid #000;
    }
    
    .betty-message-assistant .betty-message-content {
        border: 2px solid #000;
    }
    
    .betty-input-wrapper {
        border: 2px solid #000;
    }
    
    .betty-welcome-message {
        background: #000;
        color: #fff;
    }
}

/* Disabled state for static questions when not authenticated AND login is enforced */
.betty-bot-widget[data-authenticated="false"][data-enforce-login="true"] .static-question {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.betty-bot-widget[data-authenticated="false"][data-enforce-login="true"] .static-question:hover {
    background: inherit !important;
    transform: none !important;
    box-shadow: inherit !important;
}

/* Conversation History Sidebar Styles (Member Exclusive) */
.betty-bot-widget {
    position: relative;
}

.betty-conversation-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    z-index: 100;
    transform: translateX(0);
    transition: width 0.3s ease-in-out, background 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.betty-conversation-sidebar.collapsed {
    width: 40px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
}

.betty-chat-container.with-sidebar {
    margin-left: 320px;
    transition: margin-left 0.3s ease-in-out;
}

.betty-bot-widget[data-sidebar-collapsed="true"] .betty-chat-container.with-sidebar,
.betty-chat-container.with-sidebar.sidebar-collapsed {
    margin-left: 40px;
}

/* Chat Header */
.betty-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--betty-header-color, #5cff96);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 48px;
    flex-shrink: 0;
}

.betty-chat-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 60px);
}

.betty-chat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .betty-chat-icon img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        border: 1px solid #004868;
        border-radius: 16px;
    }

/* Sidebar Header */
.betty-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    min-height: 60px;
    flex-shrink: 0;
}

.betty-conversation-sidebar.collapsed .betty-sidebar-header {
    padding: 8px 4px;
    justify-content: center;
}

.betty-sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
}

.betty-conversation-sidebar.collapsed .betty-sidebar-title {
    display: none;
}

.betty-new-chat-btn {
    font-family: DM Sans, sans-serif !important;
    font-size: 12px !important;
    line-height: 145% !important;
    font-weight: 700 !important;
    background-color: #5cff96 !important;
    border: 2px solid #001d25 !important;
    color: #000 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    padding: 8px 12px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    min-width: auto !important;
    min-height: auto !important;
    transition: all 0.2s ease !important;
}

.betty-new-chat-btn:hover {
    background-color: #001d25 !important;
    border-color: #001d25 !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}

.betty-new-chat-btn:active {
    background-color: #004868 !important;
    border-color: #001d25 !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}

.betty-new-chat-btn svg {
    margin: 3.5px;
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2 !important;
    filter: none !important;
}

.betty-sidebar-toggle {
    background: transparent !important;
    color: #6c757d !important;
    padding: 8px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.betty-sidebar-toggle:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
}

.betty-sidebar-toggle svg {
    transition: transform 0.3s ease;
}

.betty-conversation-sidebar.collapsed .betty-sidebar-toggle svg {
    transform: rotate(180deg);
}

/* Conversation List */
.betty-conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Custom Scrollbar Styling for Conversation History */
.betty-conversation-list::-webkit-scrollbar {
    width: 8px;
}

.betty-conversation-list::-webkit-scrollbar-thumb {
    background: #5CFF96;
    border-radius: 4px;
}

.betty-conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

.betty-conversation-sidebar.collapsed .betty-conversation-list {
    display: none;
}

.betty-conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 2px 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    position: relative;
}

.betty-conversation-item:hover {
    background: #f8f9fa;
}

    .betty-conversation-item.active {
        background: #003552;
        color: #fff;
    }

.betty-conversation-item.active .betty-conversation-date {
    color: rgba(255, 255, 255, 0.7) !important;
}

.betty-conversation-content {
    flex: 1;
    min-width: 0;
}

.betty-conversation-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.betty-conversation-item.active .betty-conversation-name {
    color: #fff;
}

.betty-conversation-date {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.betty-conversation-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.betty-conversation-item:hover .betty-conversation-actions,
.betty-conversation-item.active .betty-conversation-actions {
    opacity: 1;
}

.betty-rename-btn {
    background: transparent !important;
    color: #6c757d !important;
    padding: 6px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.betty-rename-btn:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
}

.betty-conversation-item.active .betty-rename-btn {
    color: rgba(255, 255, 255, 0.8) !important;
}

.betty-conversation-item.active .betty-rename-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* Load More Button */
.betty-load-more-container {
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.betty-load-more-btn {
    background: transparent !important;
    color: #003552 !important;
    border: 1px solid #003552 !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease;
}

    .betty-load-more-btn:hover {
        background: #004868 !important;
        color: #fff !important;
    }

.betty-load-more-btn:disabled {
    background: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #e0e0e0 !important;
    cursor: not-allowed !important;
}

/* Empty State */
.betty-no-conversations {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.betty-empty-state {
    text-align: center;
    color: #6c757d;
}

.betty-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.betty-empty-state p {
    margin: 8px 0 4px 0 !important;
    font-size: 14px;
}

.betty-empty-state small {
    color: #999;
    font-size: 12px;
}

/* Show Sidebar Button (when collapsed or mobile) */

/* Mobile Backdrop */
.betty-mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
}

.betty-mobile-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Loading States */
.betty-loading {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.betty-empty-conversation {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .betty-conversation-sidebar {
        width: 280px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile collapsed state - only apply when NOT expanded via mobile backdrop */
    .betty-conversation-sidebar.collapsed:not(.mobile-expanded) {
        width: 40px;
        transform: translateX(0);
        background: #f8f9fa;
        z-index: 100; /* Lower z-index than overlay state */
    }
    
    /* Mobile expanded state */
    .betty-conversation-sidebar.mobile-expanded {
        transform: translateX(0);
        z-index: 1000;
    }
    
    .betty-mobile-backdrop {
        display: block;
    }
    
    .betty-mobile-backdrop.active ~ .betty-conversation-sidebar {
        transform: translateX(0);
    }
    
    .betty-chat-container.with-sidebar {
        margin-left: 0 !important;
    }
    
}

@media (max-width: 480px) {
    .betty-conversation-sidebar {
        width: 100vw;
        max-width: 320px;
    }
    
    .betty-conversation-item {
        padding: 16px 20px;
    }
    
    .betty-conversation-name {
        font-size: 15px;
    }
    
    .betty-conversation-date {
        font-size: 13px;
    }
}

/* Feedback buttons */
.betty-feedback-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.betty-message-assistant:hover .betty-feedback-container {
    opacity: 1;
}

.betty-feedback-container.has-feedback {
    opacity: 1;
}

.betty-feedback-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #6c757d;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.betty-feedback-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.betty-feedback-btn.active.positive {
    color: #004868;
    background-color: #e6f3ff;
}

.betty-feedback-btn.active.negative {
    color: #004868;
    background-color: #e6f3ff;
}

.betty-feedback-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.betty-feedback-text {
    font-size: 12px;
    color: #6c757d;
    margin-left: 8px;
}

/* Advanced Markdown Styling with Marked.js */

/* Tables */
.betty-message-content table {
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 72, 104, 0.1);
}

.betty-message-content table thead th {
    background-color: #004868;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #003654;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.betty-message-content table tbody tr {
    border-bottom: 1px solid #e8f4f8;
    transition: background-color 0.2s ease;
}

.betty-message-content table tbody tr:nth-child(even) {
    background-color: #f8fbfc;
}

.betty-message-content table tbody tr:hover {
    background-color: #e6f3ff;
}

.betty-message-content table td {
    padding: 10px 8px;
    border-right: 1px solid #e8f4f8;
    vertical-align: top;
    line-height: 1.4;
}

.betty-message-content table td:last-child,
.betty-message-content table th:last-child {
    border-right: none;
}

/* Task Lists (Checkboxes) */
.betty-message-content ul li input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #004868;
}

.betty-message-content ul li input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Code Blocks */
.betty-message-content pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 12px;
    margin: 12px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
    color: #212529;
}

.betty-message-content code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #e83e8c;
}

.betty-message-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

/* Blockquotes */
.betty-message-content blockquote {
    border-left: 4px solid #004868;
    margin: 15px 0;
    padding: 10px 0 10px 15px;
    background-color: #f8fbfc;
    font-style: italic;
    color: #5a6c7d;
}

.betty-message-content blockquote p {
    margin: 0;
}

/* Lists */
.betty-message-content ul,
.betty-message-content ol {
    padding-left: 20px;
    margin: 8px 0;
    font-size: inherit;
}

.betty-message-content li {
    margin: 2px 0;
    line-height: 1.5;
    font-size: inherit;
    color: inherit;
}

/* Strikethrough */
.betty-message-content del,
.betty-message-content strike {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Advanced paragraph spacing for marked.js output - match original message styling */
.betty-message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
    display: inline;
}

/* Only add spacing between multiple paragraphs */
.betty-message-content p + p {
    display: block;
    margin-top: 8px;
}

/* Horizontal rules */
.betty-message-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #004868, transparent);
    margin: 16px 0;
    opacity: 0.6;
}

/* Advanced header styling for marked.js */
.betty-message-content h1,
.betty-message-content h2,
.betty-message-content h3,
.betty-message-content h4,
.betty-message-content h5,
.betty-message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    color: #004868;
    line-height: 1.3;
}

.betty-message-content h1 {
    font-size: 20px;
    border-bottom: 2px solid #004868;
    padding-bottom: 4px;
}

.betty-message-content h2 {
    font-size: 18px;
    border-bottom: 1px solid #004868;
    padding-bottom: 3px;
}

.betty-message-content h3 {
    font-size: 16px;
}

.betty-message-content h4 {
    font-size: 15px;
}

.betty-message-content h5 {
    font-size: 14px;
}

.betty-message-content h6 {
    font-size: 13px;
}

/* Feedback Popup Modal */
.betty-feedback-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
}

.betty-feedback-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.betty-feedback-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 72, 104, 0.2);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    animation: bettyFadeIn 0.3s ease;
}

@keyframes bettyFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.betty-feedback-header {
    background-color: #004868;
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.betty-feedback-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.betty-feedback-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.betty-feedback-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.betty-feedback-body {
    padding: 24px;
}

.betty-feedback-body p {
    margin: 0 0 16px 0;
    font-size: 15px;
    line-height: 1.5;
    color: #4a5568;
}

.betty-feedback-input {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.betty-feedback-input:focus {
    outline: none;
    border-color: #004868;
    box-shadow: 0 0 0 3px rgba(0, 72, 104, 0.1);
}

.betty-feedback-counter {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
    color: #718096;
}

.betty-feedback-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Use site's existing button classes - override BettyBot interference */
/*.betty-feedback-footer .button {
    margin: 0;
    color: inherit !important;
    text-decoration: none !important;
    background: inherit !important;
    border: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    transition: inherit !important;
}*/

/*.betty-feedback-footer .button:hover {
    color: inherit !important;
    text-decoration: none !important;
    background: inherit !important;
    border: inherit !important;
}*/

.betty-feedback-footer .button.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .betty-feedback-modal {
        width: 95%;
        margin: 20px;
    }
    
    .betty-feedback-header {
        padding: 16px 20px;
    }
    
    .betty-feedback-header h3 {
        font-size: 16px;
    }
    
    .betty-feedback-body {
        padding: 20px;
    }
    
    .betty-feedback-footer {
        padding: 12px 20px 20px 20px;
        flex-direction: column-reverse;
    }
    
    .betty-feedback-footer .button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Conversation Mode Indicator */
.betty-conversation-mode-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

.betty-mode-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
}

.betty-conversation-mode-indicator .betty-mode-badge:contains('Member') {
    background: #e8f4f8;
    color: #003552;
    border-color: #003552;
}

.betty-conversation-mode-indicator .betty-mode-badge {
    transition: all 0.3s ease;
}

/* Member mode styling when the badge contains "Member" */
.betty-conversation-mode-indicator .betty-mode-badge {
    background: #f0f0f0;
    color: #666;
    border-color: #e0e0e0;
}

/* We'll use JavaScript to add member class since CSS :contains is not widely supported */
    .betty-conversation-mode-indicator .betty-mode-badge.member {
        background: #e8f4f8;
        color: #003552;
        border-color: #003552;
    }

/* Input Disabled Message */
.betty-input-disabled-message {
    text-align: center;
    margin: 10px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
}

.betty-input-disabled-message small {
    font-size: 12px;
    line-height: 1.3;
}

/* Disabled input styling */
.betty-bot-widget .betty-message-input:disabled {
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

.betty-bot-widget .betty-send-button:disabled {
    color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}


