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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.chat-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 700px;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}

.profile-info h1 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.profile-info p {
    font-size: 0.9rem;
    opacity: 0.9;
}

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

.message {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message .message-content {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-wrapper {
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    background: #fafafa;
}

.chat-input {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 8px 12px;
    transition: border-color 0.3s;
}

.chat-input:focus-within {
    border-color: #667eea;
}

#userInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
}

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

.question-counter {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

#questionsLeft {
    font-weight: bold;
    color: #667eea;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f0f0f0;
    border-radius: 12px;
    width: fit-content;
}

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

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

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

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

.redirect-message {
    text-align: center;
    padding: 20px;
    background: #f0f7ff;
    border: 2px solid #667eea;
    border-radius: 12px;
    margin: 10px 0;
}

.redirect-message a {
    color: #667eea;
    font-weight: bold;
    text-decoration: none;
}

.redirect-message a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .chat-wrapper {
        height: 95vh;
        max-height: none;
    }

    .profile-image {
        width: 50px;
        height: 50px;
    }

    .profile-info h1 {
        font-size: 1.1rem;
    }

    .profile-info p {
        font-size: 0.85rem;
    }

    .message-content {
        max-width: 85%;
        font-size: 0.95rem;
    }

    .chat-messages {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .profile-section {
        gap: 10px;
    }

    .profile-image {
        width: 45px;
        height: 45px;
    }

    .profile-info h1 {
        font-size: 1rem;
    }

    .message-content {
        max-width: 90%;
    }
}
