html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: sans-serif;
}

/* Chat container takes full height of its parent */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Use 100% to fit in parent container */
    width: 100%;
    background: #f4f4f8;
    position: relative;
}

.chat-container h2 {
    background-color: #003366;
    color: white;
    padding: 10px;
    margin: 10px;
    text-align: center;
    border-radius: 20px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-bottom: 70px; /* Add space for input container */
}

.message {
    padding: 10px 15px;
    max-width: 70%;
    border-radius: 20px;
    line-height: 1.4;
    word-wrap: break-word;
}

.sent {
    background-color: #b3d9ff;
    align-self: flex-end;
}

.received {
    background-color: #fff;
    align-self: flex-start;
}

.input-container {
    display: flex;
    padding: 10px;
    background: #eee;
    border-top: 1px solid #ccc;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10; /* Lower z-index to not overlap MudDrawer */
    box-sizing: border-box;
}

.input-container input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: none;
    margin-right: 10px;
}

.input-container .send-button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #003366;
    color: white;
    cursor: pointer;
}

.input-container .send-button:hover {
    background-color: #0069c6;
}

.input-container .cancel-button {
    padding: 10px;
    border: none;
    border-radius: 20px;
    background-color: #f44336;
    color: white;
    cursor: pointer;
}

.input-container .cancel-button:hover {
    background-color: #d32f2f;
}

.input-container .cancel-wrapper {
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, margin 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none; /* prevents clicking when hidden */
}

.input-container .cancel-wrapper.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    width: auto;
    margin-right: 10px;
}

.input-container .cancel-wrapper.hide {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    width: 0;
    margin-right: 0;
    overflow: hidden;
}

.suggestions-container {
    background: #eee;
}

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

.suggestions-container .link-button {
    background: none;
    border: none;
    color: gray;
    text-decoration: underline;
    cursor: pointer;
    padding: 10px;
    padding-top: 0;
    font: inherit;
    animation: fadeIn 0.3s ease-in;
}
.suggestions-container .link-button:hover {
    color: black;
    transition: color 0.2s ease;
}

/* Thinking indicator */
.thinking-indicator {
    font-family: sans-serif;
    font-size: 14px;
    color: #444;
    white-space: nowrap; /* Prevent line breaks within the indicator */
}

.dots::after {
    content: '';
    display: inline-block;
    width: 1em;
    text-align: left;
    animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}

/* Media Queries for Responsive Design */

/* General mobile styling for small screens */
@media screen and (max-width: 991px) {
    .chat-container {
        max-height: 100vh;
    }

    .messages {
        max-height: calc(100vh - 120px);
    }

    .input-container {
        padding: 8px;
    }

    .message {
        max-width: 85%;
    }

    /* Hide suggestions on all mobile-sized screens */
    .suggestions-container {
        display: none !important;
    }
}

/* Additional safety measure - use touch detection */
@media (hover: none) {
    .suggestions-container {
        display: none !important;
    }
}