/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --primary-dark: #357BC7;
    --secondary-color: #50C878;
    --accent-color: #FF6B8A;
    --background-dark: #0A0E1A;
    --background-light: #1A1F2E;
    --surface-color: #2D3748;
    --text-primary: #FFFFFF;
    --text-secondary: #A0AEC0;
    --text-muted: #718096;
    --border-color: #4A5568;
    --success-color: #48BB78;
    --warning-color: #ED8936;
    --error-color: #F56565;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0A0E1A 0%, #1A1F2E 50%, #2D3748 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.element-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, var(--accent-color), var(--primary-color));
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.element-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.element-4 {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, var(--primary-color), var(--warning-color));
    top: 30%;
    right: 40%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-heavy);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 20px 30px;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.bot-avatar {
    position: relative;
}

.avatar-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    position: relative;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(80, 200, 120, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(80, 200, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(80, 200, 120, 0); }
}

.status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: var(--success-color);
    border-radius: 50%;
    border: 3px solid white;
    animation: pulse 2s infinite;
}

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

.bot-info {
    flex: 1;
}

.bot-info h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(45deg, #fff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bot-info p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.typing-indicator {
    display: none;
    margin-top: 8px;
}

.typing-indicator.active {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.8s ease;
}

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

.welcome-content {
    max-width: 500px;
    margin: 0 auto;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.welcome-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-light);
}

.quick-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(74, 144, 226, 0.4);
}

/* Messages */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message {
    animation: slideInRight 0.4s ease;
}

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

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    color: white;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-bubble {
    padding: 15px 20px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
}

.bot-message .message-bubble {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-bottom-left-radius: 8px;
}

.user-message .message-bubble {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 8px;
    margin-left: auto;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* Input Area */
.input-area {
    padding: 20px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
}

.message-form {
    position: relative;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border-radius: 25px;
    padding: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.1), transparent);
    transition: left 0.5s ease;
}

.input-wrapper.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.input-wrapper.focused::before {
    left: 100%;
}

.attachment-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.attachment-btn:hover {
    background: var(--glass-bg);
    color: var(--primary-color);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    padding: 12px 15px;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 120px;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

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

/* Input Suggestions */
.input-suggestions {
    display: none;
    margin-top: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.suggestion {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.suggestion:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-spinner p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Custom Animations */
@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .header-content {
        gap: 15px;
    }
    
    .bot-info h1 {
        font-size: 24px;
    }
    
    .avatar-ring {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .input-area {
        padding: 15px 20px;
    }
    
    .welcome-content h2 {
        font-size: 28px;
    }
    
    .welcome-icon {
        width: 70px;
        height: 70px;
        font-size: 30px;
    }
    
    .welcome-content p {
        font-size: 14px;
    }
    
    .message-bubble {
        padding: 12px 16px;
    }
    
    .chat-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 5px;
    }
    
    .action-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .bot-info h1 {
        font-size: 20px;
    }
    
    .welcome-content h2 {
        font-size: 24px;
    }
    
    .welcome-content p {
        font-size: 14px;
    }
    
    .message-bubble {
        padding: 12px 16px;
    }
    
    .chat-container {
        padding: 15px;
    }
    
    #messageInput {
        font-size: 14px;
    }
    
    .input-wrapper {
        padding: 6px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
    }
    
    .attachment-btn {
        width: 35px;
        height: 35px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #FFFFFF;
        --text-secondary: #E2E8F0;
        --border-color: #FFFFFF;
        --glass-border: rgba(255, 255, 255, 0.5);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.08);
        --surface-color: #1A202C;
    }
}

/* Focus styles for better accessibility */
.action-btn:focus,
.quick-btn:focus,
.send-btn:focus,
.attachment-btn:focus,
.suggestion:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

#messageInput:focus {
    outline: none;
}

/* Loading states */
.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.send-btn:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-light);
}

/* Smooth scrolling for all elements */
* {
    scroll-behavior: smooth;
}