#ai-chatbot-widget {
    position: fixed;
    z-index: 9999;
    bottom: 20px;
    right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.12));
}

#ai-chatbot-widget.ai-chatbot-bottom-left {
    left: 20px;
    right: auto;
}

#ai-chatbot-toggle {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(74, 144, 226, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#ai-chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

#ai-chatbot-toggle:hover::before {
    left: 100%;
}

#ai-chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(74, 144, 226, 0.35), 0 4px 16px rgba(0, 0, 0, 0.12);
}

#ai-chatbot-toggle:active {
    transform: translateY(-1px) scale(0.98);
}

#ai-chatbot-widget.ai-chatbot-shape-round #ai-chatbot-toggle {
    border-radius: 25px;
}

#ai-chatbot-widget.ai-chatbot-shape-square #ai-chatbot-toggle {
    border-radius: 0;
}

#ai-chatbot-widget.ai-chatbot-animation-pulse #ai-chatbot-toggle {
    animation: ai-chatbot-pulse 2s infinite;
}

#ai-chatbot-widget.ai-chatbot-animation-bounce #ai-chatbot-toggle {
    animation: ai-chatbot-bounce 2s infinite;
}

@keyframes ai-chatbot-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes ai-chatbot-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#ai-chatbot-toggle .ai-chatbot-close {
    display: none;
}

#ai-chatbot-container {
    display: none;
    width: 400px;
    height: 600px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 
        0 32px 80px rgba(0, 0, 0, 0.12),
        0 16px 40px rgba(0, 0, 0, 0.08),
        0 8px 20px rgba(0, 0, 0, 0.04);
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(40px);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

#ai-chatbot-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#ai-chatbot-container.open {
    display: flex;
}

#ai-chatbot-header {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#ai-chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="0.8" fill="white" opacity="0.06"/><circle cx="75" cy="75" r="0.8" fill="white" opacity="0.06"/><circle cx="50" cy="10" r="0.4" fill="white" opacity="0.06"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

#ai-chatbot-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

#ai-chatbot-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.8px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

#ai-chatbot-header h3::before {
    content: '🤖';
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#ai-chatbot-minimize {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

#ai-chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#ai-chatbot-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    background: 
        linear-gradient(to bottom, rgba(248, 250, 252, 0.6) 0%, rgba(255, 255, 255, 0.9) 100%),
        radial-gradient(circle at 10% 20%, rgba(74, 144, 226, 0.02) 0%, transparent 50%);
    position: relative;
}

#ai-chatbot-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.8), transparent);
    pointer-events: none;
    z-index: 1;
}

#ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.3);
    border-radius: 3px;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 226, 0.5);
}

.ai-chatbot-message {
    margin-bottom: 20px;
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 14px;
    position: relative;
    animation: messageSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    word-wrap: break-word;
    backdrop-filter: blur(10px);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chatbot-user-message {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 8px;
    box-shadow: 
        0 4px 16px rgba(74, 144, 226, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.ai-chatbot-user-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.ai-chatbot-bot-message {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    backdrop-filter: blur(20px);
}

.ai-chatbot-bot-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

#ai-chatbot-form {
    display: flex;
    padding: 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.4);
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    backdrop-filter: blur(30px);
    gap: 16px;
    position: relative;
}

#ai-chatbot-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

#ai-chatbot-input {
    flex-grow: 1;
    padding: 14px 20px;
    border: 2px solid rgba(226, 232, 240, 0.6);
    border-radius: 28px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    backdrop-filter: blur(20px);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.02),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

#ai-chatbot-input:focus {
    border-color: var(--primary-color, #4a90e2);
    box-shadow: 
        0 0 0 4px rgba(74, 144, 226, 0.12),
        inset 0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 12px rgba(74, 144, 226, 0.08);
    background: white;
    transform: translateY(-1px);
}

#ai-chatbot-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

#ai-chatbot-form button {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(74, 144, 226, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

#ai-chatbot-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#ai-chatbot-form button:hover::before {
    opacity: 1;
}

#ai-chatbot-form button:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(74, 144, 226, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.12);
}

#ai-chatbot-form button:active {
    transform: scale(0.96) translateY(0);
}

#ai-chatbot-form button svg {
    width: 20px;
    height: 20px;
}

#ai-chatbot-end-chat {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 0;
}

#ai-chatbot-end-chat:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
}

#ai-chatbot-end-chat:active {
    transform: translateY(0);
}


/* Mobile Responsive Design */
@media (max-width: 768px) {
    #ai-chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    
    #ai-chatbot-widget.ai-chatbot-bottom-left {
        left: 15px;
        right: auto;
    }
    
    #ai-chatbot-container {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        max-width: 350px;
        max-height: 600px;
    }
    
    #ai-chatbot-toggle {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    #ai-chatbot-messages {
        padding: 15px;
    }
    
    .ai-chatbot-message {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    #ai-chatbot-form {
        padding: 15px;
        gap: 10px;
    }
    
    #ai-chatbot-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    #ai-chatbot-form button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    #ai-chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        bottom: 10px;
        right: 10px;
        position: fixed;
    }
    
    #ai-chatbot-widget.ai-chatbot-bottom-left #ai-chatbot-container {
        left: 10px;
        right: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #ai-chatbot-container {
        background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
        border: 1px solid rgba(71, 85, 105, 0.3);
    }
    
    #ai-chatbot-messages {
        background: linear-gradient(to bottom, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.8) 100%);
    }
    
    .ai-chatbot-bot-message {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        color: #e5e7eb;
        border: 1px solid rgba(75, 85, 99, 0.8);
    }
    
    .ai-chatbot-typing {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        border: 1px solid rgba(75, 85, 99, 0.8);
    }
    
    .ai-chatbot-typing span {
        background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    }
    
    #ai-chatbot-form {
        background: rgba(30, 41, 59, 0.8);
        border-top: 1px solid rgba(71, 85, 105, 0.6);
    }
    
    #ai-chatbot-input {
        background: rgba(51, 65, 85, 0.9);
        border: 2px solid rgba(71, 85, 105, 0.8);
        color: #e5e7eb;
    }
    
    #ai-chatbot-input:focus {
        background: #334155;
        border-color: var(--primary-color, #4a90e2);
    }
    
    #ai-chatbot-input::placeholder {
        color: #9ca3af;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    #ai-chatbot-toggle {
        border: 2px solid white;
    }
    
    .ai-chatbot-message {
        border: 1px solid currentColor;
    }
    
    #ai-chatbot-input {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #ai-chatbot-toggle,
    #ai-chatbot-container,
    .ai-chatbot-message,
    #ai-chatbot-form button,
    #ai-chatbot-minimize,
    #ai-chatbot-end-chat {
        animation: none;
        transition: none;
    }
    
    #ai-chatbot-toggle:hover,
    #ai-chatbot-form button:hover,
    #ai-chatbot-minimize:hover,
    #ai-chatbot-end-chat:hover {
        transform: none;
    }
    
    .ai-chatbot-typing span {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
#ai-chatbot-toggle:focus,
#ai-chatbot-minimize:focus,
#ai-chatbot-form button:focus,
#ai-chatbot-end-chat:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

#ai-chatbot-input:focus {
    outline: none; /* Already handled by border and box-shadow */
}

/* Loading State */
.ai-chatbot-loading {
    pointer-events: none;
    opacity: 0.7;
}

.ai-chatbot-loading #ai-chatbot-form button {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Error State */
.ai-chatbot-error .ai-chatbot-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Success State */
.ai-chatbot-success .ai-chatbot-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border: 1px solid #86efac;
}

/* Enhanced Message Styles */
.ai-chatbot-message .message-content {
    margin-bottom: 4px;
}

.ai-chatbot-message .message-time {
    font-size: 11px;
    opacity: 0.6;
    text-align: right;
    margin-top: 4px;
}

.ai-chatbot-message code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.ai-chatbot-message a {
    color: inherit;
    text-decoration: underline;
}

.ai-chatbot-message a:hover {
    text-decoration: none;
}

/* Enhanced Typing Indicator with Realistic Animation */
.ai-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-radius: 20px;
    border-bottom-left-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(20px);
    animation: typingSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.ai-chatbot-typing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

@keyframes typingSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.typing-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: avatarPulse 2s infinite ease-in-out;
}

@keyframes avatarPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    }
}

.avatar-initial {
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.typing-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.typing-text {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    letter-spacing: 0.2px;
    animation: textFade 3s infinite ease-in-out;
}

@keyframes textFade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border-radius: 50%;
    animation: enhancedTypingDots 1.6s infinite ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typing-dots span:nth-child(1) { 
    animation-delay: 0s; 
}
.typing-dots span:nth-child(2) { 
    animation-delay: 0.3s; 
}
.typing-dots span:nth-child(3) { 
    animation-delay: 0.6s; 
}

@keyframes enhancedTypingDots {
    0%, 60%, 100% {
        transform: scale(0.7) translateY(0);
        opacity: 0.4;
        background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    }
    30% {
        transform: scale(1.2) translateY(-4px);
        opacity: 1;
        background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    }
}

/* Enhanced typing indicator for dark mode */
@media (prefers-color-scheme: dark) {
    .ai-chatbot-typing {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        border: 1px solid rgba(75, 85, 99, 0.8);
    }
    
    .typing-text {
        color: #d1d5db;
    }
    
    .typing-dots span {
        background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    }
    
    @keyframes enhancedTypingDots {
        0%, 60%, 100% {
            transform: scale(0.7) translateY(0);
            opacity: 0.4;
            background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
        }
        30% {
            transform: scale(1.2) translateY(-4px);
            opacity: 1;
            background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
        }
    }
}

/* Feedback Buttons */
.feedback-buttons {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.feedback-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #475569;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.feedback-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feedback-btn.positive:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #86efac;
    color: #166534;
}

.feedback-btn.negative:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    color: #991b1b;
}

/* Settings Button */
.chatbot-settings-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.chatbot-settings-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Settings Panel */
.chatbot-settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 10000;
    min-width: 280px;
    backdrop-filter: blur(20px);
}

.chatbot-settings-panel h4 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-settings-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.chatbot-settings-panel input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.chatbot-settings-panel button {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #475569;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
    margin-bottom: 8px;
}

.chatbot-settings-panel button:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
}

.clear-history-btn:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    color: #991b1b;
}

.close-settings-btn {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    border: none;
}

.close-settings-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #2563eb 100%);
}

/* Admin Notification Styles */
.ai-chatbot-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chatbot-notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-chatbot-notification.success .notification-icon {
    background: #10b981;
}

.ai-chatbot-notification.error .notification-icon {
    background: #ef4444;
}

.ai-chatbot-notification.info .notification-icon {
    background: #3b82f6;
}

.notification-message {
    flex-grow: 1;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

/* Preview Widget Styles */
.chatbot-preview-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chatbot-preview-widget.expanded {
    width: 300px;
    height: 400px;
}

.preview-toggle {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.preview-container {
    padding: 12px;
    display: none;
}

.chatbot-preview-widget.expanded .preview-container {
    display: block;
}

.preview-header h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #1e293b;
}

.preview-message {
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.preview-message.user {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2) 0%, #357abd 100%);
    color: white;
    margin-left: auto;
    max-width: 80%;
}

.preview-message.bot {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #334155;
    max-width: 80%;
}

/* Tooltip Styles */
.ai-chatbot-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10002;
    pointer-events: none;
}

.ai-chatbot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* Character Counter */
.char-counter {
    font-size: 12px;
    color: #64748b;
    text-align: right;
    margin-top: 4px;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter .current {
    font-weight: 600;
}

/* Field Error State */
.field-error {
    position: relative;
}

.field-error input,
.field-error textarea,
.field-error select {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-error::after {
    content: 'Dieses Feld ist erforderlich';
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 12px;
    color: #ef4444;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Print styles */
@media print {
    #ai-chatbot-widget,
    .ai-chatbot-notification,
    .chatbot-settings-panel,
    .chatbot-preview-widget {
        display: none !important;
    }
}
