/* --- Globals & Security --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- Base & Dark Mode Theme --- */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

a {
    color: #61dafb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, legend {
    color: #ffffff;
    font-weight: 600;
}

/* --- Header --- */
header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.explanation {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    font-size: 0.95em;
    line-height: 1.7;
}

/* --- Base URL Section --- */
.base-url-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.base-url-section label {
    flex-shrink: 0;
    font-weight: 500;
}

#baseUrl {
    flex-grow: 1;
}

#toggleBaseUrlLock {
    font-size: 1.2em;
    padding: 6px 10px;
    line-height: 1;
}

/* --- Form Elements --- */
input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
    width: 100%;
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px;
    font-size: 1em;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid #61dafb;
    outline-offset: 1px;
    border-color: #61dafb;
}

/* Remove number input spinners for a cleaner look */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9em;
}

button,
.button {
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}

button:hover,
.button:hover {
    background-color: #0056b3;
    text-decoration: none;
}

#copyUrlButton {
    background-color: #28a745;
}
#copyUrlButton:hover {
    background-color: #1e7e34;
}
#copyUrlButton.copied {
    background-color: #1e7e34;
}

/* --- Form Layout --- */
.filter-section {
    background-color: #1c1c1c;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.form-grid {
    display: grid;
    /* Responsive grid: auto-fits columns with a min-width of 250px */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 44px; /* Matches input height for alignment */
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    accent-color: #61dafb;
}

/* Multi-select checkbox group */
fieldset {
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}
legend {
    padding: 0 10px;
    font-size: 1em;
}
.checkbox-multi-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.checkbox-multi-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

/* --- Advanced Section --- */
.advanced-section {
    border: 1px dashed #444;
    border-radius: 6px;
    padding: 15px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.advanced-section[open] {
    opacity: 1;
    border-style: solid;
    border-color: #333;
    background-color: #202020;
}
.advanced-section summary {
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
}
.advanced-section[open] summary {
    margin-bottom: 20px;
}


/* --- Result Section --- */
.result-section {
    margin-top: 20px;
    margin-bottom: 20px;
}
#generatedUrl {
    width: 100%;
    min-height: 120px;
    background-color: #222;
    border-color: #444;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95em;
    line-height: 1.5;
}
.result-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}


/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.9em;
    color: #888;
}