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

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
    scroll-behavior: smooth;
}

.chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    text-align: center;
    margin-bottom: 30px;
}

.chat-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.02);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
    min-height: 600px;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: fit-content;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #059669, #0d9488);
}

.message-content {
    background: rgba(255,255,255,0.05);
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 80%;
    border: 1px solid rgba(255,255,255,0.1);
    line-height: 1.5;
}

.message.user .message-content {
    background: rgba(79,70,229,0.2);
    border-color: rgba(79,70,229,0.3);
}

.message.ai .message-content {
    background: rgba(5,150,105,0.2);
    border-color: rgba(5,150,105,0.3);
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.typing-indicator.show {
    display: flex;
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #059669;
    animation: typing 1.4s infinite;
}

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

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

.input-section {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}

.input-container {
    display: flex;
    align-items: center; /* keep input + button on the same line */
    gap: 10px;
}

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

#messageInput {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 15px 20px;
    color: white;
    font-size: 16px;
    resize: none;
    min-height: 50px;
    max-height: 120px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

#messageInput:focus {
    border-color: rgba(79,70,229,0.5);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    background: rgba(255,255,255,0.08);
}

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

/* --- Send button redesigned as icon-only --- */
.send-button {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79,70,229,0.3);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-icon {
    width: 22px;
    height: 22px;
}

.welcome-message {
    text-align: center;
    color: rgba(255,255,255,0.7);
    margin: 20px 0;
    font-style: italic;
}

.sample-questions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.sample-question {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.sample-question:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(79,70,229,0.3);
    transform: translateY(-2px);
}

.error-message {
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    color: #fca5a5;
}

.status-indicator {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s ease;
}

.status-indicator.online {
    background: rgba(5,150,105,0.2);
    border: 1px solid rgba(5,150,105,0.5);
    color: #10b981;
}

.status-indicator.offline {
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.5);
    color: #f87171;
}

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

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

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

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

@media (prefers-reduced-motion: reduce) {
    .message {
        animation: none;
    }
    .typing-dot {
        animation: none;
    }
    .chat-window {
        backdrop-filter: none;
    }
}

@media (max-width: 768px) {
    .chat-container {
        padding: 30px 10px 10px;
    }
    
    .chat-header h1 {
        font-size: 2rem;
    }
    
    .chat-header {
        padding: 30px 20px;
        margin-bottom: 10px;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .sample-questions {
        grid-template-columns: 1fr;
    }
}

::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}
