body {
    font-family: "Rubik", -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    margin: 20px;
    padding: 1px;
    max-width: -webkit-fill-available;
    background-color: aliceblue;
}

.container {
    max-width: 98vw;
    margin: 3% auto;
    padding: 2%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column; /* Stacks items vertically */
    align-items: unset; /* Centers items horizontally */
    gap: 3px; /* Adds consistent spacing */
}

h1 {
    text-align: center;
    color: #333333;
    padding: 1%;
}

label {
    font-weight: bold;
    margin: 0;
    display: block;
    padding: 1px;
    align-items: center;
}

textarea {
    width: 95%;
    margin-bottom: 10px;
    min-height:150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1%;
    max-width: -webkit-fill-available;
}

/* Fix all divs to maintain consistent height */
div {
    position: relative; /* Prevents hover effects from changing layout */

}

/* Button Styles */
button {
    background-color: #007bff;
    display: inline-flex;
    gap: 10px;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 105%;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* Lock button in place */
    box-sizing: border-box; /* Ensure padding and border don't affect size */
    z-index: 1; /* Ensure hover effects stay above other elements */
    margin: 10px;
}

/* Hover effect without shifting elements */
button:hover {
    background-color: #0c66c6;
    color: offwhite;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(2px); /* Hover effect without affecting layout */
}

div#selection_buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
    margin: 0 0 1px 0;
    margin-top: 4px;
}

#mode_section {
    position: absolute;  /* Fixed positioning */
    top: 2px;
    right: 4px;
    width: 75px;         /* 🔒 Lock width */
    height: 20px;         /* 🔒 Lock height */
    background-color: #f9fbff;
    border: 2px solid #cee1fe;
    border-radius: 8px;
    padding: 4px 7px;
    font-size: 95%;
    opacity: 0.6;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#mode_section:hover {
    opacity: 1;
    background-color: #e8f0ff;
    border-top-left-radius:0px;
    border-bottom-left-radius:0px;
    border-left: none;
}

#mode_section span {
    font-weight: bold;
    pointer-events: none; /* So only the container triggers hover */
}
/* Hide the options by default */
.options_container {
    display: none;
    position: absolute;
    top: -2px;  /* below the #mode_section */
    right: 89px;
    /* background-color: white; */
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
    padding: 0px;
    border-radius: 8px;
    z-index: 300;
    flex-direction: column;
    gap: 0;
    object-fit:contain;
    /* min-width: 120px; */
}

/* Reveal on hover without affecting layout */
#mode_section:hover .options_container {
    display: flex;
    border-top-right-radius:0px;
    border: 1px solid #d0e3ff;
    overflow:hidden;
}

.field_option {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    background-color: #ffffff;
    padding: 10px 14px;
    border-radius: 0px;
    box-shadow: 0 -px 8px rgba(0, 0, 0, 0.1);
    margin: 0.2px 0;
    width: 60px;
    overflow:hidden;
}

.field_option:hover {
    background-color: #e0ecff;
    overflow:hidden;
}

.field_option:active {
    background-color: #d0dcf5;
    transform: scale(0.96);
    overflow:hidden;
}

.selected_field_option {
    background-color: #b9cdf9 !important;
    color: #003366;
    font-weight: bold;
}




/* Container for question list */
div#question_list {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping of items to next row */
    gap: 10px; /* Space between items */
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden; /* Disable vertical overflow */
    width: 95%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #b7d7fa;
    border-radius: 10px;
    min-height: 100px; /* Set a fixed height */
    max-height:60vh;
    overflow:auto;
}

/* Styling for each individual label (checkbox item) */
#question_list label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 1px 2px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    width: fit-content; /* 10 questions per row, adjust the width accordingly */
    min-width: 230px;
    word-wrap: normal; /* Break long words if necessary */
    max-height: 38px;
    padding: 8px 2px;
}
#question_list label span.id {
    padding-right:4px;
}

/* Ensures the checkboxes and text are aligned correctly */
#question_list input[type="checkbox"] {
    margin-right: 10px; /* Space between checkbox and text */
}

/* Styling for the question number */
.number {
    margin-right: 8px; /* Adjust the space between the number and ID */
}

.id {
    opacity: 0.7; /* Maintain the desired opacity for the question ID */
}

#copy_button {
    margin-left: auto;
}


/* Updated history section */
div#history_section {
    display: flex; 
    gap: 10px; 
    align-items: flex-start; 
    margin-bottom: 10px;
}

div#history_section > div {
    flex: 1;
}

div#history_section > div > label {
    margin: 0;
}

div#history_section > div > select {
    width: 100%;
}

#history_select {
    padding: 8px;
    font-size: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#history_select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

.input-history-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sticky-history {
    position: static;
    z-index: auto;
    background-color: white;
    padding-top: 4px;
    padding-bottom: 8px;
}

.history-feedback {
    position: relative;
    right: 0;
    top: -10px;
    font-size: 14px;
    color: green;
    animation: floatUpFade 0.7s ease forwards;
    pointer-events: none;
    user-select: none;
    z-index: 1000;
    white-space: nowrap;
}

/* Subtle button press animation */
button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Make Clear History button a bit smaller and softer */
#clear_history_button {
    background: linear-gradient(to bottom, #ffffff, #f0f0f5);
    color: #007aff;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    font-weight: 500;
    font-size: 90%;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-left: 5px;
    margin-top: 5px;
}

#clear_history_button:hover {
    background: #e5e5ea;
}

.ripple {
    position: relative;
    width: 10px;
    height: 10px;
    background: rgba(0, 123, 255, 0.4);
    opacity: 1;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
    z-index: 0;
}

@keyframes ripple-animation {
    to {
        transform: scale(15);
        opacity: 0;
    }
}

#regex_toggle_wrapper {
    display: flex;
    align-items: center;
    margin-left: 8px;
    gap: 6px;
    font-size: 85%;
    font-weight: bold;
}

#regex_toggle {
    appearance: none;
    width: 34px;
    height: 18px;
    background-color: #ccc;
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

#regex_toggle::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 1px;
    top: 1px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

#regex_toggle:checked {
    background-color: #66a6ff;
}

#regex_toggle:checked::before {
    transform: translateX(16px);
}


label#REGEX {
    display: inline-flex;
    align-items: center;
}