* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f0f0f0;
    height: 100vh;
    overflow: hidden;
}

.chat-interface {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
}

.avatar-section {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #202020;
    height: 300px;
    z-index: 10;
}

#avatar {
    width: 100%;
    height: 100%;
}

#loading {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: white;
    text-align: center;
    font-size: 16px;
}

.chat-container {
    position: fixed;
    top: 300px; /* Height of avatar section */
    bottom: 130px; /* Height of input area + tab bar */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
}

.message.bot {
    margin-right: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 8px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* Welcome Screen Styles */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(180deg, #e6f7ff 0%, #f0f9ff 100%);
    z-index: 1000;
}

.welcome-text, .new-text {
    text-align: center;
    color: #333;
    font-size: 16px;
    margin: 40px 0 15px;
    max-width: 280px;
    line-height: 1.4;
}

.continue-btn {
    background-color: #e51754;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 40px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 40px;
    width: 280px;
}

.new-btn {
    background-color: #ad1b1b;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 40px;
    font-size: 16px;
    cursor: pointer;
    width: 280px;
}

.warning-text {
    text-align: center;
    color: #333;
    font-size: 14px;
    margin-top: 15px;
    max-width: 280px;
    line-height: 1.4;
}

.message-content {
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background: #000000;
    color: white;
}

.input-area {
    position: fixed;
    bottom: 60px; /* Height of tab bar */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    z-index: 20;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 24px;
}

#question-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 16px;
    outline: none;
}

.send-btn, .voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #e51754;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn:hover, .voice-btn:hover {
    background: #d41549;
}

.send-btn svg, .voice-btn svg {
    width: 20px;
    height: 20px;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    z-index: 20;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
}

.tab.active {
    background: #e51754;
    color: white;
}

/* Voice button recording state */
.voice-btn.recording {
    background-color: #ff4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-interface,
    .avatar-section,
    .chat-container,
    .input-area,
    .tab-bar {
        max-width: none;
        left: 0;
        transform: none;
    }
    
    .chat-container {
        width: 100%;
    }
}

/* Scrollbar styling */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
