/**
 * Casey AI Chatbot - Modern Dynamic Design
 * Completely new, conflict-free modern interface
 */

/* Prevent chatbot flash during page load - hide by default */
.modern-chatbot-widget:not(.active) .modern-chat-container {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(0.9) translateY(30px) rotateX(-5deg) !important;
}

/* Ultra-strong anti-jump rules - prevent any movement during page load */
.modern-chatbot-widget {
    transition: none !important;
    animation: none !important;
}

.modern-chatbot-widget:not(.active) {
    transition: none !important;
    animation: none !important;
}

.modern-chatbot-widget:not(.active) * {
    transition: none !important;
    animation: none !important;
}

/* Force immediate hiding - no transitions during page load */
.modern-chatbot-widget:not(.active) .modern-chat-container,
.modern-chatbot-widget:not(.active) .modern-chat-header,
.modern-chatbot-widget:not(.active) .modern-messages,
.modern-chatbot-widget:not(.active) .modern-input-container {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(0.8) translateY(50px) !important;
    transition: none !important;
    animation: none !important;
}

/* ===== Modern Chatbot Widget ===== */
.modern-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Neon Glow Effect for Chatbot Widget */
.modern-chatbot-widget::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #00ffff, #0099ff, #ff00ff, #ff0099, #00ffff);
    background-size: 400% 400%;
    border-radius: 23px;
    z-index: -1;
    opacity: 0;
    animation: neonGlow 4s ease-in-out infinite;
    filter: blur(8px);
}

.modern-chatbot-widget.active::before,
.modern-welcome-screen.active::before {
    opacity: 0.8;
}

@keyframes neonGlow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.6;
    }
    25% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
    50% {
        background-position: 100% 100%;
        opacity: 1;
        filter: blur(10px);
    }
    75% {
        background-position: 0% 100%;
        opacity: 0.8;
    }
}

@keyframes neonGlowEnhanced {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.7;
        filter: blur(10px);
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.4),
                    0 0 40px rgba(0, 153, 255, 0.3),
                    0 0 60px rgba(255, 0, 255, 0.2);
    }
    20% {
        background-position: 50% 0%;
        opacity: 0.9;
        filter: blur(12px);
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.6),
                    0 0 60px rgba(0, 153, 255, 0.4),
                    0 0 90px rgba(255, 0, 255, 0.3);
    }
    40% {
        background-position: 100% 50%;
        opacity: 1;
        filter: blur(15px);
        box-shadow: 0 0 40px rgba(0, 255, 255, 0.8),
                    0 0 80px rgba(0, 153, 255, 0.6),
                    0 0 120px rgba(255, 0, 255, 0.4);
    }
    60% {
        background-position: 100% 100%;
        opacity: 0.9;
        filter: blur(12px);
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.6),
                    0 0 60px rgba(0, 153, 255, 0.4),
                    0 0 90px rgba(255, 0, 255, 0.3);
    }
    80% {
        background-position: 50% 100%;
        opacity: 0.8;
        filter: blur(11px);
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.5),
                    0 0 50px rgba(0, 153, 255, 0.3),
                    0 0 75px rgba(255, 0, 255, 0.2);
    }
}

@keyframes neonGlowIntense {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.8;
        filter: blur(15px) brightness(1.3);
        box-shadow:
            0 0 30px rgba(0, 255, 255, 1),
            0 0 60px rgba(0, 212, 255, 0.8),
            0 0 90px rgba(0, 153, 255, 0.7),
            0 0 120px rgba(255, 0, 255, 0.6),
            0 0 150px rgba(255, 102, 255, 0.4);
    }
    25% {
        background-position: 50% 0%;
        opacity: 0.9;
        filter: blur(18px) brightness(1.5);
        box-shadow:
            0 0 40px rgba(0, 255, 255, 1),
            0 0 80px rgba(0, 212, 255, 0.9),
            0 0 120px rgba(0, 153, 255, 0.8),
            0 0 160px rgba(255, 0, 255, 0.7),
            0 0 200px rgba(255, 102, 255, 0.6);
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
        filter: blur(20px) brightness(1.8);
        box-shadow:
            0 0 50px rgba(0, 255, 255, 1),
            0 0 100px rgba(0, 212, 255, 1),
            0 0 150px rgba(0, 153, 255, 0.9),
            0 0 200px rgba(255, 0, 255, 0.8),
            0 0 250px rgba(255, 102, 255, 0.7),
            inset 0 0 60px rgba(0, 255, 255, 0.4);
    }
    75% {
        background-position: 100% 100%;
        opacity: 0.9;
        filter: blur(18px) brightness(1.5);
        box-shadow:
            0 0 40px rgba(0, 255, 255, 1),
            0 0 80px rgba(0, 212, 255, 0.9),
            0 0 120px rgba(0, 153, 255, 0.8),
            0 0 160px rgba(255, 0, 255, 0.7),
            0 0 200px rgba(255, 102, 255, 0.6);
    }
}

@keyframes neonGlowBorder {
    0% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
    25% {
        background-position: 25% 0%;
        opacity: 1;
    }
    50% {
        background-position: 50% 50%;
        opacity: 0.9;
    }
    75% {
        background-position: 75% 100%;
        opacity: 1;
    }
    100% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
}

/* Additional glow effect for toggle button */
.modern-chat-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ffff, #0099ff, #ff00ff, #ff0099, #00ffff);
    background-size: 400% 400%;
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    animation: neonGlow 3s ease-in-out infinite;
    filter: blur(5px);
    transition: opacity 0.3s ease;
}

.modern-chat-toggle:hover::before {
    opacity: 0.8;
}

/* ===== Welcome Screen with Video Background ===== */
.modern-welcome-screen {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 360px;
    height: 420px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 12px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(30px) rotateX(-5deg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Professional Neon Border Effect for Welcome Screen - Border Only */
.modern-welcome-screen::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #00ffff, #00d4ff, #0099ff, #00ffff, #ff00ff, #ff0099, #ff66ff, #ff00ff, #00ffff);
    background-size: 600% 600%;
    border-radius: 23px;
    z-index: -1;
    opacity: 0;
    animation: neonGlowBorder 3s linear infinite;
    filter: blur(1px);
    transition: opacity 0.4s ease;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

.modern-welcome-screen.active::after {
    opacity: 1;
}

/* Additional neon border for welcome screen */
.modern-welcome-screen.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ffff, #0099ff, #ff00ff, #ff0099, #00ffff);
    background-size: 400% 400%;
    border-radius: 22px;
    z-index: -1;
    opacity: 0.9;
    animation: neonGlow 4s ease-in-out infinite reverse;
    filter: blur(4px);
}

/* Welcome screen active state */
.modern-welcome-screen.active {
    transform: scale(1) translateY(0) rotateX(0deg);
    opacity: 1;
    visibility: visible;
}

@keyframes welcomeSlideIn {
    from {
        transform: scale(0.9) translateY(30px) rotateX(-5deg);
        opacity: 0;
        visibility: hidden;
    }
    to {
        transform: scale(1) translateY(0) rotateX(0deg);
        opacity: 1;
        visibility: visible;
    }
}

/* Video Background */
.welcome-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.welcome-video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.welcome-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(26, 26, 46, 0.4) 0%,
        rgba(22, 33, 62, 0.3) 50%,
        rgba(44, 62, 80, 0.4) 100%);
}

/* Welcome Content */
.welcome-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    flex: 1;
}

/* Bottom Button Container */
.welcome-bottom-container {
    position: relative;
    z-index: 2;
    padding: 20px 30px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-avatar {
    position: relative;
    margin-bottom: 20px;
}

.welcome-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: avatarFloat 3s ease-in-out infinite;
}

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

.welcome-status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #00d084;
    border: 3px solid #ffffff;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

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

.welcome-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-subtitle {
    color: #e3f2fd;
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 20px 0;
    opacity: 0.9;
}

.welcome-description {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 30px 0;
    opacity: 0.8;
    max-width: 280px;
}

.welcome-start-btn {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.welcome-start-btn:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.welcome-start-btn:active {
    transform: translateY(0);
}

.welcome-talk-btn {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.welcome-talk-btn:hover {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.welcome-talk-btn:active {
    transform: translateY(0);
}

/* Close Button Container */
.welcome-close-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
}

.welcome-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.welcome-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

/* Skip Button Container */

/* Responsive Design */
@media (max-width: 480px) {
    .modern-welcome-screen {
        width: 320px;
        height: 450px;
        right: 10px;
        bottom: 70px;
    }

    .welcome-content {
        padding: 30px 20px;
    }

    .welcome-avatar-img {
        width: 60px;
        height: 60px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .welcome-description {
        font-size: 13px;
        max-width: 240px;
    }

    .welcome-start-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* ===== Modern Chatbot Toggle ===== */
.modern-chat-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 3px solid #fff !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-chat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.modern-chat-toggle:hover::before {
    left: 100%;
}

.modern-chat-toggle:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5), 0 8px 20px rgba(0, 0, 0, 0.15);
}

.modern-chat-toggle:active {
    transform: translateY(-2px) scale(1.02);
}

.modern-chat-toggle.breathing {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6), 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 10px rgba(102, 126, 234, 0.2);
    }
}

/* ===== Modern Chatbot Container ===== */
.modern-chat-container {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 360px;
    height: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 12px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(30px) rotateX(-5deg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform-style: preserve-3d;
}

.modern-chat-container.active {
    transform: scale(1) translateY(0) rotateX(0deg);
    opacity: 1;
    visibility: visible;
}

/* Professional Neon Border Effect for Chatbot Container - Border Only */
.modern-chat-container::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #00ffff, #00d4ff, #0099ff, #00ffff, #ff00ff, #ff0099, #ff66ff, #ff00ff, #00ffff);
    background-size: 600% 600%;
    border-radius: 23px;
    z-index: -1;
    opacity: 0;
    animation: neonGlowBorder 3s linear infinite;
    filter: blur(1px);
    transition: opacity 0.4s ease;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

.modern-chat-container.active::after {
    opacity: 1;
}

/* Additional neon border for chatbot container */
.modern-chat-container.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ffff, #0099ff, #ff00ff, #ff0099, #00ffff);
    background-size: 400% 400%;
    border-radius: 22px;
    z-index: -1;
    opacity: 0.9;
    animation: neonGlow 4s ease-in-out infinite reverse;
    filter: blur(4px);
}

.modern-chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.5), transparent);
    animation: shimmer 3s infinite;
}

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

/* ===== Modern Chatbot Header ===== */
.modern-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.modern-chat-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    animation: headerGlow 4s infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.modern-chat-header h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.modern-chat-header small {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modern-casey-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: cover;
}

.modern-casey-avatar:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.modern-casey-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: cover;
}

.modern-casey-avatar-small:hover {
    transform: scale(1.1);
    border-color: rgba(102, 126, 234, 0.5);
}

/* ===== Modern Header Controls ===== */
.modern-mode-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-weight: 600;
    cursor: pointer;
}

.modern-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modern-mode-toggle:active {
    transform: translateY(0);
}

.modern-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    margin-left: 8px;
}

.modern-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

.modern-close-btn:active {
    transform: scale(0.95);
}

/* ===== Modern Messages Area ===== */
.modern-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

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

.modern-messages::-webkit-scrollbar-track {
    background: transparent;
}

.modern-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    opacity: 0.5;
}

.modern-messages::-webkit-scrollbar-thumb:hover {
    opacity: 0.7;
}

/* ===== Modern Message Styling ===== */
.modern-bot-message, .modern-user-message {
    margin-bottom: 20px;
    animation: messageSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modern-bot-message {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.modern-bot-message .modern-message-content {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    padding: 16px 20px;
    border-radius: 20px;
    max-width: 85%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    font-size: 14px;
    line-height: 1.6;
}

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

.modern-user-message .modern-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 20px;
    max-width: 85%;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.6;
}

.modern-user-message .modern-message-content strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.modern-bot-message .modern-message-content strong {
    color: #ffffff;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

/* ===== Modern Input Area ===== */
.modern-input-container {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0 0 16px 16px;
    position: relative;
}

.modern-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.modern-text-input {
    display: flex;
    gap: 12px;
    align-items: center;
}

.modern-text-input input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid rgba(229, 231, 235, 0.8);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #000000;
}

.modern-text-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    color: #000000;
}

.modern-text-input input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-style: italic;
}

.modern-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.modern-send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(-50%, -50%);
}

.modern-send-btn:hover::before {
    width: 100%;
    height: 100%;
}

.modern-send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}

.modern-send-btn:active {
    transform: translateY(0) scale(0.98);
}

.modern-send-btn.sending {
    animation: sendPulse 0.6s ease;
}

@keyframes sendPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ===== Voice Interface Styles ===== */
.modern-voice-input {
    padding: 4px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.03), rgba(219, 39, 119, 0.01));
    border-radius: 12px;
    border: 1px solid rgba(236, 72, 153, 0.08);
    margin: 0;
}

.voice-controls-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.modern-voice-btn {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.modern-voice-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(-50%, -50%);
}

.modern-voice-btn:hover::before {
    width: 100%;
    height: 100%;
}

.modern-voice-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 28px rgba(236, 72, 153, 0.4);
}

.modern-voice-btn:active {
    transform: translateY(0) scale(0.98);
}

.modern-voice-btn.recording {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    animation: voiceRecordingPulse 1.5s ease-in-out infinite;
}

@keyframes voiceRecordingPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 32px rgba(236, 72, 153, 0.6);
    }
}

.voice-status-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.modern-voice-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-voice-wave.active {
    opacity: 1;
}

.modern-voice-wave .wave-bar {
    width: 4px;
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-radius: 2px;
    animation: waveAnimation 1.2s ease-in-out infinite;
}

.modern-voice-wave .wave-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.modern-voice-wave .wave-bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.modern-voice-wave .wave-bar:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.modern-voice-wave .wave-bar:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.modern-voice-wave .wave-bar:nth-child(5) { animation-delay: 0.4s; height: 8px; }

@keyframes waveAnimation {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }
}

.modern-voice-status {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s ease;
}

.modern-voice-timer {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-voice-timer.active {
    opacity: 1;
}

.modern-mode-toggle {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #6b7280;
    border: 1px solid rgba(236, 72, 153, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    flex-shrink: 0;
}

.modern-mode-toggle:hover {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    transform: scale(1.05);
}

.modern-mode-toggle.voice-active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
}

.modern-voice-transcription {
    background: rgba(236, 72, 153, 0.05);
    border: 1px solid rgba(236, 72, 153, 0.1);
    border-radius: 12px;
    padding: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.modern-voice-transcription.active {
    opacity: 1;
    transform: translateY(0);
    max-height: 120px;
}

.transcription-label {
    font-size: 11px;
    color: #ec4899;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transcription-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    font-style: italic;
}

.voice-message-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 6px;
}

.voice-message-indicator.bot-voice.female-voice {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
}

.voice-message-indicator:not(.female-voice) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.female-voice-quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    margin-top: 6px;
    animation: femaleVoicePulse 2s ease-in-out infinite;
}

@keyframes femaleVoicePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(236, 72, 153, 0.5);
    }
}

.female-voice-content {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(219, 39, 119, 0.05));
    border: 1px solid rgba(236, 72, 153, 0.2);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.1);
}

/* ===== Hybrid Voice & Text Input Styles ===== */
.modern-hybrid-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.03), rgba(219, 39, 119, 0.01));
    border-radius: 12px;
    border: 1px solid rgba(236, 72, 153, 0.08);
    transition: all 0.3s ease;
    min-height: 42px;
    position: relative;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.06);
    margin: 0;
}

.modern-hybrid-input-container:hover {
    border-color: rgba(236, 72, 153, 0.2);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(219, 39, 119, 0.04));
}

.modern-hybrid-input-container.recording {
    border-color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(185, 28, 28, 0.02));
    animation: hybridRecordingPulse 2s ease-in-out infinite;
}

@keyframes hybridRecordingPulse {
    0%, 100% {
        border-color: #dc2626;
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4), 0 2px 8px rgba(220, 38, 38, 0.2);
    }
    50% {
        border-color: #ef4444;
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15), 0 4px 16px rgba(220, 38, 38, 0.3);
    }
}

/* Voice Controls Section */
.voice-controls-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.voice-controls-section .modern-voice-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}

.voice-controls-section .modern-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

.voice-controls-section .modern-voice-btn.recording {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    animation: professionalRecordingPulse 1.5s ease-in-out infinite;
}

/* Hybrid Text Input Section */
.hybrid-text-input-section {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.hybrid-chat-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(236, 72, 153, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    font-size: 13px;
    color: #374151;
    transition: all 0.3s ease;
    outline: none;
    height: 36px;
}

.hybrid-chat-input:focus {
    border-color: #ec4899;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.08);
}

.hybrid-chat-input::placeholder {
    color: #9ca3af;
    font-style: italic;
    font-size: 12px;
}

/* Voice Status Overlay - Hide it entirely for cleaner UI */
.voice-status-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    display: none !important; /* Hide the overlay completely */
}

.voice-status-overlay.active {
    opacity: 0; /* Keep it hidden even when active */
    display: none !important;
}

.voice-status-content {
    display: none; /* Hide completely */
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(236, 72, 153, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(236, 72, 153, 0.25);
}

.voice-status-content .modern-voice-wave {
    display: flex;
    gap: 1px;
    margin-bottom: 1px;
}

.voice-status-content .wave-bar {
    width: 2px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    animation: waveBar 1s ease-in-out infinite;
}

.voice-status-content .wave-bar:nth-child(1) { animation-delay: 0s; }
.voice-status-content .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-status-content .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-status-content .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-status-content .wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveBar {
    0%, 100% { height: 8px; opacity: 0.6; }
    50% { height: 14px; opacity: 1; }
}

.voice-status-content .modern-voice-status {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.voice-status-content .modern-voice-timer {
    font-size: 8px;
    opacity: 0.8;
    line-height: 1;
}

/* Hybrid Send Section */
.hybrid-send-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hybrid-send-section .modern-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.hybrid-send-section .modern-send-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.hybrid-send-section .modern-mode-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(236, 72, 153, 0.3);
}

.hybrid-send-section .modern-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(236, 72, 153, 0.4);
}

.hybrid-send-section .modern-mode-toggle.voice-active {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Text Mode Indicator - Matches voice button design */
.voice-controls-section .text-mode-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.voice-controls-section .text-mode-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

/* Voice Transcription Display */
.modern-voice-transcription {
    margin: 0;
    padding: 0 10px;
    background: rgba(236, 72, 153, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(236, 72, 153, 0.08);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.modern-voice-transcription.active {
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
    margin: 8px 0 0 0;
    padding: 8px 10px;
    visibility: visible;
    pointer-events: auto;
}

.transcription-label {
    font-size: 10px;
    font-weight: 600;
    color: #ec4899;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.transcription-text {
    font-size: 12px;
    color: #374151;
    line-height: 1.3;
    font-style: italic;
}

/* Responsive voice interface */
@media (max-width: 480px) {
    .voice-controls-container {
        flex-direction: column;
        gap: 12px;
    }

    .modern-voice-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .modern-mode-toggle {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* Responsive Hybrid Input */
@media (max-width: 480px) {
    .modern-hybrid-input-container {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
        min-height: auto;
    }

    .voice-controls-section {
        width: 100%;
        justify-content: center;
    }

    .voice-controls-section .modern-voice-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .hybrid-text-input-section {
        width: 100%;
    }

    .hybrid-chat-input {
        height: 32px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .hybrid-send-section {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .hybrid-send-section .modern-send-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .hybrid-send-section .modern-mode-toggle {
        width: 24px;
        height: 24px;
        font-size: 8px;
    }

    .voice-status-overlay {
        position: fixed;
        top: 50%;
        left: 50%;
        z-index: 1000;
    }
}

