:root {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --surface-hover: #333333;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
    --sidebar-width: 320px;
    --glass-bg: rgba(26, 26, 26, 0.8);
    --glass-border: rgba(255, 255, 255, 0.15);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --neon-blue: #00d4ff;
    --neon-purple: #9d00ff;
    --neon-pink: #ff00ff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Futuristic Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    z-index: 2;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.3;
    animation: float 40s infinite ease-in-out;
    mix-blend-mode: screen;
}

.sphere-1 {
    width: 800px;
    height: 800px;
    background: var(--gradient-1);
    top: -300px;
    left: -300px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 700px;
    height: 700px;
    background: var(--gradient-2);
    bottom: -200px;
    right: -200px;
    animation-delay: 8s;
}

.sphere-3 {
    width: 600px;
    height: 600px;
    background: var(--gradient-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 16s;
}

.sphere-4 {
    width: 500px;
    height: 500px;
    background: var(--gradient-4);
    top: 20%;
    right: 20%;
    animation-delay: 24s;
}

.sphere-5 {
    width: 450px;
    height: 450px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    bottom: 20%;
    left: 20%;
    animation-delay: 32s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(60px, -60px) scale(1.2) rotate(90deg);
    }
    50% {
        transform: translate(-40px, 40px) scale(0.8) rotate(180deg);
    }
    75% {
        transform: translate(30px, -30px) scale(1.1) rotate(270deg);
    }
}

/* Enhanced Particles */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.8;
    animation: particle-float 25s infinite linear;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
        transform: scale(1);
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) translateX(150px) scale(0);
        opacity: 0;
    }
}

/* Auth Container - Futuristic Redesign */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    transition: var(--transition);
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--border-radius);
    padding: 3.5rem;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--glass-border);
    transform: translateY(0);
    transition: var(--transition);
    animation: slideUp 1s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    animation: shimmer 4s infinite;
}

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

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

.auth-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 45px -5px rgba(139, 92, 246, 0.4);
}

.auth-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.logo {
    width: 100px;
    height: 100px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 20px 35px rgba(139, 92, 246, 0.5);
    animation: pulse 3s infinite;
    position: relative;
}

.logo-glow {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
    border-radius: 50%;
    animation: logo-glow 3s infinite alternate;
}

@keyframes logo-glow {
    from { opacity: 0.4; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.2); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 25px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.auth-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 4s infinite;
    font-weight: 700;
}

@keyframes text-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 2.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 2;
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    background: rgba(42, 42, 42, 0.8);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.15);
    transform: translateY(-3px);
    background: rgba(42, 42, 42, 0.95);
}

.form-group input:focus + .input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.2);
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: var(--gradient-1);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.form-group input:focus ~ .input-glow {
    opacity: 0.15;
    animation: input-glow 3s infinite alternate;
}

@keyframes input-glow {
    from { opacity: 0.15; }
    to { opacity: 0.25; }
}

.btn {
    display: inline-block;
    padding: 1.25rem 2.5rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .loading-spinner {
    display: block;
}

.btn:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 20px 35px rgba(139, 92, 246, 0.5);
}

.btn:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-2);
    opacity: 0;
    border-radius: 16px;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.btn:hover .btn-glow {
    opacity: 0.4;
    animation: btn-glow 3s infinite alternate;
}

@keyframes btn-glow {
    from { opacity: 0.4; }
    to { opacity: 0.6; }
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-top: 2rem;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-dark);
    transform: translateY(-3px) scale(1.02);
}

/* Google Sign-In Button Container */
.google-signin-btn {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
}

.google-signin-btn > div {
    width: 100% !important;
    transition: var(--transition);
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(66, 133, 244, 0.2);
}

.google-signin-btn > div:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(66, 133, 244, 0.4);
}

.divider {
    display: flex;
    align-items: center;
    margin: 2.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.divider span {
    padding: 0 2rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
}

.auth-toggle {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.auth-toggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    position: relative;
    transition: var(--transition);
}

.auth-toggle a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-1);
    transition: var(--transition);
}

.auth-toggle a:hover::after {
    width: 100%;
}

/* Chat Container - Futuristic Redesign */
.chat-container {
    display: none;
    height: 100vh;
    width: 100%;
    flex-direction: row;
    animation: fadeIn 1s ease;
    position: relative;
}

/* Upload Indicator */
.upload-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 4rem;
    border-radius: var(--border-radius);
    text-align: center;
    display: none;
    z-index: 1000;
    border: 3px dashed var(--primary-color);
    box-shadow: var(--shadow-xl);
}

.upload-indicator.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: upload-pulse 1.5s infinite alternate;
}

@keyframes upload-pulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.05); }
}

.upload-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    animation: upload-icon-bounce 2.5s infinite;
}

@keyframes upload-icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.upload-indicator p {
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 700;
}

.upload-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.upload-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.8;
    animation: upload-particle-float 4s infinite linear;
}

@keyframes upload-particle-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-60px) translateX(40px);
        opacity: 0;
    }
}

.chat-container.drag-over {
    background-color: rgba(139, 92, 246, 0.15);
}

/* Chat Sidebar - Futuristic Redesign */
.chat-sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.new-chat-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.5);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-header h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-glow {
    width: 40px;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 2px;
    animation: history-glow 3s infinite alternate;
}

@keyframes history-glow {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-item {
    padding: 1.25rem;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.chat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
    transition: left 0.5s ease;
}

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

.chat-item:hover {
    background: var(--surface-hover);
    border-color: var(--glass-border);
    transform: translateX(8px);
}

.chat-item.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

.chat-item-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.chat-item-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.chat-item-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.chat-item:hover .chat-item-delete {
    opacity: 1;
}

.chat-item-delete:hover {
    background: var(--error);
    color: white;
    transform: scale(1.15);
}

.sidebar-footer {
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    position: relative;
}

.avatar-glow {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
    border-radius: 50%;
    animation: avatar-glow 4s infinite alternate;
}

@keyframes avatar-glow {
    from { opacity: 0.4; }
    to { opacity: 0.7; }
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: transparent;
    border: none;
    border-radius: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
    transition: left 0.5s ease;
}

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

.sidebar-action-btn:hover {
    background: var(--surface-hover);
    transform: translateX(8px);
}

.action-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    opacity: 0;
    border-radius: 16px;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.sidebar-action-btn:hover .action-glow {
    opacity: 0.15;
    animation: action-glow 3s infinite alternate;
}

@keyframes action-glow {
    from { opacity: 0.15; }
    to { opacity: 0.25; }
}

.sidebar-action-btn.logout {
    color: var(--error);
}

.sidebar-action-btn.logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Main Chat Area - Futuristic Redesign */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 5;
    border-bottom: 1px solid var(--glass-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 1rem;
    border-radius: 12px;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--surface-hover);
    transform: scale(1.15);
}

.menu-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, var(--primary-color), transparent 70%);
    opacity: 0;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.menu-toggle:hover .menu-glow {
    opacity: 0.3;
}

.header-title h2 {
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 700;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--success);
    font-size: 1rem;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.header-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 42, 42, 0.8);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.header-action-btn:hover {
    background: var(--surface-hover);
    transform: scale(1.15);
}

.header-action-btn.logout {
    color: var(--error);
}

.header-action-btn.logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.message {
    display: flex;
    gap: 1.25rem;
    max-width: 85%;
    animation: messageSlideIn 0.6s ease;
}

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

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

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.message.user .message-avatar {
    background: var(--gradient-1);
}

.message.agent .message-avatar {
    background: var(--gradient-3);
}

.message-content {
    background: var(--surface);
    padding: 1.25rem 1.75rem;
    border-radius: var(--border-radius);
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

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

.message-content:hover::before {
    left: 100%;
}

.message-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.message.user .message-content {
    background: var(--gradient-1);
    border: 1px solid var(--primary-color);
}

.message-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-2);
    opacity: 0;
    border-radius: var(--border-radius);
    transition: opacity 0.3s ease;
    z-index: -1;
}

.message-content:hover .message-glow {
    opacity: 0.15;
    animation: message-glow 3s infinite alternate;
}

@keyframes message-glow {
    from { opacity: 0.15; }
    to { opacity: 0.25; }
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Image Message Styles */
.message-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.message-image:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.image-message {
    position: relative;
}

.image-message .message-content {
    padding: 1rem;
    overflow: hidden;
}

.image-message img {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

.image-message .image-caption {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    width: fit-content;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
}

.typing-indicator span {
    width: 12px;
    height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.6s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-12px); }
}

.chat-input-container {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 2rem 2.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--glass-border);
    position: relative;
    transition: var(--transition);
}

.chat-input-container.drag-over {
    background: rgba(139, 92, 246, 0.15);
    border: 2px dashed var(--primary-color);
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input-area {
    background: rgba(42, 42, 42, 0.8);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    padding: 1.25rem 1.75rem;
    transition: var(--transition);
    position: relative;
}

.chat-input-area:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.15);
}

.chat-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    resize: none;
    max-height: 140px;
    transition: var(--transition);
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

.chat-input:focus {
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.input-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-1);
    transition: var(--transition);
}

.chat-input:focus ~ .input-underline {
    width: 100%;
}

.input-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.input-image-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.input-image-item:hover {
    transform: scale(1.08);
    border-color: var(--primary-color);
}

.input-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.input-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: var(--transition);
}

.input-image-item:hover .input-image-remove {
    opacity: 1;
}

.paste-image-hint {
    position: absolute;
    bottom: -35px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    transition: var(--transition);
}

.paste-image-hint:hover {
    opacity: 1;
}

.voice-btn, .send-btn, .image-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.voice-btn {
    background: rgba(42, 42, 42, 0.8);
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
}

.voice-btn:hover {
    background: var(--surface-hover);
    transform: scale(1.08);
}

.voice-btn.recording {
    background: var(--error) !important;
    animation: recording-pulse 2s infinite;
}

@keyframes recording-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.image-btn {
    background: rgba(42, 42, 42, 0.8);
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
}

.image-btn:hover {
    background: var(--surface-hover);
    transform: scale(1.08);
}

.send-btn {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.5);
}

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

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.7s ease-out;
}

@keyframes ripple {
    to {
        transform: scale(4.5);
        opacity: 0;
    }
}

/* Account Modal - Futuristic Redesign */
.account-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease;
}

.account-content {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--border-radius);
    padding: 3rem;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    animation: slideUp 0.4s ease;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.account-header h2 {
    font-size: 1.8rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
    background: var(--surface-hover);
}

/* Notification - Futuristic Redesign */
.notification {
    position: fixed;
    top: 40px;
    right: 40px;
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    display: none;
    align-items: center;
    gap: 1.25rem;
    z-index: 1000;
    animation: slideIn 0.4s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

.notification.success {
    border-left: 5px solid var(--success);
}

.notification.error {
    border-left: 5px solid var(--error);
}

.notification.info {
    border-left: 5px solid var(--primary-color);
}

.notification-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    opacity: 0.1;
    border-radius: var(--border-radius);
    animation: notification-glow 3s infinite alternate;
}

@keyframes notification-glow {
    from { opacity: 0.1; }
    to { opacity: 0.2; }
}

/* Image Preview Modal - Futuristic Redesign */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease;
}

.image-preview-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease;
}

.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.image-preview-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.image-preview-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-preview-body img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.image-preview-actions {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
}

.image-preview-actions .btn {
    width: auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Responsive Design - Enhanced */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.6);
    }
    
    .chat-sidebar.open {
        left: 0;
    }
    
    .chat-main {
        width: 100%;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-actions {
        display: none;
    }
    
    .chat-messages {
        padding: 1.5rem;
    }
    
    .message {
        max-width: 92%;
    }
    
    .chat-input-container {
        padding: 1.5rem;
    }
    
    .voice-btn, .send-btn, .image-btn {
        width: 52px;
        height: 52px;
    }
    
    .chat-input {
        font-size: 16px;
    }
    
    .paste-image-hint {
        display: none;
    }
    
    .auth-card {
        padding: 2.5rem;
    }
    
    .notification {
        top: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
    
    .chat-item-delete {
        opacity: 1;
    }
    
    .sphere-1, .sphere-2, .sphere-3, .sphere-4, .sphere-5 {
        filter: blur(100px);
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem;
    }
    
    .chat-header {
        padding: 1.5rem 2rem;
    }
    
    .header-title h2 {
        font-size: 1.3rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .voice-btn, .send-btn, .image-btn {
        width: 48px;
        height: 48px;
    }
    
    .sidebar-header {
        padding: 2rem;
    }
    
    .sidebar-footer {
        padding: 1.5rem;
    }
    
    .user-avatar {
        width: 48px;
        height: 48px;
    }
    
    .account-content {
        padding: 2rem;
    }
}
