/* General Body Styles */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
header {
    background-color: black;
    color: white;
    padding: 1em;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo {
    width: 150px;
    filter: invert(100%);
    max-width: 100%;
}

/* Main Content Area */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Login Form Styles */
/* General Form Styles */
.login-form {
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 20px auto; /* Center the login form */
}

/* Labels */
.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    text-align: left;
}

/* Input Fields */
.login-form input {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: calc(100% - 20px);
    transition: border-color 0.2s ease-in-out;
}

.login-form input:focus {
    border-color: #555; /* Highlight the input on focus */
    outline: none;
}

/* Buttons */
.login-form button {
    background-color: black;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    width: 100%; /* Full-width button */
    text-transform: uppercase; /* Consistent with the admin style */
    font-weight: bold;
}

.login-form button:hover {
    background-color: #333;
}

.login-form button:active {
    transform: scale(0.98); /* Slightly "press" the button when clicked */
}

/* Form Title */
.login-form h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    text-transform: uppercase;
    font-weight: bold;
}

/* Link Styling */
.login-form a {
    display: block;
    margin-top: 15px;
    color: black;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

.login-form a:hover {
    color: #555;
}
/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

table, th, td {
    border: 1px solid #ddd;
}

/* Total Row Styling */
table tfoot .total-row {
    font-weight: bold;
    text-align: right;
    background-color: #e0e0e0; /* Light gray for contrast */
}

table tfoot .total-row td {
    padding: 12px;
    border-top: 2px solid black; /* Separate it visually */
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: black;
    color: white;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Responsive Styles */
@media only screen and (max-width: 600px) {
    main {
        padding: 10px;
    }

    table {
        font-size: 14px;
        margin: 10px 0;
    }

    table, th, td {
        padding: 8px;
    }

    .login-form {
        padding: 20px;
        max-width: 90%;
    }

    .logo {
        width: 120px; /* Smaller logo on mobile */
    }
}

/* Table Sort Indicator */
th .sort-indicator {
    margin-left: 10px; /* Increase the space before the arrow */
    font-size: 1.5em; /* Increase the font size */
    color: white; /* Make the arrows white so they're visible on dark backgrounds */
}

th:hover .sort-indicator {
    color: #f0f0f0; /* Lighten the color when hovering */
}

.error {
    color: red;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}


/* Flexbox Layout Fixes */
@media only screen and (max-width: 600px) {
    header {
        padding: 1em;
        text-align: center;
    }

    .logo {
        width: 120px; /* Adjust logo size on smaller screens */
        margin-bottom: 10px;
    }
}

/* Additions for the Admin Dashboard */

/* Table-specific styles */
.admin-table {
    margin-bottom: 40px; /* Add spacing between the table and form */
}

/* Form Styles */
.add-user-form, .delete-form {
    margin: 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 20px auto; /* Center the forms */
}

.add-user-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.add-user-form input[type="text"],
.add-user-form input[type="password"],
.add-user-form input[type="checkbox"] {
    display: block;
    width: calc(100% - 20px);
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.add-user-form input[type="checkbox"] {
    width: auto;
    margin-left: 0;
}

.add-user-form .add-btn {
    background-color: black;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    display: block;
    width: 100%;
    text-align: center;
}

.add-user-form .add-btn:hover {
    background-color: #333;
}

/* Form Styles for Refilling */
.change-refill-form {
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px; /* Adjust width for better appearance */
    width: 100%;
}

.change-refill-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.change-refill-form input {
    display: block;
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease-in-out;
}

.change-refill-form input:focus {
    border-color: #555;
    outline: none;
}

/* Specific styles for number input (refill amount) */
.change-refill-form input[type="number"] {
    -moz-appearance: textfield; /* Hide increment/decrement buttons on number input */
}

.change-refill-form input[type="number"]:focus {
    border-color: #333;
}

.change-refill-form input[type="date"] {
    font-size: 16px;
}

/* Submit button for refill update */
.change-refill-form .change-btn {
    background-color: black;
    color: white;
    padding: 12px 15px;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.change-refill-form .change-btn:hover {
    background-color: #333;
}

.change-refill-form .change-btn:active {
    transform: scale(0.98);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 30px 40px;
    max-width: 400px;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    text-align: left;
}

.modal-content input {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: calc(100% - 20px);
    transition: border-color 0.2s ease-in-out;
}

.modal-content input:focus {
    border-color: #555;
    outline: none;
}

.modal-content .submit-btn {
    background-color: black;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.modal-content .submit-btn:hover {
    background-color: #333;
}

.modal-content .cancel-btn {
    background-color: #f4f4f4;
    color: black;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-top: 10px;
}

.modal-content .cancel-btn:hover {
    background-color: #e0e0e0;
}

.modal-content textarea {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: calc(100% - 20px);
    height: 120px; /* Set a suitable height */
    resize: vertical; /* Allow resizing vertically */
    transition: border-color 0.2s ease-in-out;
}

.modal-content textarea:focus {
    border-color: #555;
    outline: none;
}
