@import url('typing.css');

body {
    font-family: 'Fredoka', 'Comic Sans MS', cursive, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffe6f2; /* Light pink background */
    background-image: radial-gradient(#ffb6c1 15%, transparent 16%), radial-gradient(#ffb6c1 15%, transparent 16%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.chat-container {
    width: 100%;
    max-width: 600px;
    height: 90vh; /* Slightly less than full height for floating effect */
    background-color: #fff0f5; /* Lavender blush */
    box-shadow: 0 10px 25px rgba(255, 105, 180, 0.3);
    display: flex;
    flex-direction: column;
    border-radius: 25px;
    overflow: hidden;
    border: 5px solid #ff69b4; /* Hot pink border */
    position: relative;
}

@media (max-width: 600px) {
    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        border: none;
    }
}

header {
    background-color: #ff69b4;
    color: white;
    padding: 15px;
    text-align: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.bow {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(255, 255, 255, 0.8);
}

.message {
    max-width: 80%;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.message .text {
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 1rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}

.user-message {
    align-self: flex-end;
    /* Removed flex-direction: row-reverse to keep Text then Avatar order as appended in JS */
}

.user-message .text {
    background-color: #ff69b4;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .text {
    background-color: white;
    color: #d63384;
    border: 2px solid #ffb6c1;
    border-bottom-left-radius: 4px;
}

.avatar {
    width: 35px;
    height: 35px;
    background-color: #ffb6c1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden; /* Ensure image fits in circle */
    flex-shrink: 0;   /* Prevent avatar from squishing */
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.input-area {
    padding: 15px;
    border-top: 2px solid #ffb6c1;
    display: flex;
    gap: 10px;
    background-color: #fff0f5;
}

input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ffb6c1;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    color: #d63384;
    font-family: inherit;
    background-color: white;
    transition: border-color 0.3s;
}

input[type="text"]::placeholder {
    color: #ffb6c1;
}

input[type="text"]:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 5px rgba(255, 105, 180, 0.3);
}

button {
    background-color: #ff69b4;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #d63384;
}

button:hover {
    background-color: #ff1493;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #d63384;
}

button:active {
    transform: translateY(4px);
    box-shadow: none;
}

button:disabled {
    background-color: #ffb6c1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar styling */
.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background: #fff0f5;
}

.chat-box::-webkit-scrollbar-thumb {
    background: #ffb6c1;
    border-radius: 4px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
    background: #ff69b4;
}
