* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: #ececf1;
}

#chat-box {
    position: relative;
    background: url('/static/background_chatbot.png') no-repeat center center;
    background-size: cover;
    padding: 20px;
    border-radius: 12px;
    max-width: 700px;
    margin: 30px auto;
    height: 500px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#chat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: -1;
}

.message {
    padding: 12px 16px;
    margin: 12px 0;
    max-width: 85%;
    border-radius: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.user {
    background-color: #dcf2ff;
    align-self: flex-end;
    margin-left: auto;
    text-align: left;
    color: #0b69a3;
    border: 1px solid #b7e1f8;
}

.bot {
    background-color: #f7f7f8;
    align-self: flex-start;
    margin-right: auto;
    text-align: left;
    color: #444;
    border: 1px solid #ddd;
}

#input-area {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    max-width: 700px;
    margin: auto;
    padding-top: 20px;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background-color: #FF5822; /* Updated button color */
    color: white;
    font-weight: normal; /* Updated to make text not bold */
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    font-family: 'Open Sans', sans-serif; /* Updated font family */
}

button:hover {
    background-color: #e04a1d; /* Slightly darker shade for hover effect */
}

.typing-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    gap: 4px;
    padding: 6px 10px;
    background-color: #eee;
    border-radius: 16px;
    margin: 5px 0;
}

.typing-bubble .dot {
    width: 6px;
    height: 6px;
    background-color: #888;
    border-radius: 50%;
    animation: blink 1.4s infinite ease-in-out;
}

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

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

@keyframes blink {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Suggestions */
#suggestions-container {
    display: block;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    margin-top: 4px;
    max-width: 90%;
}

#suggestions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-button {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    background-color: #FF5822; /* Updated button color */
    color: white; /* Ensure text is readable on orange background */
    border: 1px solid #ccc;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    min-width: 0;                /* Allow shrinking below content size */
    width: auto;                 /* Let the button size to its content */
    white-space: normal;         /* Allow text to wrap */
    overflow-wrap: anywhere;     /* Break long words if needed */
    word-break: break-word;      /* Break words at arbitrary points if needed */
    font-family: 'Open Sans', sans-serif; /* Updated font family */
    font-weight: normal; /* Updated to make text not bold */
}

.suggestion-button:hover {
    background-color: #e04a1d; /* Slightly darker shade for hover effect */
    color: white; /* Maintain text readability */
}

#toggle-suggestions {
    font-size: 12px;
    background: none;
    border: none;
    color: #007BFF;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

#toggle-suggestions:hover {
    background-color: transparent;
    text-decoration: none;
}

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

    #chat-box {
        max-width: 100%;
        height: auto;
        overflow-y: visible;
        padding: 10px;
        margin: 10px auto;
    }

    #input-area {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 10px;
        max-width: 100%;
    }

    input[type="text"],
    button {
        font-size: 16px;
        width: 100%;
    }

    #suggestions-container {
        max-width: 100%;
        margin: 0 10px;
    }

    .suggestion-button {
        width: 100%;             /* Make each button take full width on small screens */
        font-size: 14px;
        white-space: normal; /* allow wrapping on small screens */
        overflow-wrap: anywhere;
        word-break: break-word;
        margin-bottom: 6px;      /* Optional: add spacing between buttons */
    }

    #toggle-suggestions {
        font-size: 14px;
        padding: 8px 0;
    }
}
