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

header {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    text-align: center;
}

main {
    padding: 1rem;
}

section {
    margin-bottom: 2rem;
}

/* Button styling */
button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0.5rem 0.25rem;
}

/* Red buttons for "Delete" and "Pop" */
button#delete-game, button#pop-state {
    background-color: red;
    color: white;
}

button#delete-game:hover, button#pop-state:hover {
    background-color: darkred;
}

/* Yellow buttons for "Box {n}" */
#box-buttons button {
    background-color: yellow;
    color: black;
}

#box-buttons button:hover {
    background-color: gold;
}

/* Dropdown styling in Section 1 */
select {
    font-size: 1.2rem; /* Make it larger */
    font-weight: bold;
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    appearance: none; /* Remove default dropdown styling */
}

/* Section 1 layout adjustments */
#game-management {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#game-management > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#game-management > div:not(:last-child) {
    border-bottom: 1px solid #ccc; /* Add a break line */
    padding-bottom: 1rem;
}

#game-management input {
    flex-grow: 1; /* Ensure input takes up remaining space */
}

/* Ensure tables and dropdowns look uniform */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table, th, td {
    border: 1px solid #ddd;
    text-align: left;
}

th, td {
    padding: 0.5rem;
}

/* State display styling */
#state-display {
    margin: 1rem 0;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal styling */
.hidden {
    display: none !important;
}

#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lock body scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Modal content should be scrollable */
.modal-content {
    max-height: 80vh; /* Adjust height to fit within the viewport */
    overflow-y: auto; /* Enable scrolling inside the modal */
    padding-right: 1rem; /* Prevent content clipping due to scrollbar */
}

.modal-content {
    background: white;
    padding: 1rem;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

#close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Sorting buttons */
.sort-btn {
    background: gray;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem;
}

.sort-btn.selected {
    font-weight: bold;
    color: green;
    cursor: not-allowed;
}

.sort-btn:disabled {
    background: white;
    cursor: not-allowed;
    color: gray;
}
