/* Global Styles */
body {
    background-color: #f0f2f5;
    font-family: 'Roboto', sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Container for main content */
.container {
    max-width: 800px;
    width: 90%;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Headings */
h1, h2, h3 {
    text-align: center;
    color: #333;
}

/* Forms */
form {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

form input[type="text"],
form input[type="email"],
form input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

form button {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: none;
    background-color: #007BFF;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #0056b3;
}

/* Links */
a {
    color: #007BFF;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists and Items */
ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

li {
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bought {
    text-decoration: line-through;
    color: #888;
}

/* Utility */
.error {
    color: red;
    text-align: center;
    margin: 10px 0;
}

/* Responsive adjustments */
/*@media (max-width: 600px) {
    .container {
        width: 95%;
        margin: 20px auto;
        padding: 15px;
    }

    form input[type="text"],
    form input[type="password"],
    form button {
        max-width: 100%;
    }

    li {
        flex-direction: column;
        align-items: flex-start;
    }
}*/

.rotate-180 {
    transform: rotate(180deg);
}

/* List item as a flex container */
#itemsList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* Left and right groups */
.left-group,
.right-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.left-group {
    gap: 20px;
}

.right-group {
    gap: 10px;
}

/* Ensure item text is left-aligned and takes available space */
.item-text {
    flex: 1;
    text-align: left;
}

.icon-large {
    width: 24px;
    height: 24px;
}
.rotate-180 {
    transform: rotate(180deg);
}

.bought {
    text-decoration: line-through;
    color: #888;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    height: 40px; /* set a common height */
    font-size: 1em;
}

/* Let the item input grow to fill remaining space */
#itemInput {
    flex: 1;
}

/* The quantity input gets a fixed width */
#quantityInput {
    width: 80px;
    flex: none;
}

/* Optionally remove the default number input spinner for WebKit browsers */
#quantityInput::-webkit-outer-spin-button,
#quantityInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* And for Firefox */
#quantityInput {
    -moz-appearance: textfield;
}

.sort-toggle span {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
}

.toggle-text {
    margin-left: 8px;
}