body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Horizontally center the container */
    transition: background-image 3s ease-in-out; /* Fade-in effect */
    background-attachment: fixed; /* Fixes the background image */
    background-size: cover; /* Ensures the background image covers the entire viewport */
    background-repeat: no-repeat; /* Prevents tiling of the background image */
    background-position: center; /* Centers the background image */
}
h1 {
    text-align: center;
    margin-bottom: 10px;
    color: black;
    background-color: rgba(255, 255, 255, 0.5); 
    padding: 10px;
    border-radius: 10px; /* Optional: Add rounded corners */
}

.chat-container {
    max-width: 600px; /* Fixed width for desktop displays */
    max-height: 95vh; /* Maximum height: 95% of the viewport height */
    width: 100%; /* Full width on smaller screens */
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column; /* Stack chat box and input vertically */
    gap: 10px; /* Add spacing between elements */
    margin-top: 0; /* Ensure it starts at the top */
    align-self: center; /* Center horizontally */
    position: relative; /* For proper alignment with respect to the body */
}


.chat-box {
    flex-grow: 1; /* Allow chat box to grow within container */
    max-height: calc(95vh - 150px); /* Adjust based on other elements' heights */
    overflow-y: auto; /* Enable scrolling */
    padding: 10px;
    border: 1px solid #e2e3e5;
    border-radius: 10px;
    background-color: #f9f9f9;
    display: none;
    flex-direction: column; /* Stack messages vertically */
    scroll-behavior: smooth;
}

.chat-box.visible {
    display: flex; /* Show the chat box when the 'visible' class is added */
}

.message {
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    max-width: 75%;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

.user-message {
    background-color: #d1e7dd;
    align-self: flex-end; /* Align user messages to the right */
}

.gpt-message {
    background-color: #e2e3e5;
    align-self: flex-start; /* Align GPT messages to the left */
    font-style: italic;
}

.input-container {
    display: flex;
    width: 100%;
    gap: 5px; /* Add spacing between input and button */
}

.input-container input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    font-size: 16px; /* Prevent iOS zoom */
    outline: none; /* Optional: Remove blue highlight on focus */
}

.input-container button {
    padding: 10px 20px;
    border: none;
    background: #007b00;
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 16px;
}

.gptbold {
    font-weight: bold;
}

.gptnormal {
    font-style: normal;
}

/* Add responsiveness for smaller screens */
@media (max-width: 768px) {
    .chat-container {
        max-width: 90vw; /* Slightly smaller width on mobile */
        max-height: 90vh; /* Slightly smaller height on mobile */
        padding: 15px; /* Reduce padding for smaller screens */
    }
    .chat-box {
        max-height: 70vh; /* Scale height for smaller viewports */
    }
}

@media (max-width: 480px) {
    .chat-container {
        max-width: 85vw; /* Further reduce width */
        max-height: 85vh; /* Further reduce height */
        padding: 10px; /* Minimal padding for small screens */
    }
    .chat-box {
        max-height: 60vh; /* Adjust height for very small screens */
    }

    .message {
        font-size: 12px; /* Smaller font for compact displays */
    }
    .input-container input,
    .input-container button {
        font-size: 14px;
    }
}

.thinking {
    display: none; /* Initially hidden */
    width: 10px; /* Size of the "thinking" indicator */
    height: 10px;
    background-color: #007bff; /* Blue circle to represent "thinking" */
    border-radius: 50%; /* Circular shape */
    position: absolute; /* Position it relative to the chat box */
    bottom: 85px; /* 10px from the bottom of the chat box */
    left: 40px; /* 10px from the left of the chat box */
    animation: pulse 1.5s infinite; /* Pulse animation */
}

.chat-box .thinking-container {
    display: flex; /* Align horizontally within the chat box */
    align-items: center;
    padding: 10px;
}

.chat-box .thinking-container .thinking {
    margin-left: 10px; /* Add some margin from the chat's edge */
}

.nahthinking {
    display: none; /* Initially hidden */
    font-style: italic;
    color: #888;
    position: absolute; /* Place it relative to the chat-box */
    bottom: 10px;
    left: 10px;
    animation: pulse 2.5s infinite; /* Smooth pulsing animation */
}

@keyframes pulse {
    0% {
	transform: scale(0.5);
	opacity: 0.33;
    }
    50% {
	transform: scale(1);
	opacity: 1;
    }
    100% {
	transform: scale(0.5);
	opacity: 0.33;
    }
}

.typing::after {
    content: '|';
    display: inline-block;
    animation: blink 0.6s steps(1) infinite;
    margin-left: 5px;
}

@keyframes blink {
    0%, 100% {
	opacity: 1;
    }
    50% {
	opacity: 0;
    }
}

#reset-guid {
    position: fixed;
    bottom: 5px;
    right: 5px;
    background-color: #f44336; /* Red background */
    color: white;
    padding: 2px 2px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#reset-guid:hover {
    background-color: #d32f2f; /* Darker red on hover */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}


