﻿/* Reset some basic styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: large;
    background: white;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Full viewport height */
    overflow: hidden; /* Prevent the overall page from scrolling */
}

/* Top bar styling */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    color: white;
    padding: 10px 20px;
    position: sticky; /* Make top bar sticky */
    top: 0; /* Stick to the top */
    z-index: 10; /* Ensure it stays above other content */
}

.top-button {
    background-color: #555;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.top-button:hover {
    background-color: #777;
}

.messages {
    display: flex;
    flex-direction: column;
}

/* General message styling */
.message {
    font-size: medium;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    max-width: 70%; /* Limit message width */
}

/* Client message styling */
.sent {
    background-color: hwb(236 27% 0%);
    color: white; /* White text */
    align-self: flex-end; /* Align to the right */
}

/* Server message styling */
.received {
    background-color: hsl(0, 0%, 40%);
    color: white; /* White text */
    align-self: flex-start; /* Align to the left */
}

/* Make a ended message, which is centered in the chat container, has a grey outline, but no filling and the text is likewise grey and in italics */
.ended {
    background-color: transparent;
    color: rgb(178, 178, 178);
    text-align: center;
    font-style: italic;
    margin-left: auto;
    margin-right: auto;
}

.message.typing {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.message.typing .dot {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: white;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.message.typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.message.typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}


/* General reset for box-sizing to include padding and border in the width/height calculations */
* {
    box-sizing: border-box;
}

/* Chat pane styling */
.chat-pane {
    flex: 1; /* This allows the chat pane to grow and fill available space */
    overflow-y: auto; /* Enables scrolling when content overflows */
    padding: 20px;
    background-color: white;
    max-width: 100%; /* Ensure it does not exceed the screen width */
    width: 100%; /* Full width for responsiveness */
    margin: 0 auto; /* Center the chat pane horizontally */
}

/* Input wrapper styling */
.input-wrapper {
    position: sticky; /* Make input wrapper sticky */
    bottom: 0; /* Stick to the bottom */
    z-index: 10; /* Ensure it stays above other content */
    background-color: white; /* Background color to match input area */
    width: 100%; /* Ensure full width of the container */
    display: flex; /* Flex container to center the input area */
    justify-content: center; /* Center content horizontally */
    min-height: 80px; /* Set a minimum height for the input area */
}

/* Input area styling */
.input-area {
    display: flex;
    align-items: flex-start; /* Align items to the top of the container */
    padding: 10px;
    background-color: white;
    max-width: 800px; /* Match max-width of the chat pane */
    width: 100%; /* Full width for responsiveness */
    margin: 0 auto; /* Center the input area horizontally */
}

/* Textarea styling */
.chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: large;
    resize: none; /* Prevent manual resizing */
    overflow-y: auto; /* Enable scrolling if max-height is reached */
    max-height: 20vh; /* Set maximum height to one-third of the viewport height */
    min-height: 60px; /* Set minimum height to prevent collapsing */
    width: 100%; /* Full width for responsiveness */
}

/* Send button styling */
.send-button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px; /* Set padding for a consistent size */
    cursor: pointer;
    border-radius: 4px;
    height: auto; /* Fixed height to prevent scaling with textarea */
    align-self: flex-start; /* Align button to the top of the expanding input area */
}

.send-button:hover {
    background-color: #555;
}

/* Bottom bar styling */
.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    color: white;
    padding: 10px 20px;
    position: sticky; /* Make bottom bar sticky */
    bottom: 0; /* Stick to the bottom */
    z-index: 10; /* Ensure it stays above other content */
}

/* Responsive design adjustments */
@media (max-width: 600px) {
    .top-bar {
        justify-content: space-between; /* Keep elements spaced */
        padding: 5px 10px; /* Reduce padding */
    }

    .bottom-bar {
        justify-content: space-between; /* Keep elements spaced */
        padding: 5px 10px; /* Reduce padding */
    }

    .top-button {
        padding: 8px; /* Reduce padding for button */
    }

    .chat-input {
        margin-right: 5px; /* Reduce margin for input field */
        font-size: medium; /* Reduce font size for input field */
    }

    .input-area {
        flex-direction: row; /* Ensure input area elements are in a row */
    }

    .send-button {
        height: auto; /* Slightly smaller height for mobile devices */
        padding: 8px 16px; /* Smaller padding for mobile devices */
    }


}

.top-button, #change-login-btn, #login-btn {
    font-size: medium; /* Default font size */
}
/* Responsive design adjustments for larger screens */
@media (min-width: 768px) {
    .chat-pane,
    .input-area {
        max-width: 1200px; /* Adjust max-width for larger screens */
    }
    .top-bar,
    .bottom-bar {
        padding: 20px 40px; /* Increased padding for larger screens */
    }
    .top-button, #change-login-btn, #login-btn, .send-button {
        font-size: 1.2rem; /* Increased font size for buttons on larger screens */
        padding: 12px 24px; /* Optional: Increase padding for larger screens */
    }
    .messages {
        font-size: large;
    }
    .message {
        font-size: x-large;
    }
    .chat-input {
        font-size: x-large;
    }
    
}

/* Remaining styles from the old stylesheet */

/* Additional styles from the old stylesheet */


.field-container {
    margin-bottom: 20px;  /* Add space at the bottom of each field-container */
}

#login-container {
    flex: 1; /* This allows the form to grow and fill available space */
    width: 100%; /* Use full width */
    max-width: 600px; /* Optional, set a max-width for better readability */
    margin: auto; /* Center the form horizontally */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center content horizontally */
    padding: 20px; /* Add some padding for spacing */
    box-sizing: border-box; /* Include padding in width calculations */
}

.field-container label {
    float: left;
}

.field-container input {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: large;
    float: right;
    padding: 4px;
    width: 60%;
}

#change-login-btn {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    float: right;
    margin: 8px;
    border: 2px solid white;  /* White border */
    background-color: transparent;  /* Transparent background */
    color: white;  /* Text color */
    font-size: large;
    padding: 7px;
    padding-bottom: 7px;
    padding-top: 5px;
    transition-property: background-color 0.3s ease;
}

#login-btn {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    float: right;
    border: 2px solid white;  /* White border */
    background-color: #333;  
    color: white;  /* Text color */
    font-size: large;
    padding: 5px;
    padding-bottom: 7px;
    transition-property: background-color 0.3s ease;
}

#change-login-btn:hover, #login-btn:hover {
    background-color: rgb(87, 87, 87);
}

#change-login-btn:active, #login-btn:active {
    background-color: rgb(123, 123, 123);  /* Background color changes to white on click */
}

button, input[type="text"], input[type="password"] {
    border-radius: 5px;
}

button {
    background-color: #555;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: large;
}

button:hover {
    background-color: rgb(87, 87, 87);
}

#fade-overlay {
    position: fixed;
    bottom: 0;
    margin-bottom: 4cm;
    left: 0;  /* Adjust to align with your chat container */
    right: 0;  /* Adjust to align with your chat container */
    height: 50px;  /* Your desired height */
    background: linear-gradient(to top, beige 50% , rgba(255, 255, 255, 0) 80%);
    pointer-events: none;
}

/* Additional Responsive Design Adjustments */
@media (max-width: 600px) {
    #login-container {
        width: calc(100% - 2cm);
        margin: 1cm;
        margin-top: 4cm;
    }
    .field-container input {
        float: left;
        font-size: medium;
    }
    .field-container label {
        float: left;
        font-size: medium;
    }

}

.fade-in {
    opacity: 0;
    animation: fadeIn ease-in 0.1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Universal scrollbar styles for WebKit browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
    height: 8px; /* Height of the scrollbar for horizontal scrolling */
}

*::-webkit-scrollbar-track {
    background: #f1f1f1; /* Background color of the scrollbar track */
    border-radius: 10px; /* Rounded corners for the track */
}

*::-webkit-scrollbar-thumb {
    background-color: #888; /* Color of the scrollbar thumb */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 2px solid #f1f1f1; /* Padding around the thumb */
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #555; /* Color of the scrollbar thumb when hovered */
}

/* Universal scrollbar styles for Firefox */
* {
    scrollbar-width: thin; /* Makes the scrollbar thinner */
    scrollbar-color: #888 #f1f1f1; /* thumb color track color */
}

/* Reusable admin/project container style */
.admin-container, .setup-container, .wizard-container {
    max-width: 700px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 32px 28px 24px 28px;
}

@media (max-width: 900px) {
    .admin-container, .setup-container, .wizard-container {
        max-width: 98vw;
        padding: 16px 4vw;
    }
}
@media (max-width: 600px) {
    .admin-container, .setup-container, .wizard-container {
        padding: 8px 2vw;
    }
    .admin-container h1, .setup-container h1, .wizard-container h1 {
        font-size: 1.3rem;
    }
}

/* Headings */
.admin-container h1, .setup-container h1, .wizard-container h1,
.admin-container h2, .setup-container h2, .wizard-container h2,
.admin-container h3, .setup-container h3, .wizard-container h3 {
    color: #222;
    text-align: center;
}

/* Forms and lists */
.admin-form, .setup-form, .wizard-form {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1em 1.5em 1.5em 1.5em;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    margin-top: 1em;
    margin-bottom: 2em;
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.admin-form label, .setup-form label, .wizard-form label,
.admin-form select, .setup-form select, .wizard-form select,
.admin-form input[type="text"], .setup-form input[type="text"], .wizard-form input[type="text"] {
    font-size: 1em;
}

.admin-form select, .setup-form select, .wizard-form select,
.admin-form input[type="text"], .setup-form input[type="text"], .wizard-form input[type="text"],
.setup-form input[type="number"], .setup-form textarea, .wizard-form input[type="number"], .wizard-form textarea {
    padding: 0.5em;
    border-radius: 5px;
    border: 1.5px solid #444;
}

input[type="password"] {
    /* visually indicate autocomplete is supported */
    background-clip: padding-box;
}

.helper-icon {
    display: inline-block;
    margin-left: 6px;
    color: #555;
    background: #eee;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #aaa;
    font-size: 14px;
    line-height: 18px;
}
.helper-popup {
    display: none;
    position: absolute;
    background: #fff;
    color: #222;
    border: 1px solid #aaa;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 100;
    max-width: 260px;
    font-size: 0.98em;
}