* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: #2d2d2d;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #404040;
}

.chat-header {
    background: #404040;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subtitle {
    font-size: 0.9rem;
    color: #ccc;
    font-style: italic;
    opacity: 0.8;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #2d2d2d;
    color: white;
}

.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-in;
}

.message-icon {
    display: flex;
    align-items: flex-start;
    margin-top: 4px;
}

.message-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
}

.user-message .message-content {
    background: #4a4a4a;
    color: white;
    border-bottom-right-radius: 6px;
    border: 1px solid #666;
}

.assistant-message .message-content {
    background: #3a3a3a;
    color: white;
    border-bottom-left-radius: 6px;
    border: 1px solid #555;
}

.system-message .message-content {
    background: #2a4a6b;
    color: #87ceeb;
    border-bottom-left-radius: 6px;
    text-align: center;
    font-style: italic;
    border: 1px solid #4a6b8a;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #3a3a3a;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: 70%;
    border: 1px solid #555;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot: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; }
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid #555;
    background: #2d2d2d;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

#messageInput {
    flex: 1;
    border: 2px solid #555;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #3a3a3a;
    color: white;
}

#messageInput:focus {
    border-color: #87ceeb;
}

#messageInput:disabled {
    background: #2a2a2a;
    cursor: not-allowed;
    color: #888;
}

.send-button {
    background: #4a4a4a;
    color: white;
    border: 1px solid #666;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(135, 206, 235, 0.3);
    background: #5a5a5a;
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.char-count {
    color: #ccc;
}

.clear-button {
    background: none;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.clear-button:hover {
    background: #ff6b6b;
    color: white;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        width: 95%;
        height: 95vh;
        border-radius: 15px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-header h1 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .logo {
        width: 64px;
        height: 64px;
    }
    
    .message-icon img {
        width: 28px;
        height: 28px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-container {
        padding: 15px;
    }
} 