/* Global Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #E3F2FD;
    color: #333;
    height: 100%;
}

html {
    height: 100%;
    margin: 0;
    padding: 0
}

/* Headers */
h1, h2 {
    text-align: center;
    margin: 20px 0;
    color: #333;
}

h1 {
    font-size: 2.5em;
    font-weight: bold;
}

h2 {
    font-size: 2em;
    font-weight: normal;
}

/* Main Content Styling */
main {
    padding: 20px;
    text-align: center;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Error Message Styling */
.error-message {
    color: red;
    background-color: rgba(248, 215, 218, 0.9); /* Slightly transparent background */
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb; /* Solid, thin border */
    border-radius: 5px;
    position: relative; /* Required for positioning the close button */
    font-size: 14px;
}

/* Close button styling */
.error-message .close-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: red;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.error-message .close-btn:hover {
    color: darkred; /* Change color on hover */
}

/* Button Container Styling */
.button-container {
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    gap: 20px; /* Space between buttons */
    margin-top: 50px; /* Space above the buttons */
}

/* Button Styling */
.button-container a {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button-container a:hover {
    background-color: #0056b3;
    transform: translateY(-2px); /* Lift on hover */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.button-container a:active {
    transform: translateY(2px); /* Button press effect */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Settings Page Container */
.settings-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px
}

/* Forms */
.form-container {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    height: 80vh; /* Set height for centering */
    flex-direction: column; /* Stack form elements vertically */
    padding: 20px; /* Add space inside */
    text-align: center; /* Center text */
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #007bff;
    outline: none;
}

/* Progress Bar Styles */
.progress-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 300px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #E3F2FD;
}

.progress-wrapper {
    text-align: center;
    width: 60px;
}

.progress-bar {
    height: 100%;
    width: 100%;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.progress-fill {
    width: 100%;
    height: 0%;
    min-height: 20px;
    text-align: center;
    color: white;
    font-weight: bold;
    line-height: 20px;
    transition: height 0.5s ease, min-height 0.5s ease;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.progress-label {
    margin-top: 10px;
    font-weight: bold;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

th {
    background-color: #f4f4f4;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

button[type="submit"] {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button[type="submit"]:hover {
    background-color: #45a049;
}

/* User edit table styling */
.edit-user-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.edit-user-table th, .edit-user-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.edit-user-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.edit-user-table input, .edit-user-table select {
    width: 90%; /* Input fields take up most of the cell */
    padding: 5px;
    font-size: 14px;
}

.edit-user-table button img {
    vertical-align: middle;
}

button.update-user-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button.update-user-btn:hover {
    background-color: #45a049;
}

button[name="delete_user"] {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

button[name="delete_user"]:hover {
    background-color: #d32f2f;
}

/* Header and Navigation */
header {
    background-color: #333;
    padding: 10px 0;
    color: white;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 15px;
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
}

nav ul li a:hover {
    text-decoration: underline;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #575757;
}

.dropdown:hover .dropdown-content {
    display: block;
}

nav ul li.logout {
    margin-left: auto; /* Push the logout button to the far-right */
}

nav ul li.login {
    margin-left: auto; /* Push the login button to the far-right */
}

/* Popups */
#popup {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
    font-size: 16px;
}

#popup.error {
    background-color: #f44336; /* Red background for errors */
}

/* Messages */
.error-message {
    color: #f44336; /* Red for errors */
    background-color: #ffe6e6;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
}

.success-message {
    color: #4CAF50; /* Green for success */
    background-color: #e6ffe6;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    font-size: 14px;
    color: #ffffff;
    margin-top: auto;
}

footer p {
    margin: 5px 0;
}