/* Animated loading avatar - sequential dots pattern */
.loading-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 20px;
    color: var(--chatbot-primary, #1a3a5c);
    font-weight: bold;
    letter-spacing: 3px;
    min-width: 50px;
    font-family: monospace;
}
/**
 * Tax Chatbot AI - Enhanced Styles
 * 
 * Theme: Dark Navy Blue (matching kmjohnsoncpa.com)
 * Features: Fixed positioning, proper z-index, mobile responsive
 */

/* CSS Variables - Matching kmjohnsoncpa.com Professional Palette */
:root {
    --chatbot-primary: #1a3a5c; /* Dark navy blue matching website */
    --chatbot-primary-dark: #0f2538; /* Darker shade for gradients */
    --chatbot-primary-light: #2a4a6c; /* Lighter shade for hover */
    --chatbot-secondary: #10b981;
    --chatbot-accent: #2563eb;
    --chatbot-text: #1f2937;
    --chatbot-text-light: #6b7280;
    --chatbot-bg: #ffffff;
    --chatbot-bg-light: #f8f9fa;
    --chatbot-border: #e5e7eb;
    --chatbot-shadow: rgba(26, 58, 92, 0.15);
    --chatbot-shadow-md: rgba(26, 58, 92, 0.2);
    --chatbot-shadow-lg: rgba(26, 58, 92, 0.3);
    --chatbot-success: #10b981;
    --chatbot-error: #ef4444;
}

/* Reset and base styles for widget container */
#tax-chatbot-widget,
#tax-chatbot-widget * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Main Widget Container - FIXED positioning */
#tax-chatbot-widget {
    position: fixed !important;
    z-index: 2147483647 !important;
    /* border: 2px solid red !important; */
    font-size: 14px;
    line-height: 1.5;
}

/* Position variants */
#tax-chatbot-widget.position-bottom-right {
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
}

#tax-chatbot-widget.position-bottom-left {
    bottom: 20px !important;
    left: 20px !important;
    right: auto !important;
    top: auto !important;
}

/* Toggle Button - Enhanced to match website */
#tax-chatbot-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(26, 58, 92, 0.35), 0 0 0 0 rgba(26, 58, 92, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: togglePulse 2s ease-in-out infinite;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1000000 !important;
}

#tax-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(26, 58, 92, 0.45), 0 0 0 4px rgba(26, 58, 92, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

#tax-chatbot-toggle.active {
    transform: rotate(90deg) scale(0.9);
}

#tax-chatbot-toggle svg {
    width: 30px;
    height: 30px;
    fill: white;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Pulse animation for attention */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

#tax-chatbot-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chatbot-primary);
    animation: pulse-ring 2s ease-out infinite;
    z-index: -1;
}

#tax-chatbot-toggle.active::before {
    animation: none;
}

/* Chat Window - Enhanced shadow and border - Increased size for better viewing */
#tax-chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 480px; /* Increased from 390px for better readability */
    height: 680px; /* Increased from 540px for more content visibility */
    max-height: calc(100vh - 120px);
    background: var(--chatbot-bg);
    border-radius: 18px;
    box-shadow: 0 12px 48px rgba(26, 58, 92, 0.3), 0 0 0 1px rgba(26, 58, 92, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999998 !important;
    border: 1px solid rgba(26, 58, 92, 0.08);
}

/* Position window based on parent */
.position-bottom-right #tax-chatbot-window {
    right: 0;
    left: auto;
}

.position-bottom-left #tax-chatbot-window {
    left: 0;
    right: auto;
}

#tax-chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: windowSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes windowSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Chat Header - Matching kmjohnsoncpa.com dark blue theme */
.chatbot-header {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    color: #ffffff !important;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* Ensure header avatar logo shows full color without any dull effects */
.chatbot-header .chatbot-avatar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.chatbot-header .chatbot-avatar img {
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    background: transparent !important;
    object-fit: contain !important;
    mix-blend-mode: normal !important;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    background: transparent !important; /* Remove semi-transparent background that causes dull effect */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important; /* Remove border that might cause dull effect */
    box-shadow: none !important; /* Remove shadow that might cause dull effect */
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain !important; /* Use contain instead of cover to preserve logo colors */
    border-radius: 50%;
    filter: none !important;
    transition: none !important;
    opacity: 1 !important;
    background: transparent !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
    -o-filter: none !important;
}

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.chatbot-header-text {
    flex: 1;
    min-width: 0;
}

.chatbot-header-text h4 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.3;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chatbot-header-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9) !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.chatbot-header-text .status-dot {
    width: 9px;
    height: 9px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 
        0 0 0 2px rgba(16, 185, 129, 0.2),
        0 0 8px rgba(16, 185, 129, 0.4);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 2px rgba(16, 185, 129, 0.2),
            0 0 8px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 
            0 0 0 3px rgba(16, 185, 129, 0.3),
            0 0 12px rgba(16, 185, 129, 0.6);
    }
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-header-actions button {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-header-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.chatbot-header-actions button svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Messages Container - Enhanced with subtle pattern */
#tax-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    min-height: 0; /* Important for flex scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Subtle background pattern */
#tax-chatbot-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(26, 58, 92, 0.03) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.5;
}

/* Scrollbar styling - Enhanced */
#tax-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#tax-chatbot-messages::-webkit-scrollbar-track {
    background: rgba(26, 58, 92, 0.05);
    border-radius: 10px;
    margin: 8px 0;
}

#tax-chatbot-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, rgba(26, 58, 92, 0.3), rgba(26, 58, 92, 0.2));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

#tax-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, rgba(26, 58, 92, 0.5), rgba(26, 58, 92, 0.4));
    background-clip: padding-box;
}

/* Message Styles */
.chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

/* Modern entrance animation for messages - Enhanced */
.message-enter {
    opacity: 0;
    transform: translateY(20px) scale(0.92) rotate(0.5deg);
    filter: blur(2px);
}

.message-enter-active {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: blur(0);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger animation for multiple messages */
.chatbot-message:nth-child(1) { animation-delay: 0.05s; }
.chatbot-message:nth-child(2) { animation-delay: 0.1s; }
.chatbot-message:nth-child(3) { animation-delay: 0.15s; }
.chatbot-message:nth-child(4) { animation-delay: 0.2s; }
.chatbot-message:nth-child(5) { animation-delay: 0.25s; }

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message.bot {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    /* Idle animation - always active to attract attention */
    animation: avatar-idle-breathe 3s ease-in-out infinite;
}

.message-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
    /* Gentle icon movement for idle state */
    animation: icon-idle-float 2.5s ease-in-out infinite;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Idle breathing animation - subtle and elegant */
@keyframes avatar-idle-breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
    }
}

/* Idle icon floating animation */
@keyframes icon-idle-float {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.05);
    }
}

/* Thinking/Streaming Animation */
@keyframes avatar-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(26, 58, 92, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(26, 58, 92, 0);
    }
}

@keyframes avatar-glow {
    0%, 100% {
        background: var(--chatbot-primary);
        box-shadow: 0 0 0 0 rgba(26, 58, 92, 0.4);
    }
    50% {
        background: var(--chatbot-primary-light);
        box-shadow: 0 0 15px rgba(42, 90, 140, 0.6);
    }
}

@keyframes icon-breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

.message-avatar.streaming {
    /* Override idle animation with stronger streaming animation */
    animation: avatar-pulse 1.5s ease-in-out infinite, avatar-glow 2s ease-in-out infinite !important;
    position: relative;
}

.message-avatar.streaming svg {
    /* Override idle float with streaming breathe */
    animation: icon-breathe 1.2s ease-in-out infinite !important;
    opacity: 0.3; /* Fade out the icon when showing dots */
}

/* Animated dots overlay on avatar during streaming */
.message-avatar.streaming::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 2px;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Create three dots using pseudo-elements */
.message-avatar.streaming::before {
    content: '⋯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    animation: dots-fade 1.4s ease-in-out infinite;
}

@keyframes dots-fade {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    position: relative;
    backdrop-filter: blur(10px);
}

.chatbot-message.bot .message-bubble {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    color: var(--chatbot-text);
    border-bottom-left-radius: 6px;
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(26, 58, 92, 0.06);
}

.chatbot-message.user .message-bubble {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 
        0 4px 16px rgba(26, 58, 92, 0.25),
        0 2px 6px rgba(26, 58, 92, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 14.5px;
    letter-spacing: 0.01em;
}

.message-content strong {
    font-weight: 700;
    color: inherit;
}

.message-content .bullet {
    color: var(--chatbot-primary);
    margin-right: 6px;
    font-weight: 600;
}

.message-content p {
    margin: 0.5em 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, .message-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.message-content li {
    margin: 0.3em 0;
}

/* Links in messages */
.message-content a.chatbot-link {
    display: inline-block;
    color: var(--chatbot-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    margin: 4px 4px 4px 0;
    background: linear-gradient(135deg, rgba(26, 58, 92, 0.08) 0%, rgba(42, 90, 140, 0.12) 100%);
    border: 1px solid rgba(26, 58, 92, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.message-content a.chatbot-link:hover {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: white;
    border-color: var(--chatbot-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(26, 58, 92, 0.25);
}

.message-content a.chatbot-link::after {
    content: '→';
    margin-left: 6px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.message-content a.chatbot-link:hover::after {
    transform: translateX(3px);
}

/* User message links (white style) */
.chatbot-message.user .message-content a.chatbot-link {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.chatbot-message.user .message-content a.chatbot-link:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Typing Indicator - Enhanced */
.typing-indicator .message-bubble {
    padding: 18px 22px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(26, 58, 92, 0.06);
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 9px;
    height: 9px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
    opacity: 0.7;
    box-shadow: 0 2px 4px rgba(26, 58, 92, 0.2);
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Streaming placeholder to avoid empty bot bubble before streaming starts */
.streaming-placeholder {
    width: 60%;
    height: 12px;
    background: rgba(26, 58, 92, 0.06);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    animation: placeholderPulse 1.6s ease-in-out infinite;
}

@keyframes placeholderPulse {
    0% { opacity: 0.8; transform: translateY(0); }
    50% { opacity: 0.4; transform: translateY(-2px); }
    100% { opacity: 0.8; transform: translateY(0); }
}

/* Quick Actions */
.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-quick-btn {
    background: white;
    border: 1.5px solid var(--chatbot-border);
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--chatbot-text);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chatbot-quick-btn:hover {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    color: white;
    border-color: #1a3a5c;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(26, 58, 92, 0.25);
}

/* Action Buttons */
.chatbot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-action-btn {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(26, 58, 92, 0.2);
}

.chatbot-action-btn:hover {
    background: linear-gradient(135deg, #0f2538 0%, #1a3a5c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.3);
}

/* Appointment Type Selector */
.appointment-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    animation: messageSlide 0.3s ease-out;
}

.appointment-type-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
    border: 2px solid var(--chatbot-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.appointment-type-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #1a3a5c, #2a4a6c);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.appointment-type-option:hover {
    border-color: #1a3a5c;
    background: linear-gradient(to bottom, rgba(26, 58, 92, 0.04) 0%, rgba(26, 58, 92, 0.02) 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.12);
}

.appointment-type-option:hover::before {
    transform: scaleY(1);
}

.appointment-type-option.selected {
    border-color: #1a3a5c;
    background: linear-gradient(to bottom, rgba(26, 58, 92, 0.1) 0%, rgba(26, 58, 92, 0.05) 100%);
    box-shadow: 0 4px 16px rgba(26, 58, 92, 0.2);
    transform: translateX(0);
}

.appointment-type-option.selected::before {
    transform: scaleY(1);
}

.appointment-type-option .option-icon {
    font-size: 26px;
    width: 44px;
    text-align: center;
    transition: transform 0.3s ease;
}

.appointment-type-option:hover .option-icon {
    transform: scale(1.1) rotate(5deg);
}

.appointment-type-option .option-content {
    flex: 1;
}

.appointment-type-option .option-title {
    font-weight: 700;
    color: #1a3a5c;
    font-size: 15.5px;
    margin-bottom: 3px;
    letter-spacing: -0.2px;
}

.appointment-type-option.selected .option-title {
    color: #1a3a5c;
}

.appointment-type-option .option-desc {
    font-size: 12.5px;
    color: var(--chatbot-text-light);
    margin-top: 2px;
    line-height: 1.4;
}

/* Booking Form */
.chatbot-booking-form {
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
    margin-bottom: 8px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(26, 58, 92, 0.08);
    animation: messageSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible; /* Changed from hidden to visible so form isn't cut off */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chatbot-booking-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a3a5c 0%, #2a4a6c 50%, #1a3a5c 100%);
}

.chatbot-booking-form .form-row {
    display: flex;
    gap: 12px;
}

.chatbot-booking-form .form-group {
    margin-bottom: 14px;
    flex: 1;
}

.chatbot-booking-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.chatbot-booking-form label::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.7;
}

.chatbot-booking-form input,
.chatbot-booking-form textarea,
.chatbot-booking-form select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--chatbot-border);
    border-radius: 10px;
    font-size: 14.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background: #ffffff;
    color: var(--chatbot-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chatbot-booking-form input:hover,
.chatbot-booking-form textarea:hover,
.chatbot-booking-form select:hover {
    border-color: rgba(26, 58, 92, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.chatbot-booking-form select {
    cursor: pointer;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23333' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    appearance: none;
}

.chatbot-booking-form input:focus,
.chatbot-booking-form textarea:focus,
.chatbot-booking-form select:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 
        0 0 0 4px rgba(26, 58, 92, 0.1),
        0 2px 8px rgba(26, 58, 92, 0.15);
    transform: translateY(-1px);
    background: #ffffff;
}

/* Form validation errors */
.chatbot-booking-form input.error,
.chatbot-booking-form textarea.error,
.chatbot-booking-form select.error {
    border-color: var(--chatbot-error);
    background: rgba(220, 53, 69, 0.05);
}

.chatbot-booking-form .field-error {
    display: block;
    color: var(--chatbot-error);
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    font-weight: 500;
}

.chatbot-booking-form input.error:focus,
.chatbot-booking-form textarea.error:focus {
    border-color: var(--chatbot-error);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.chatbot-booking-form .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.chatbot-booking-form .btn-book {
    flex: 1;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.25);
}

.chatbot-booking-form .btn-book:hover {
    background: linear-gradient(135deg, #0f2538 0%, #1a3a5c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.35);
}

.chatbot-booking-form .btn-book:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-booking-form .btn-cancel {
    background: transparent;
    color: var(--chatbot-text-light);
    border: 1px solid var(--chatbot-border);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-booking-form .btn-cancel:hover {
    background: var(--chatbot-bg-light);
}

/* Read-only field styling */
.chatbot-booking-form .readonly-field {
    background: linear-gradient(to bottom, #f8f9fa 0%, #f0f1f2 100%) !important;
    cursor: not-allowed !important;
    color: #1a3a5c !important;
    font-weight: 600 !important;
    border: 2px solid rgba(26, 58, 92, 0.15) !important;
    opacity: 1 !important;
}

.chatbot-booking-form .readonly-field:focus {
    border-color: rgba(26, 58, 92, 0.2) !important;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.05) !important;
    transform: none !important;
}

/* Input Area - Enhanced */
.chatbot-input-area {
    padding: 16px 18px;
    background: linear-gradient(to top, #ffffff 0%, #fafbfc 100%);
    border-top: 1px solid rgba(26, 58, 92, 0.08);
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

#tax-chatbot-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#tax-chatbot-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--chatbot-border);
    border-radius: 26px;
    font-size: 14.5px;
    resize: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 120px;
    line-height: 1.5;
    background: #ffffff;
    color: var(--chatbot-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#tax-chatbot-input:focus {
    border-color: #1a3a5c;
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(26, 58, 92, 0.1),
        0 2px 8px rgba(26, 58, 92, 0.15);
    transform: translateY(-1px);
    background: #ffffff;
}

#tax-chatbot-input::placeholder {
    color: #9ca3af;
    transition: color 0.3s;
}

#tax-chatbot-input:focus::placeholder {
    color: #cbd5e1;
}

#tax-chatbot-input::placeholder {
    color: #999;
    transition: color 0.3s;
}

#tax-chatbot-input:focus::placeholder {
    color: #bbb;
}

#tax-chatbot-send {
    width: 46px;
    height: 46px;
    min-width: 46px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.25);
}

#tax-chatbot-send:hover {
    background: linear-gradient(135deg, #0f2538 0%, #1a3a5c 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(26, 58, 92, 0.4);
}

#tax-chatbot-send:active {
    transform: scale(0.95);
}

#tax-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#tax-chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
    margin-left: 2px;
}

/* Powered By - Enhanced with Credits */
.chatbot-powered-by {
    text-align: center;
    padding: 12px 10px;
    font-size: 10px;
    color: var(--chatbot-text-light);
    background: linear-gradient(to top, #f8f9fa 0%, #ffffff 100%);
    border-top: 1px solid rgba(26, 58, 92, 0.06);
    line-height: 1.6;
}

.powered-by-line {
    font-size: 10.5px;
    color: var(--chatbot-text-light);
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}

.powered-by-line strong {
    color: #1a3a5c;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.powered-by-subtitle {
    font-size: 9.5px;
    color: #9ca3af;
    margin-bottom: 4px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.powered-by-brand {
    font-size: 9px;
    color: var(--chatbot-text-light);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(26, 58, 92, 0.08);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.powered-by-brand strong {
    color: #1a3a5c;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #tax-chatbot-widget.position-bottom-right,
    #tax-chatbot-widget.position-bottom-left {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
    }

    #tax-chatbot-toggle {
        width: 54px;
        height: 54px;
    }

    #tax-chatbot-window {
        position: fixed;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: calc(100vh - 60px);
        max-height: none;
        border-radius: 20px 20px 0 0;
    }

    .position-bottom-right #tax-chatbot-window,
    .position-bottom-left #tax-chatbot-window {
        right: 0 !important;
        left: 0 !important;
    }

    .chatbot-booking-form .form-row {
        flex-direction: column;
    }

    .chatbot-quick-actions {
        flex-direction: column;
    }

    .chatbot-quick-btn {
        text-align: center;
    }
}

/* High contrast mode / Accessibility */
@media (prefers-contrast: high) {
    .chatbot-message.bot .message-bubble {
        border: 2px solid var(--chatbot-text);
    }

    .chatbot-message.user .message-bubble {
        border: 2px solid white;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print - hide chatbot */
@media print {
    #tax-chatbot-widget {
        display: none !important;
    }
}

/* ========================================
   Auto-trigger Notification Bubble
   ======================================== */
.chatbot-notification {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 280px;
    background: var(--chatbot-bg);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(26, 58, 92, 0.25);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999998 !important;
    overflow: hidden;
}

/* Position for bottom-left */
.position-bottom-left .chatbot-notification {
    right: auto;
    left: 0;
}

.chatbot-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Notification header bar */
.chatbot-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
}

.notification-content {
    padding: 20px 16px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-content:hover {
    background: var(--chatbot-bg-light);
}

/* Avatar in notification */
.notification-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-avatar svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Notification text */
.notification-text {
    flex: 1;
    padding-right: 20px;
}

.notification-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--chatbot-primary);
    margin-bottom: 4px;
}

.notification-text p {
    margin: 0;
    font-size: 13px;
    color: var(--chatbot-text);
    line-height: 1.4;
}

/* Close button */
.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chatbot-text-light);
    font-size: 18px;
    font-weight: 300;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
}

.notification-close:hover {
    background: var(--chatbot-border);
    color: var(--chatbot-text);
}

/* Bounce animation for notification */
@keyframes notification-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.chatbot-notification.show {
    animation: notification-bounce 0.6s ease 0.3s;
}

/* Pulse animation for toggle button */
@keyframes togglePulse {
    0%, 100% {
        box-shadow: 0 4px 20px var(--chatbot-shadow);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 25px rgba(26, 58, 92, 0.4), 0 0 0 8px rgba(26, 58, 92, 0.1);
        transform: scale(1.02);
    }
}

/* Mobile responsive notification */
@media (max-width: 480px) {
    .chatbot-notification {
        width: calc(100vw - 40px);
        max-width: 300px;
        right: 10px;
    }

    .position-bottom-left .chatbot-notification {
        left: 10px;
        right: auto;
    }
}
