body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

h2 {
    color: #34495e;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 30px;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
}

form {
    background: #f0f2f5;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

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

input[type="text"] {
    width: 100%;
    padding: 12px;
    /* Space for clear button */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    /* Prevents zoom on iOS */
    box-sizing: border-box;
    margin-bottom: 15px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background-color: #2980b9;
}

a {
    color: #3498db;
    text-decoration: none;
}

.button-group {
    display: flex;
    gap: 10px;
}

.remove-btn {
    background-color: #e74c3c;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    text-align: center;
    min-width: 20px;
    cursor: pointer;
}

.up-btn {
    background-color: white;
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.up-btn:hover {
    background-color: #eafaf1;
    color: #27ae60;
    border-color: #27ae60;
}

.down-btn {
    background-color: white;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.down-btn:hover {
    background-color: #fdedec;
    color: #c0392b;
    border-color: #c0392b;
}



.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input[type="text"] {
    margin-bottom: 0;
    flex: 1;
}

.clear-btn-side {
    display: none;
    /* Hidden by default */
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    /* Height will match input due to flex stretch */
    width: auto;
    /* Override global button width */
    min-width: 50px;
    /* Minimum clickable area */
}

.clear-btn-side:hover {
    background-color: #c0392b;
}

/* Loading Overlay */
.form-container {
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 8px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toastify Overrides */
.toastify {
    position: fixed !important;
    /* Ensure it stays out of flow */
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 50px 12px 20px !important;
    /* Right padding reserves space for close button */
    max-width: 400px;
}

.toastify .toast-close {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0.6;
    color: inherit;
    font-size: 20px;
    /* Make the X visible */
}

.toastify .toast-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
    /* Visual feedback for clickable area */
}