/* Modern Enhanced Chatbot Widget CSS - Design Only */
/* Complete styling for the modern chatbot widget with enhanced design */

/* CSS Custom Properties for theming */
:root {
    --chatbot-primary: #4B0082;
    --chatbot-secondary: #764ba2;
    --chatbot-accent: #4B0082;
    --chatbot-success: #00f2fe;
    --chatbot-warning: #ff9a56;
    --chatbot-error: #ff6b6b;
    --chatbot-light: #f8f9fa;
    --chatbot-dark: #2d3748;
    --chatbot-text: #333;
    --chatbot-text-light: #666;
    --chatbot-border: rgba(102, 126, 234, 0.2);
    --chatbot-shadow: 0 8px 25px #4B0082;
    --chatbot-shadow-hover: 0 12px 35px #4B0082;
    --chatbot-radius: 20px;
    --chatbot-radius-small: 12px;
    --chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --chatbot-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark theme variables */
@media (prefers-color-scheme: dark) {
    :root {
        --chatbot-light: #2d3748;
        --chatbot-dark: #1a202c;
        --chatbot-text: #e2e8f0;
        --chatbot-text-light: #a0aec0;
        --chatbot-border: rgba(255, 255, 255, 0.2);
    }
}

/* Base chatbot widget styles */
.modern-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: var(--chatbot-font);
    direction: rtl;
    --widget-size: 50px;
}

/* Enhanced 3D toggle button - matching IconScout style */
.modern-chatbot-toggle {
    width: var(--widget-size);
    height: var(--widget-size);
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(255, 255, 255, 0.2),
        inset 0 -1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    position: relative;
    transform: perspective(300px) rotateX(0deg);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Ripple effect */
.modern-chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modern-chatbot-toggle:active::before {
    width: 100%;
    height: 100%;
}

/* Notification badge */
.modern-chatbot-toggle::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: var(--chatbot-error);
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0);
    transition: var(--chatbot-transition);
}

.modern-chatbot-toggle.has-notification::after {
    opacity: 1;
    transform: scale(1);
    animation: notificationPulse 1.5s infinite;
}

.modern-chatbot-toggle:hover {
    transform: perspective(300px) rotateX(-8deg) rotateY(2deg) translateY(-8px) scale(1.08);
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.4);
    background: linear-gradient(145deg, #3498db, #2980b9);
    border-color: rgba(255, 255, 255, 0.2);
}

.modern-chatbot-toggle:active {
    transform: perspective(200px) rotateX(2deg) translateY(-2px) scale(0.98);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

/* Enhanced 3D Image styling - matching IconScout robot */
.modern-chatbot-toggle img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(1.2) contrast(1.1) saturate(1.1); /* Enhanced colors like IconScout */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: perspective(150px) rotateY(0deg) rotateX(0deg);
    filter: brightness(1.2) contrast(1.1) saturate(1.1) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
    animation: logoFloat 4s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) perspective(150px) rotateY(0deg) rotateX(0deg);
}

/* Robot icon switching */
.modern-chatbot-toggle .robot-icon-hover {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modern-chatbot-toggle .robot-icon-default {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Angry robot styling when conversation is open */
.modern-chatbot-toggle .robot-icon-hover {
    filter: brightness(1.4) contrast(1.2) saturate(1.3) drop-shadow(0 8px 16px rgba(255, 0, 0, 0.3)) drop-shadow(0 4px 8px rgba(255, 0, 0, 0.2));
}

/* Conversation Robot Styling */
.conversation-robot {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px;
    margin: 0 0 20px 0;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 20px;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(255, 255, 255, 0.2),
        inset 0 -1px 3px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transform: perspective(300px) rotateX(0deg);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: perspective(300px) rotateX(-8deg) translateY(15px) scale(0.9);
    position: relative;
    z-index: 10;
}

.conversation-robot.robot-visible {
    opacity: 1;
    transform: perspective(300px) rotateX(0deg) translateY(0px) scale(1);
}

.conversation-robot-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(1.4) contrast(1.2) saturate(1.3) drop-shadow(0 8px 16px rgba(255, 0, 0, 0.3)) drop-shadow(0 4px 8px rgba(255, 0, 0, 0.2));
    animation: logoFloatSubtle 6s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversation-robot:hover .conversation-robot-img {
    filter: brightness(1.6) contrast(1.3) saturate(1.4) drop-shadow(0 10px 20px rgba(255, 0, 0, 0.5)) drop-shadow(0 5px 10px rgba(255, 0, 0, 0.3));
    animation: logoFloatSubtle 3s ease-in-out infinite;
    transform: scale(1.05);
}

.conversation-robot-welcome {
    flex: 1;
}

.robot-welcome-text h4 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.robot-welcome-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modern-chatbot-toggle:hover img {
    transform: translate(-50%, -50%) perspective(150px) rotateY(5deg) rotateX(-3deg) scale(1.08);
    filter: brightness(1.4) contrast(1.2) saturate(1.2) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7)) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

.modern-chatbot-toggle:active img {
    transform: perspective(100px) rotateY(0deg) rotateX(0deg) scale(0.95);
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Enhanced chatbot window */
.modern-chatbot-window {
    position: absolute;
    bottom: calc(var(--widget-size) + 20px);
    right: 0;
    width: 350px;
    height: 500px;
    background: linear-gradient(145deg, #ffffff 0%, var(--chatbot-light) 100%);
    border-radius: var(--chatbot-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--chatbot-border);
    backdrop-filter: blur(20px);
    transform-origin: bottom right;
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-chatbot-window.open {
    display: flex;
    animation: windowOpen 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-chatbot-window.minimized {
    height: 60px;
    animation: windowMinimize 0.3s ease-out;
}

.modern-chatbot-window.minimized .modern-chatbot-messages,
.modern-chatbot-window.minimized .modern-chatbot-input {
    display: none;
}

/* Enhanced header with gradient and animations */
.modern-chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--chatbot-radius) var(--chatbot-radius) 0 0;
    position: relative;
    overflow: hidden;
}

/* Animated background pattern */
.modern-chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: headerShine 3s infinite;
}

.modern-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Enhanced control buttons */
.modern-chatbot-controls {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.modern-chatbot-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    font-size: 12px;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-controls button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.modern-chatbot-controls button:hover::before {
    width: 100%;
    height: 100%;
}

.modern-chatbot-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Enhanced messages container */
.modern-chatbot-messages {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    background: linear-gradient(145deg, var(--chatbot-light) 0%, #ffffff 100%);
    scroll-behavior: smooth;
    position: relative;
}

/* Custom scrollbar */
.modern-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.modern-chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.modern-chatbot-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border-radius: 10px;
    transition: var(--chatbot-transition);
}

.modern-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--chatbot-secondary), var(--chatbot-primary));
}



/* Enhanced message styles */
.modern-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--chatbot-transition);
}

.modern-chatbot-message.user {
    justify-content: flex-end;
}

.modern-chatbot-message.bot {
    justify-content: flex-start;
}

.modern-chatbot-message:hover {
    transform: translateX(5px);
}

.modern-chatbot-message.user:hover {
    transform: translateX(-5px);
}

.modern-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    transition: var(--chatbot-transition);
}

/* User message styling */
.modern-chatbot-message.user .modern-message-content {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Bot message styling */
.modern-chatbot-message.bot .modern-message-content {
    background: linear-gradient(145deg, #ffffff 0%, #f1f3f4 100%);
    color: var(--chatbot-text);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Navigation message styling */
.modern-chatbot-message.bot .modern-message-content.navigation {
    background: linear-gradient(135deg, var(--chatbot-accent) 0%, var(--chatbot-success) 100%);
    color: white;
    border: none;
    animation: navigationGlow 2s infinite alternate;
}

/* Enhanced input area */
.modern-chatbot-input {
    padding: 15px 20px;
    background: linear-gradient(145deg, #ffffff 0%, var(--chatbot-light) 100%);
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 10px;
    border-radius: 0 0 var(--chatbot-radius) var(--chatbot-radius);
    position: relative;
}

/* Enhanced input field */
.modern-chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--chatbot-border);
    border-radius: 20px;
    font-size: 13px;
    background: white;
    color: var(--chatbot-text);
    transition: var(--chatbot-transition);
    direction: rtl;
    outline: none;
    position: relative;
}

.modern-chatbot-input input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.modern-chatbot-input input::placeholder {
    color: var(--chatbot-text-light);
    transition: color 0.3s ease;
}

.modern-chatbot-input input:focus::placeholder {
    color: var(--chatbot-primary);
    opacity: 0.7;
}

/* Enhanced send button */
.modern-chatbot-input button {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--chatbot-transition);
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-input button::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.5s;
}

.modern-chatbot-input button:hover::before {
    left: 100%;
}

.modern-chatbot-input button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.modern-chatbot-input button:active {
    transform: translateY(0) scale(0.95);
}

/* Suggestions */
.modern-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.modern-chatbot-suggestions button {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    color: #4B0082;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.modern-chatbot-suggestions button:hover {
    background: #4B0082;
    color: white;
    transform: translateY(-1px);
}

/* Typing indicator */
.modern-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f1f3f4 100%);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modern-typing-dot {
    width: 8px;
    height: 8px;
    background: #4B0082;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.modern-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.modern-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Enhanced animations */
@keyframes chatbotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes windowOpen {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    50% {
        transform: translateX(50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes windowMinimize {
    0% {
        height: 600px;
    }
    100% {
        height: 60px;
    }
}

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translate(-50%, -50%) perspective(150px) rotateY(0deg) rotateX(0deg) translateY(0px) scale(1);
    }
    25% {
        transform: translate(-50%, -50%) perspective(150px) rotateY(3deg) rotateX(-1deg) translateY(-3px) scale(1.02);
    }
    50% {
        transform: translate(-50%, -50%) perspective(150px) rotateY(1deg) rotateX(-3deg) translateY(-4px) scale(1.05);
    }
    75% {
        transform: translate(-50%, -50%) perspective(150px) rotateY(-2deg) rotateX(-2deg) translateY(-2px) scale(1.03);
    }
}

@keyframes logoFloatSubtle {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    25% {
        transform: translateY(-2px) scale(1.01);
    }
    50% {
        transform: translateY(-3px) scale(1.02);
    }
    75% {
        transform: translateY(-1px) scale(1.01);
    }
}

@keyframes headerShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes navigationGlow {
    0% {
        box-shadow: 0 4px 15px #4B0082;
    }
    100% {
        box-shadow: 0 4px 25px #4B0082;
    }
}

/* Loading indicator */
.modern-chatbot-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f1f3f4 100%);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: messageSlideIn 0.3s ease-out;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modern-chatbot-loading span {
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced message animations */
.modern-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
}

.modern-chatbot-message:hover {
    transform: translateX(5px);
}

.modern-chatbot-message.user:hover {
    transform: translateX(-5px);
}

/* Enhanced suggestion buttons */
.modern-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    animation: suggestionsSlideIn 0.5s ease-out;
}

.modern-chatbot-suggestions button {
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #4B0082;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-suggestions button::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.5s;
}

.modern-chatbot-suggestions button:hover::before {
    left: 100%;
}

.modern-chatbot-suggestions button:hover {
    background: linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

/* Enhanced toggle button */
.modern-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: white;
    font-size: 24px;
    animation: chatbotPulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.modern-chatbot-toggle:active::before {
    width: 100%;
    height: 100%;
}

.modern-chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
    animation: none;
}

/* Enhanced input field */
.modern-chatbot-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 25px;
    font-size: 14px;
    background: white;
    color: #333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    outline: none;
    position: relative;
}

.modern-chatbot-input input:focus {
    border-color: #4B0082;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.modern-chatbot-input input::placeholder {
    color: #999;
    transition: color 0.3s ease;
}

.modern-chatbot-input input:focus::placeholder {
    color: #4B0082;
    opacity: 0.7;
}

/* Enhanced send button */
.modern-chatbot-input button {
    padding: 14px 20px;
    background: linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 600;
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-input button::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.5s;
}

.modern-chatbot-input button:hover::before {
    left: 100%;
}

.modern-chatbot-input button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.modern-chatbot-input button:active {
    transform: translateY(0) scale(0.95);
}

/* Enhanced window animations */
.modern-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.modern-chatbot-window.open {
    display: flex;
    animation: windowOpen 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes windowOpen {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    50% {
        transform: translateX(50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Enhanced header */
.modern-chatbot-header {
    background: linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: headerShine 3s infinite;
}

@keyframes headerShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Enhanced control buttons */
.modern-chatbot-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    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);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.modern-chatbot-controls button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.modern-chatbot-controls button:hover::before {
    width: 100%;
    height: 100%;
}

.modern-chatbot-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .modern-chatbot-widget {
        bottom: 15px;
        right: 15px;
        --widget-size: 45px;
    }
    
    .modern-chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        bottom: 65px;
        right: 15px;
        left: 15px;
        border-radius: var(--chatbot-radius);
    }
    
    .modern-chatbot-toggle {
        width: var(--widget-size);
        height: var(--widget-size);
        font-size: 18px;
    }
    
    .modern-message-content {
        max-width: 90%;
        font-size: 12px;
    }
    
    .modern-chatbot-header {
        padding: 12px 15px;
    }
    
    .modern-chatbot-messages {
        padding: 12px 15px;
    }
    
    .modern-chatbot-input {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .modern-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 60px;
        right: 10px;
        left: 10px;
    }
    
    .modern-chatbot-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .modern-message-content {
        max-width: 95%;
        font-size: 11px;
        padding: 10px 14px;
    }
}

/* Dark theme enhancements */
@media (prefers-color-scheme: dark) {
    .modern-chatbot-window {
        background: linear-gradient(145deg, var(--chatbot-dark) 0%, var(--chatbot-light) 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .modern-chatbot-messages {
        background: linear-gradient(145deg, var(--chatbot-dark) 0%, var(--chatbot-light) 100%);
    }
    
    .modern-chatbot-message.bot .modern-message-content {
        background: linear-gradient(145deg, #4a5568 0%, var(--chatbot-dark) 100%);
        color: var(--chatbot-text);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .modern-chatbot-input {
        background: linear-gradient(145deg, var(--chatbot-dark) 0%, var(--chatbot-light) 100%);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .modern-chatbot-input input {
        background: #4a5568;
        color: var(--chatbot-text);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .modern-chatbot-input input::placeholder {
        color: var(--chatbot-text-light);
    }
    
    .modern-chatbot-typing,
    .modern-chatbot-loading {
        background: linear-gradient(145deg, #4a5568 0%, var(--chatbot-dark) 100%);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .modern-chatbot-toggle,
    .modern-chatbot-window,
    .modern-chatbot-message,
    .modern-typing-dot,
    .modern-chatbot-suggestions button,
    .modern-chatbot-input button {
        animation: none;
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .modern-chatbot-toggle {
        background: #000;
        border: 2px solid #fff;
    }
    
    .modern-chatbot-window {
        border: 2px solid #000;
    }
    
    .modern-chatbot-message.bot .modern-message-content {
        border: 2px solid #000;
    }
    
    .modern-chatbot-input input {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .modern-chatbot-widget {
        display: none !important;
    }
}

/* Focus indicators for accessibility */
.modern-chatbot-toggle:focus,
.modern-chatbot-controls button:focus,
.modern-chatbot-input button:focus,
.modern-chatbot-suggestions button:focus {
    outline: 2px solid var(--chatbot-primary);
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
.modern-chatbot-widget * {
    transition: var(--chatbot-transition);
}

/* Enhanced hover states */
.modern-chatbot-message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Loading states */
.modern-chatbot-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success/error states */
.modern-chatbot-message.success .modern-message-content {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.modern-chatbot-message.error .modern-message-content {
    background: linear-gradient(135deg, var(--chatbot-error) 0%, #e53e3e 100%);
    color: white;
}

/* Enhanced scroll behavior */
.modern-chatbot-messages {
    scroll-behavior: smooth;
    scroll-padding-bottom: 20px;
}

/* Custom selection colors */
.modern-chatbot-widget ::selection {
    background: var(--chatbot-primary);
    color: white;
}

.modern-chatbot-widget ::-moz-selection {
    background: var(--chatbot-primary);
    color: white;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .modern-chatbot-toggle {
        animation: none;
    }
    
    .modern-chatbot-window {
        animation: none;
    }
    
    .modern-chatbot-message {
        animation: none;
    }
    
    .modern-typing-dot {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .modern-chatbot-toggle {
        background: #000;
        border: 2px solid #fff;
    }
    
    .modern-chatbot-window {
        border: 2px solid #000;
    }
    
    .modern-chatbot-message.bot .modern-message-content {
        border: 2px solid #000;
    }
}