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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f0f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    height: 100%;
    max-width: 500px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.chat-header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
}

.chat-header-content {
    display: flex;
    align-items: center;
}

.chat-header img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

.message {
    max-width: 80%;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 20px;
    animation: fadeIn 0.3s ease-out;
    word-wrap: break-word;
}

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

.user-message {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message {
    align-self: flex-start;
    background-color: #e9e9e9;
    border-bottom-left-radius: 5px;
}

.input-area {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #ddd;
}

#user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
}

#send-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-left: 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: #0056b3;
}

.source-link {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.source-tooltip {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.source-link:hover .source-tooltip {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 600px) {
    body {
        align-items: stretch;
    }
    .app-container {
        max-width: none;
        max-height: none;
        height: 100vh;
        border-radius: 0;
    }
}
