/* Import custom fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&display=swap');

/* Base styles */

html {
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    font-family: 'Noto Sans KR', 'Roboto', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 10px;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    width: 100%;
    margin: 0 auto; /*추가*/ 
    padding: 20px;
}

/* Chat container */
#chat-container {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    min-width: 300px;
    width: 100%; /* updated width */
    max-width: 800px;
    height: 500px;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Input container */
#input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-top: 1px solid #ccc;
    width: 100%; /* updated width */
    max-width: 800px; /* added max-width */
    margin: 0 auto; /* added margin */
}

/* User input */
#user-input {
    flex-grow: 1;
    font-size: 1rem;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px; /* added margin */
}

/* Send button */
#send-btn {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 24px;
    margin-left: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease-in-out;
}

#send-btn:hover {
    background-color: #3c8c40;
}

/* Message styles */
.user-message,
.assistant-message {
    display: inline-block;
    max-width: 70%;
    font-size: 1rem;
    line-height: 1.5;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 20px;
    word-wrap: break-word;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-message {
    background-color: #3f51b5;
    color: #fff;
    margin-left: 10px;
    align-self: flex-end;
    text-align: justify;
    text-justify: inter-word;
}

.user-message::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 8px solid #3f51b5;
}

.assistant-message {
    position: relative;
    background-color: #f1f1f1;
    color: #333;
    margin-right: 60px;
    align-self: flex-start;
    text-align: justify;
    text-justify: inter-word;
    padding-top: 16px; /* decreased from 40px */
    padding-bottom: 12px;
}

.assistant-message::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 10px solid #f1f1f1;
    transform: translateY(-50%);
}

.robot-image {
    position: absolute;
    width: 40px;
    height: auto;
    left: 10px; /* increased from -40px */
    top: 50%;
    transform: translateY(-50%);
}

.loading-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
}

.loading-icon i {
    font-size: 24px;
    color: #ccc;
}

.kakao-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 350px;
    min-height: 50px;
}

/* Custom scrollbar styles */
#chat-container::-webkit-scrollbar {
    width: 12px;
}

#chat-container::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 10px;
}

#chat-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/* Responsive styles */
@media (max-width: 1024px) {
    #chat-container {
        width: 90%;
    }
}

@media (max-width: 767px) {
    #input-container {
        width: 100%;
    }

    #chat-container {
        width: 100%;
    }
}