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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    text-align: center;
}

.chat-header h1 {
    color: #1f2937;
    margin-bottom: 5px;
    font-weight: 600;
}

.chat-header p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
}

.session-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: #9ca3af;
}

#session-id {
    font-family: monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

#new-session-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s;
}

#new-session-btn:hover {
    background: #2563eb;
}

.chat-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

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

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

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.user .message-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    color: #6b7280;
    font-size: 14px;
}

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

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

.input-form {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    resize: none;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 120px;
    transition: border-color 0.2s;
}

#message-input:focus {
    outline: none;
    border-color: #3b82f6;
}

#send-btn {
    background: #3b82f6;
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

#send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

#send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6b7280;
}

.empty-state h2 {
    margin-bottom: 8px;
    color: #374151;
}

.empty-state p {
    font-size: 14px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        height: 100vh;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .messages {
        padding: 15px;
    }
    
    .input-form {
        padding: 15px;
    }
}

/* Scrollbar styling */
.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
