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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(0deg, #f3f4f6 0%, #1e293b 80%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

.header {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 10px;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header img {
    position: absolute;
    left: 0px;
    top: 0px;
    display: none;
    height: 10px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.header p {
    font-size: 1.5em;
    color: #fcf;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 120px;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

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

.message-content {
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 6px;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.avatar {
    width: 62px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user .avatar {
    background: #667eea;
    color: white;
}

.message.assistant .avatar {
    background: #f86403;
    color: white;
}

.input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

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

#messageInput {
    width: 70%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
    max-height: 120px;
}

#messageInput:focus {
    border-color: #667eea;
}

.send-button {
    background: #667eea;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-size: 18px;
}

.send-button:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

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

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

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

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

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

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }

    .chat-container {
        padding: 15px;
        padding-bottom: 110px;
    }

    .message-content {
        font-size: 15px;
        max-width: 85%;
    }

    .input-container {
        padding: 12px 15px;
    }

    #messageInput {
        font-size: 16px;
    }
}
