/* Basic reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(45deg, #f7c9fc, #ffecd2);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Stack elements vertically */
    padding: 10px;
}

/* Chat container */
#chat-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    width: 100%; /* Full width */
    max-width: 400px; /* Limit width on larger screens */
    max-height: 70vh;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    position: relative;
    animation: fadeIn 1s ease-out;
}

/* Chat title */
#chat-container h2 {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    text-align: center;
    margin-bottom: 15px;
}

/* Chat message styles */
.chat-message {
    padding: 12px;
    margin: 10px 0;
    border-radius: 10px;
    max-width: 80%;
    font-size: 16px;
    line-height: 1.4;
    transition: transform 0.2s ease-in-out;
    word-wrap: break-word;
    white-space: pre-wrap; /* Ensure newlines are respected */
}

/* User message style */
.chat-bot {
    background: #e0f7fa;
    align-self: flex-start; /* Align user message to the left */
    border: 1px solid #b2ebf2;
    margin-left: 0; /* Align at the left edge */
}

/* Bot message style */
.chat-user {
    background: #ffe0b2;
    align-self: flex-end; /* Align bot message to the right */
    border: 1px solid #ffcc80;
    margin-right: 0; /* Align at the right edge */
}

/* Input and button wrapper */
.input-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%; /* Full width to match the chat-container */
    max-width: 400px; /* Match max-width of chat-container */
    padding-top: 10px;
    justify-content: space-between;
}

/* Input field styles */
#message-input {
    width: 75%;
    padding: 15px;
    font-size: 16px;
    border-radius: 25px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

#message-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

/* Send button styles */
#send-button {
    width: 20%;
    padding: 15px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#send-button:hover {
    background-color: #45a049;
}

/* Chat container fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
#chat-container::-webkit-scrollbar {
    width: 8px;
}

#chat-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

#chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* Media Queries for responsive design */
@media (max-width: 768px) {
    /* On medium screens, make the chat-container wider and input smaller */
    #chat-container {
        max-width: 90%; /* Use more space on smaller screens */
    }

    .input-wrapper {
        max-width: 90%; /* Make input-wrapper match chat-container on smaller screens */
    }

    #message-input {
        width: 70%; /* Input takes more space */
    }

    #send-button {
        width: 25%; /* Button takes up more space */
    }
}

@media (max-width: 480px) {
    /* On small screens, adjust the chat container further */
    #chat-container {
        max-width: 95%;
        padding: 15px;
    }

    .input-wrapper {
        max-width: 95%; /* Ensure input-wrapper fits smaller screen sizes */
    }

    #message-input {
        width: 70%;
        padding: 12px;
    }

    #send-button {
        width: 28%;
        padding: 12px;
    }

    #chat-container h2 {
        font-size: 18px; /* Adjust title size */
        margin-bottom: 10px;
    }
}

  /* CSS Styles */
  #spinner {
    display: none; /* Hide the spinner initially */
    font-size: 24px;
    color: #3498db;
  }

  #loading-button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    text-align: center;
  }

  #loading-button:hover {
    background-color: #2980b9;
  }

  .loading {
    pointer-events: none; /* Disable the button when loading */
  }

  #loader {
    font-size: 25px;
    text-align: center;
  }


.kakao-ad {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    width: 100%; /* Full width */
    max-width: 400px; /* Limit width on larger screens */
    max-height: 70vh;
    /* background: #fff; */
    border-radius: 15px;
    margin-top: 20px;
    /* overflow-y: auto; */
    /* position: relative; */
    /* animation: fadeIn 1s ease-out; */
}