/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif; /* Clean, readable font */
}

/* Body Styling */
body {
    background-color: #f8f9fa; /* Light gray background */
    color: #333; /* Neutral text color for contrast */
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    max-width: 1200px; /* Limit the width for a centered layout */
    margin: 0 auto; /* Center the body on larger screens */
}

/* Headers (h1, h2, etc.) */
h1, h2, h3 {
    margin-bottom: 10px;
}

h1 {
    font-size: 2rem;
    /*border-bottom: 3px solid rgb(204, 7, 30); !* Underline h1 *!*/
    padding-bottom: 5px;
    text-align: center; /* Center h1 on the page */
}

h2 {
    font-size: 1.6rem;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}

/* Links */
a {
    color: rgb(204, 7, 30); /* Primary color for links */
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    color: #a10520; /* Darker red for hover */
    text-decoration: underline;
}

/* Buttons */
button {
    display: inline-block;
    background-color: rgb(204, 7, 30); /* Red background */
    color: #fff; /* White text */
    padding: 10px 15px;
    margin: 10px 5px; /* Even spacing for buttons */
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    max-width: 100%; /* Ensure buttons do not overflow on mobile */
    text-align: center;
}

button:hover {
    background-color: #a10520;
}

/* Forms */
form {
    margin-bottom: 20px;
    padding: 10px 0;
    max-width: 100%;
}

form label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

form input, form textarea, form select, form button {
    width: 100%; /* Make inputs and buttons responsive */
    max-width: 400px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

form button {
    width: auto;
}

/* Navigation Links */
nav {
    margin-bottom: 20px;
    text-align: center; /* Center navigation links */
}

nav a {
    display: inline-block;
    padding: 10px 15px;
    background-color: rgb(204, 7, 30);
    color: #fff;
    border-radius: 5px;
    font-size: 1rem;
    margin: 5px 0; /* Add spacing between links */
    max-width: 100%;
    text-decoration: none;
}

nav a:hover {
    background-color: #a10520;
}

/* Images */
img {
    max-width: 100%; /* Ensure images scale to fit small screens */
    height: auto;
    border: 5px solid #eee; /* Light border for images */
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    margin: 20px 0;
}

.pagination a {
    color: rgb(204, 7, 30);
    font-size: 1.1rem;
    margin: 5px;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid rgb(204, 7, 30);
    border-radius: 5px;
}

.pagination a:hover {
    background-color: rgb(204, 7, 30);
    color: #fff;
}

/* Lists */
ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin: 10px 0;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

footer a {
    color: rgb(204, 7, 30);
}

/* Responsive Design for Smaller Screens */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem; /* Reduce header size */
    }

    h2 {
        font-size: 1.4rem;
    }

    button {
        padding: 8px 10px; /* Smaller button padding */
        font-size: 0.9rem;
    }

    nav a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    form input, form textarea, form button {
        padding: 8px; /* Smaller padding on form elements */
    }

    .pagination a {
        font-size: 0.9rem; /* Smaller pagination buttons */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    button, form input, form button, nav a {
        font-size: 0.8rem; /* Further reduce size for smaller screens */
        padding: 6px 8px;
    }

    form input, form textarea {
        max-width: 100%; /* Ensure forms always fit small screens */
    }
}

/* Table Styles */
table {
    width: 100%; /* Use full width */
    border-collapse: collapse;
    margin: 20px 0; /* Add spacing around table */
    font-size: 1rem;
    text-align: left;
}

thead {
    background-color: rgb(204, 7, 30); /* Header background in corporate red */
    color: #fff; /* White text for header */
}

thead th {
    padding: 10px; /* Header cell padding */
    text-transform: uppercase; /* Enhance readability */
}

tbody td {
    padding: 10px; /* Cell padding */
    border: 1px solid #ddd; /* Light border for cell separation */
}

tr:nth-child(even) {
    background-color: #f2f2f2; /* Light gray background for alternate rows */
}

tr:hover {
    background-color: #f9d6db; /* Light red on hover */
}

td[colspan] {
    text-align: center; /* Center the fallback message in colspan row */
    color: #666; /* Slightly muted color for fallback text */
    font-style: italic; /* Italicize fallback message */
}

/* Header Container for h1, Links Button, and Logout Button */
.header-container {
    display: flex; /* Use flexbox layout for horizontal alignment */
    justify-content: space-between; /* Space buttons on the outer ends */
    align-items: center; /* Vertically center-align all content */
    margin-bottom: 20px; /* Spacing below the header */
    padding: 10px 0; /* Add some padding around the container */
    border-bottom: 3px solid rgb(204, 7, 30); /* Optional: underline for header */
}

/* Ensure Heading Aligns Center in Flex Layout */
.header-container h1 {
    font-size: 1.8rem;
    margin: 0; /* Remove margins to avoid unwanted spacing */
    text-align: center;
}

/* Shared Style for Buttons (Links and Logout) */
.link-button, .logout-button {
    display: inline-block;
    background-color: rgb(204, 7, 30); /* Button background color */
    color: #fff; /* Button text color */
    padding: 12px 20px; /* Consistent padding for buttons */
    border-radius: 5px; /* Rounded corners */
    font-size: 1rem;
    cursor: pointer;
    border: none; /* Remove default button border */
    text-align: center; /* Center the content */
    line-height: 1.5; /* Align text vertically inside the buttons */
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

/* Add Hover Styles to Buttons */
.link-button:hover, .logout-button:hover {
    background-color: #a10520; /* Darker red for hover effect */
}

/* Ensure Logout Button Inside Form Matches Styling */
.logout-form {
    margin: 0;
}

/* Style the List and Items */
ul {
    list-style: none; /* Remove default bullet points */
    padding: 0;
}

.image-item {
    display: flex; /* Use flexbox for horizontal layout */
    align-items: flex-start; /* Align items at the top */
    justify-content: space-evenly;
    border-bottom: 1px solid #ccc; /* Optional: Add separation */
    padding: 10px 0; /* Spacing between items */
}

/* Form Styling */
.product-form {
    max-width: 300px; /* Adjust form width */
    flex: 1; /* Allow the form to take minimum space */
}

/* Image Styling */
.image img {
    max-width: 200px; /* Limit maximum width */
    height: auto; /* Keep aspect ratio */
    border-radius: 5px; /* Add rounded corners */
    margin-bottom: 10px; /* Spacing below the image */
}

/* Responsive Design for Smaller Screens */
@media (max-width: 768px) {
    .image-item {
        flex-direction: column; /* Stack form and image vertically */
        gap: 10px; /* Reduce spacing for smaller screens */
    }

    .image img {
        max-width: 100%; /* Allow image to scale to full width */
    }
}

.make-products-column {
    display: flex; /* Use flexbox for horizontal layout */
    flex-wrap: wrap; /* Allow items to wrap to the next row */
    align-items: flex-start; /* Align items at the top */
    justify-content: space-evenly;
    border-bottom: 1px solid #ccc; /* Optional: Add separation */
    padding: 10px 0; /* Spacing between items */
}

/* Login Page Specific Styles */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center horizontally */
    min-height: 100vh; /* Full-page height */
    background-color: #f8f9fa; /* Light background for login */
    padding: 15px;
}

.login-container h2 {
    text-align: center; /* Center the h2 element */
    margin-bottom: 20px;
    font-size: 1.6rem;
    color: #333;
}

.login-container p {
    text-align: center;
    font-size: 0.9rem; /* Adjust font size for smaller devices */
    margin-top: 10px;
    color: #555;
}

/* Ensure the login form is styled */
.login-form {
    width: 100%; /* Full width on smaller screens */
    max-width: 400px; /* Limit maximum width */
    background-color: white; /* Form background */
    border: 1px solid #ddd; /* Subtle border */
    border-radius: 10px; /* Rounded corners */
    padding: 20px; /* Add spacing inside the form */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
}

.login-form input, .login-form button {
    display: block;
    width: 100%; /* Allow inputs and buttons to stretch */
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.login-form button {
    background-color: rgb(204, 7, 30); /* Button background */
    color: #fff; /* Button text */
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-form button:hover {
    background-color: #a10520; /* Darken button on hover */
}

/* Additional Styles for Smaller Screens */
@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }

    .login-container h2 {
        font-size: 1.4rem;
    }

    .login-form {
        padding: 15px; /* Reduce padding to fit smaller screens */
    }

    .login-form input, .login-form button {
        font-size: 0.9rem; /* Adjust input and button size */
        padding: 10px;
    }

    .login-container p {
        font-size: 0.8rem;
    }
}

/* Spinner Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

/* Spinner Design */
.spinner {
    border: 4px solid #f3f3f3; /* Light gray */
    border-top: 4px solid #444; /* Dark gray (spinner "color") */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
}

/* Spinner Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Message Style */
.loading-message {
    margin-top: 10px;
    font-size: 1em;
    color: #555;
    text-align: center;
}