* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: 
        radial-gradient(circle at 20% 20%, rgba(120, 119, 198, 0.4) 0%, transparent 70%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 70%),
        radial-gradient(circle at 40% 60%, rgba(120, 219, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    min-height: 100vh;
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
    animation: rotate 30s linear infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(99, 102, 241, 0.03) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(236, 72, 153, 0.03) 50%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: shimmer 8s ease-in-out infinite;
}

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

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

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    33% { transform: translateY(-15px) scale(1.02); }
    66% { transform: translateY(10px) scale(0.98); }
}

.chat-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(30px);
    position: relative;
    overflow: hidden;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        linear-gradient(-45deg, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.chat-container > * {
    position: relative;
    z-index: 1;
}

.chat-header {
    background: 
        linear-gradient(135deg, rgba(99, 102, 241, 0.8) 0%, rgba(236, 72, 153, 0.8) 50%, rgba(14, 165, 233, 0.8) 100%);
    color: white;
    padding: 28px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 8px 32px rgba(99, 102, 241, 0.3),
        0 4px 16px rgba(236, 72, 153, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: headerShine 3s ease-in-out infinite;
    pointer-events: none;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(99, 102, 241, 0.8), 
        rgba(236, 72, 153, 0.8), 
        rgba(14, 165, 233, 0.8), 
        transparent
    );
    animation: borderFlow 4s linear infinite;
}

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

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

.header-left h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    text-shadow: 
        0 0 20px rgba(99, 102, 241, 0.5),
        0 0 40px rgba(236, 72, 153, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #e0e7ff, #fce7f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.9), rgba(224, 231, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px rgba(99, 102, 241, 0.5), 0 0 40px rgba(236, 72, 153, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); }
    100% { text-shadow: 0 0 30px rgba(99, 102, 241, 0.8), 0 0 60px rgba(236, 72, 153, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3); }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-btn {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lang-btn::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 ease;
}

.lang-btn:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.3),
        0 4px 12px rgba(236, 72, 153, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn:hover::before {
    left: 100%;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px 40px 160px 40px;
    background: 
        radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.03) 0%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.03) 0%, transparent 70%),
        linear-gradient(180deg, rgba(15, 15, 35, 0.8) 0%, rgba(26, 26, 46, 0.9) 100%);
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.chat-messages::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(0deg, rgba(236, 72, 153, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.welcome-message {
    margin-bottom: 24px;
}

.message {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: slideIn 0.3s ease-out;
}

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

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

.ai-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 24px 28px;
    border-radius: 24px;
    font-size: 16px;
    line-height: 1.7;
    word-wrap: break-word;
    position: relative;
    backdrop-filter: blur(20px);
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(236, 72, 153, 0.9) 100%);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow: 
        0 8px 32px rgba(99, 102, 241, 0.4),
        0 4px 16px rgba(236, 72, 153, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.user-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: inherit;
    pointer-events: none;
}

.ai-message .message-content {
    background: rgba(30, 30, 50, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-bottom-left-radius: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

.ai-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

/* Enhanced message formatting */
.ai-message .message-content h1, 
.ai-message .message-content h2, 
.ai-message .message-content h3 {
    color: #f1f5f9;
    margin: 20px 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ai-message .message-content h1 { 
    font-size: 1.6em; 
    border-bottom: 2px solid rgba(99, 102, 241, 0.4);
    padding-bottom: 8px;
    color: #e0e7ff;
}
.ai-message .message-content h2 { 
    font-size: 1.4em; 
    color: #cbd5e1;
}
.ai-message .message-content h3 { 
    font-size: 1.2em; 
    color: #94a3b8;
}
.ai-message .message-content h4.big-header { 
    font-size: 1.8em; 
    font-weight: 700;
    color: #f1f5f9;
    margin: 24px 0 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #f1f5f9, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-message .message-content strong {
    color: #f8fafc;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-message .message-content em {
    color: #cbd5e1;
    font-style: italic;
}

.user-message .message-content h1, 
.user-message .message-content h2, 
.user-message .message-content h3 {
    color: #ffffff;
    margin: 20px 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
}

.user-message .message-content h1 { 
    font-size: 1.6em; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 8px;
}
.user-message .message-content h2 { 
    font-size: 1.4em; 
}
.user-message .message-content h3 { 
    font-size: 1.2em; 
}

.user-message .message-content strong {
    color: #ffffff;
    font-weight: 700;
}

.user-message .message-content em {
    color: #f1f5f9;
    font-style: italic;
}

.message-content ul, .message-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.message-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.message-content ul li {
    list-style-type: disc;
}

.message-content ol li {
    list-style-type: decimal;
}

.ai-message .message-content code {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.ai-message .message-content pre {
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(99, 102, 241, 0.1);
}

.ai-message .message-content pre code {
    background: none;
    color: #e2e8f0;
    padding: 0;
    border-radius: 0;
    border: none;
}

.user-message .message-content code {
    background: rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-message .message-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.user-message .message-content pre code {
    background: none;
    color: #f8fafc;
    padding: 0;
    border-radius: 0;
    border: none;
}

.ai-message .message-content blockquote {
    border-left: 4px solid rgba(99, 102, 241, 0.8);
    padding-left: 20px;
    margin: 16px 0;
    color: #cbd5e1;
    font-style: italic;
    background: rgba(99, 102, 241, 0.1);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.user-message .message-content blockquote {
    border-left: 4px solid rgba(255, 255, 255, 0.8);
    padding-left: 20px;
    margin: 16px 0;
    color: #f1f5f9;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-content a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    position: relative;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.message-content a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(96, 165, 250, 0.1), rgba(147, 51, 234, 0.1));
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.message-content a:hover {
    color: #93c5fd;
    border-bottom-color: #60a5fa;
    transform: translateY(-1px);
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
}

.message-content a:hover::before {
    opacity: 1;
}

.user-message .message-content a {
    color: #ddd6fe;
    border-bottom-color: rgba(221, 214, 254, 0.4);
    text-shadow: 0 0 10px rgba(221, 214, 254, 0.3);
}

.user-message .message-content a:hover {
    color: #ede9fe;
    text-shadow: 0 0 15px rgba(237, 233, 254, 0.5);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    background: rgba(30, 30, 50, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    border-bottom-left-radius: 8px;
    max-width: 80%;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    position: relative;
}

.typing-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

.typing-indicator span {
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.typing-indicator.searching {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(14, 165, 233, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.typing-indicator.searching::before {
    background: 
        radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
}

.search-icon {
    position: relative;
    z-index: 1;
    font-size: 16px;
    animation: searchPulse 2s ease-in-out infinite;
}

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

.typing-indicator.searching .typing-dot {
    background: rgba(14, 165, 233, 0.8);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.typing-indicator.searching .typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator.searching .typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator.searching .typing-dot:nth-child(3) { animation-delay: 0s; }

.typing-dots {
    display: flex;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: rgba(99, 102, 241, 0.8);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.4;
        background: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
    }
    40% { 
        transform: scale(1.2); 
        opacity: 1;
        background: rgba(236, 72, 153, 0.9);
        box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
    }
}

.chat-input-container {
    padding: 32px 40px;
    background: 
        linear-gradient(180deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 46, 0.98) 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(30px);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
}

.chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(99, 102, 241, 0.5), 
        rgba(236, 72, 153, 0.5), 
        rgba(14, 165, 233, 0.5), 
        transparent
    );
    animation: borderGlow 3s linear infinite;
}

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

.chat-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    background: 
        linear-gradient(135deg, rgba(30, 30, 50, 0.8) 0%, rgba(45, 45, 70, 0.8) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 30px;
    padding: 16px 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    min-height: 56px;
    height: 56px;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.input-wrapper > * {
    position: relative;
    z-index: 1;
}

.input-wrapper:focus-within {
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 
        0 0 0 3px rgba(99, 102, 241, 0.3),
        0 4px 20px rgba(99, 102, 241, 0.4),
        0 0 15px rgba(236, 72, 153, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.98) 0%, rgba(45, 45, 70, 0.98) 100%);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 17px;
    line-height: 1.4;
    max-height: 140px;
    min-height: 24px;
    height: 24px;
    font-family: inherit;
    color: #e2e8f0;
    font-weight: 500;
    overflow: hidden;
    vertical-align: top;
}

#messageInput:focus {
    outline: none;
}

#messageInput::placeholder {
    color: rgba(160, 174, 192, 0.7);
    font-weight: 400;
    line-height: 1.4;
}

#messageInput::selection {
    background: rgba(99, 102, 241, 0.3);
}

.send-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(236, 72, 153, 0.9) 100%);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.3),
        0 2px 8px rgba(236, 72, 153, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.1) translateY(-3px) rotate(5deg);
    box-shadow: 
        0 12px 35px rgba(99, 102, 241, 0.5),
        0 6px 20px rgba(236, 72, 153, 0.4),
        0 0 30px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(236, 72, 153, 1) 100%);
}

.send-btn:hover::before {
    opacity: 1;
}

.send-btn:active {
    transform: scale(0.95) translateY(0) rotate(0deg);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.send-btn svg {
    transition: transform 0.3s ease;
    width: 14px;
    height: 14px;
}

.web-search-btn {
    background: rgba(30, 30, 50, 0.8);
    color: rgba(160, 174, 192, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.web-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.web-search-btn:hover {
    color: rgba(99, 102, 241, 0.9);
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.web-search-btn:hover::before {
    opacity: 1;
}

.web-search-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(14, 165, 233, 0.2) 100%);
    color: rgba(99, 102, 241, 1);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 
        0 0 0 2px rgba(99, 102, 241, 0.3),
        0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.web-search-btn.active::before {
    opacity: 1;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}

.web-search-btn svg {
    transition: transform 0.3s ease;
    width: 16px;
    height: 16px;
}

.web-search-btn:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.web-search-btn.active svg {
    transform: rotate(0deg) scale(1.1);
}

.send-btn:hover svg {
    transform: translateX(2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 20px 24px;
    }
    
    .header-left h1 {
        font-size: 24px;
    }
    
    .chat-messages {
        padding: 24px 20px;
    }
    
    .message-content {
        max-width: 85%;
        padding: 16px 20px;
    }
    
    .chat-input-container {
        padding: 20px 24px;
    }
    
    .input-wrapper {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .message-content {
        max-width: 90%;
        font-size: 14px;
        padding: 14px 16px;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .header-left h1 {
        font-size: 20px;
    }
    
    .chat-messages {
        padding: 20px 16px;
    }
    
    .chat-input-container {
        padding: 16px 20px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 224, 0.8);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 174, 192, 0.9);
}

/* Chat Control Bar */
.chat-control-bar {
    position: fixed;
    bottom: 140px;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 0 40px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.chat-control-bar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.control-bar-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-text {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
    transition: all 0.3s ease;
}

.status-dot.thinking {
    background: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.searching {
    background: rgba(14, 165, 233, 0.8);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.paused {
    background: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.status-dot.error {
    background: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

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

.control-buttons {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(30, 30, 50, 0.8);
    color: rgba(160, 174, 192, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-btn:hover {
    transform: scale(1.1);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.control-btn:hover::before {
    opacity: 1;
}

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

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.control-btn:disabled:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: none;
}

.pause-btn:hover {
    color: rgba(245, 158, 11, 0.9);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.pause-btn.active {
    background: rgba(245, 158, 11, 0.2);
    color: rgba(245, 158, 11, 1);
    border-color: rgba(245, 158, 11, 0.6);
}

.regenerate-btn:hover {
    color: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.regenerate-btn:disabled {
    opacity: 0.3;
}

/* Mobile responsiveness for control bar */
@media (max-width: 768px) {
    .chat-control-bar {
        padding: 0 24px;
        bottom: 120px;
    }
    
    .control-bar-content {
        padding: 10px 16px;
    }
    
    .status-text {
        font-size: 13px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
    }
    
    .control-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .chat-control-bar {
        padding: 0 20px;
        bottom: 110px;
    }
    
    .control-bar-content {
        padding: 8px 12px;
    }
}

/* Message regenerate button */
.message-regenerate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin: 12px auto 0 auto;
    width: fit-content;
    transition: all 0.3s ease;
    opacity: 0.9;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.message-regenerate-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message-regenerate-btn:active {
    transform: translateY(0);
}

.message-regenerate-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.message-regenerate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* System messages */
.system-message {
    text-align: center;
    margin: 10px 0;
}

.system-message .message-content {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
    font-style: italic;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* Status dot styles */
.status-dot.stopped {
    background: #dc3545;
    animation: pulse-stopped 2s infinite;
}

@keyframes pulse-stopped {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stop button styles */
.stop-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.stop-btn:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-1px);
}