@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;700&display=swap');

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: #0a0a0f;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* Animated Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f23 50%, #000000 100%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #00d4ff, transparent),
        radial-gradient(2px 2px at 40px 70px, #0066ff, transparent),
        radial-gradient(1px 1px at 90px 40px, #00ffff, transparent),
        radial-gradient(1px 1px at 130px 80px, #0099ff, transparent),
        radial-gradient(2px 2px at 160px 30px, #00d4ff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-particles::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #00d4ff 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
    opacity: 0.1;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100vh) rotate(360deg); }
}

/* Main Container */
.chat-container {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 95vh;
    margin: 2.5vh auto;
    background: rgba(10, 10, 15, 0.9);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 
        0 0 50px rgba(0, 212, 255, 0.3),
        inset 0 0 50px rgba(0, 212, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-header {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 102, 255, 0.1) 100%);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
}

.ai-avatar {
    position: relative;
    width: 60px;
    height: 60px;
}

.avatar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.avatar-core {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0, 212, 255, 0.5);
}

.ai-icon {
    width: 40px;
    height: 40px;
}

.eye {
    animation: blink 3s ease-in-out infinite;
}

@keyframes blink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0; }
}

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

.header-text h1 {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(45deg, #00d4ff, #0066ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.header-text p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-bottom: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse-green 2s ease-in-out infinite;
}

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

.neural-network {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 60px;
}

.node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(0, 212, 255, 0.8);
    border-radius: 50%;
    animation: neural-pulse 1.5s ease-in-out infinite;
}

.node:nth-child(1) { top: 0; left: 0; animation-delay: 0s; }
.node:nth-child(2) { top: 50%; right: 0; animation-delay: 0.5s; }
.node:nth-child(3) { bottom: 0; left: 20px; animation-delay: 1s; }

.connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
    animation: data-flow 2s ease-in-out infinite;
}

.connection:nth-child(4) {
    top: 4px;
    left: 8px;
    width: 80px;
    transform: rotate(15deg);
}

.connection:nth-child(5) {
    bottom: 4px;
    left: 28px;
    width: 60px;
    transform: rotate(-25deg);
    animation-delay: 1s;
}

@keyframes neural-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

@keyframes data-flow {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #00d4ff, #0066ff);
    border-radius: 10px;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00d4ff, #0066ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.mini-avatar.typing {
    animation: typing-pulse 1s ease-in-out infinite;
}

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

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

.user-message .mini-avatar {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

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

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sender-name {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #00d4ff;
}

.user-message .sender-name {
    color: #ff6b6b;
}

.timestamp {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.message-text {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    padding: 15px 20px;
    position: relative;
}

.user-message .message-text {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
}

.message-text::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, rgba(0, 212, 255, 0.3), transparent);
    border-radius: 15px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-text:hover::before {
    opacity: 1;
}

.user-highlight {
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    padding: 0 20px 10px;
    gap: 15px;
    align-items: center;
}

.typing-content {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    padding: 15px 20px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #00d4ff;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.chat-input-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 5px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.input-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00d4ff, #0066ff, #00d4ff);
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.input-wrapper:focus-within .input-glow {
    opacity: 0.3;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 20px;
    color: #ffffff;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
    outline: none;
}

#messageInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#sendButton {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #00d4ff, #0066ff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

#sendButton:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

#sendButton:active {
    transform: scale(0.95);
}

.send-icon {
    width: 20px;
    height: 20px;
    color: #000;
}

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

.quick-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .header-text h1 {
        font-size: 24px;
    }
    
    .neural-network {
        display: none;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-actions {
        justify-content: center;
    }
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

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