.parameter,
.types {
    padding-left: 0.5em;
    padding-right: 0.5em;
    font-size: 1em;
    display: inline-block;
    line-height: 1.4;
    border-radius: 0.2rem;
    vertical-align: baseline;
}

.parameter {
    background: rgba(0, 150, 136, 0.25);
    color: var(--md-default-fg-color);
}

.types {
    background: rgba(179, 136, 255, 0.28);
    color: var(--md-default-fg-color);
}

.optional {
    display: inline-block;
    font-size: 1em;
    font-style: italic;
    opacity: 0.75;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

.types a.type {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.types a.type:hover {
    text-decoration: underline;
}

.realm-client>summary,
.realm-shared>summary,
.realm-server>summary {
    font-size: 1em;
}


.md-typeset details.realm-client,
.md-typeset details.realm-shared,
.md-typeset details.realm-server,
.md-typeset div.realm-client,
.md-typeset div.realm-shared,
.md-typeset div.realm-server {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem !important;
    background: var(--md-default-bg-color);
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

[data-md-color-scheme="slate"] .md-typeset details.realm-client,
[data-md-color-scheme="slate"] .md-typeset details.realm-shared,
[data-md-color-scheme="slate"] .md-typeset details.realm-server,
[data-md-color-scheme="slate"] .md-typeset div.realm-client,
[data-md-color-scheme="slate"] .md-typeset div.realm-shared,
[data-md-color-scheme="slate"] .md-typeset div.realm-server {
    background: rgba(255, 255, 255, 0.02);
}

.md-typeset details.realm-client:hover,
.md-typeset details.realm-shared:hover,
.md-typeset details.realm-server:hover,
.md-typeset div.realm-client:hover,
.md-typeset div.realm-shared:hover,
.md-typeset div.realm-server:hover {
    transform: translateY(-2px);
    border-color: var(--md-accent-fg-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.md-typeset details.realm-client>summary,
.md-typeset details.realm-shared>summary,
.md-typeset details.realm-server>summary,
.md-typeset div.realm-client>.realm-header,
.md-typeset div.realm-shared>.realm-header,
.md-typeset div.realm-server>.realm-header {
    background-color: rgba(70, 169, 255, 0.08);
    font-weight: 700;
    padding: 0.75rem 1rem 0.75rem 2.8rem !important;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    display: block;
    position: relative;
    cursor: pointer;
    list-style: none;
}

.md-typeset div.realm-client>.realm-header,
.md-typeset div.realm-shared>.realm-header,
.md-typeset div.realm-server>.realm-header {
    cursor: default;
}

.md-typeset details.realm-client>summary::-webkit-details-marker,
.md-typeset details.realm-shared>summary::-webkit-details-marker,
.md-typeset details.realm-server>summary::-webkit-details-marker,
.md-typeset details.realm-client>summary::marker,
.md-typeset details.realm-shared>summary::marker,
.md-typeset details.realm-server>summary::marker {
    display: none !important;
}

.md-typeset details.realm-client>summary:hover,
.md-typeset details.realm-shared>summary:hover,
.md-typeset details.realm-server>summary:hover {
    background-color: rgba(70, 169, 255, 0.15);
}

.md-typeset details[open]>summary {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset details>.details-content,
.md-typeset div>.details-content {
    padding: 0.75rem 1rem 0.5rem 1rem;
}

.md-typeset details.realm-server,
.md-typeset div.realm-server {
    border-left: 4px solid #00a2ff;
}

.md-typeset details.realm-client,
.md-typeset div.realm-client {
    border-left: 4px solid #ff9800;
}

.md-typeset details.realm-shared,
.md-typeset div.realm-shared {
    border-left: 4px solid #4caf50;
}

.md-typeset details.realm-server>summary::before,
.md-typeset details.realm-client>summary::before,
.md-typeset details.realm-shared>summary::before,
.md-typeset div.realm-server>.realm-header::before,
.md-typeset div.realm-client>.realm-header::before,
.md-typeset div.realm-shared>.realm-header::before {
    content: "" !important;
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0 !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    mask: none !important;
    -webkit-mask: none !important;
    clip-path: none !important;
    display: block !important;
    z-index: 1;
}

.md-typeset details.realm-server>summary::before,
.md-typeset div.realm-server>.realm-header::before {
    background-color: #00a2ff !important;
}

.md-typeset details.realm-shared>summary::before,
.md-typeset div.realm-shared>.realm-header::before {
    background: linear-gradient(45deg, #ff9800 50%, #00a2ff 50%) !important;
}

.md-typeset details.realm-client>summary::before,
.md-typeset div.realm-client>.realm-header::before {
    background-color: #ff9800 !important;
}

.realm-client h3,
.realm-shared h3,
.realm-server h3 {
    font-size: 1em;
    border: 1px solid;
    border-image-source: linear-gradient(to left, rgba(179, 136, 255, 0.9), rgba(0, 150, 136, 0.9));
    border-image-slice: 1;
    border-width: 2px;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    margin-top: 1em;
    padding-bottom: 0.15em;
}

.md-typeset details,
.md-typeset div.realm-client,
.md-typeset div.realm-shared,
.md-typeset div.realm-server {
    font-size: 1em;
}

.md-typeset details strong,
.md-typeset div.realm-client strong,
.md-typeset div.realm-shared strong,
.md-typeset div.realm-server strong {
    color: #46a9ff;
    display: block;
    margin-top: 0.75em;
    margin-bottom: 0.25em;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.md-typeset details .details-content h3:first-of-type,
.md-typeset details .details-content strong:first-of-type,
.md-typeset div.realm-client .details-content h3:first-of-type,
.md-typeset div.realm-shared .details-content h3:first-of-type,
.md-typeset div.realm-server .details-content h3:first-of-type {
    margin-top: 0;
}


.md-typeset details p {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.md-typeset details.no-icon>summary::before,
.md-typeset div.no-icon>.realm-header::before {
    display: none !important;
}

.md-typeset details.no-icon>summary,
.md-typeset div.no-icon>.realm-header {
    padding-left: 1.25rem !important;
}

.md-typeset details .details-content *:last-child {
    margin-bottom: 0 !important;
}

.md-typeset details details>.details-content {
    padding-top: 0.4rem;
}

.md-typeset details details>.details-content>ul:first-child {
    margin-top: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}


.card {
    display: block;
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

[data-md-color-scheme="slate"] .card {
    background: rgba(255, 255, 255, 0.03);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--md-accent-fg-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background: var(--md-default-bg-color--light);
}

.card.realm-server {
    border-left: 4px solid #f44336;
}

.card.realm-client {
    border-left: 4px solid #2196f3;
}

.card.realm-shared {
    border-left: 4px solid #4caf50;
}

.card h3 {
    margin: 0 0 0.5rem 0 !important;
    color: var(--md-primary-fg-color) !important;
    font-size: 1.05em !important;
    font-weight: 700 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card h3::after {
    content: "→";
    opacity: 0.3;
    transition: all 0.2s ease-in-out;
    font-size: 1.2em;
    transform: translateX(-5px);
}

.card:hover h3::after {
    opacity: 1;
    transform: translateX(0);
    color: var(--md-accent-fg-color);
}

.card p {
    margin: 0 !important;
    font-size: 0.85em;
    line-height: 1.5;
    color: var(--md-default-fg-color--light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;

}

/* Generator Layout Styles - Premium Polish */
.generator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
    margin-top: 32px;
}

@media (min-width: 1220px) {
    .generator-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.generator-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    /* Deep, soft shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-md-color-scheme="slate"] .generator-card {
    background: rgba(30, 32, 40, 0.6);
    /* Semi-transparent dark */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.output-card {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    background: #1e1e1e;
    /* Dark background for code even in light mode */
    border: none;
    color: #f8f8f2;
}

[data-md-color-scheme="slate"] .output-card {
    background: #1e1e1e;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
}

.card-header h3 {
    margin: 0 !important;
    font-size: 1.25em !important;
    font-weight: 700 !important;
    color: #f8f8f2 !important;
    /* Always light text for code header */
    letter-spacing: 0.5px;
}

.generator-code-output {
    flex-grow: 1;
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #2d2d2d;
    /* Code editor look */
    color: #a9b7c6;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s;
}

.generator-code-output:focus {
    border-color: #4caf50;
    /* Green accent on focus */
}

/* Generator Section Styling */
.generator-card .generator-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle divider */
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    position: relative;
}

.generator-card .generator-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.generator-card h3 {
    font-size: 1.3em !important;
    margin-bottom: 16px !important;
    background: linear-gradient(135deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
    display: block;
    /* Full width for layout purposes if needed, but the border is on the section */
    padding: 0 !important;
    border-bottom: none !important;
}

/* Input Styling - Premium Look */
.input-group {
    margin-bottom: 16px;
    position: relative;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {

    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--md-default-fg-color);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group textarea {
    width: 100%;
    padding: 18px 22px;
    /* Increased padding */
    margin-bottom: 12px;
    /* Added spacing below input */
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.02);
    color: var(--md-default-fg-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
}

[data-md-color-scheme="slate"] .input-group input[type="text"],
[data-md-color-scheme="slate"] .input-group input[type="number"],
[data-md-color-scheme="slate"] .input-group textarea {
    background: rgba(255, 255, 255, 0.05);
    /* Slightly lighter than card */
    border-color: rgba(255, 255, 255, 0.05);
}

.input-group input[type="text"]:focus,
.input-group input[type="number"]:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--md-primary-fg-color);
    background: var(--md-default-bg-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

[data-md-color-scheme="slate"] .input-group input[type="text"]:focus,
[data-md-color-scheme="slate"] .input-group input[type="number"]:focus,
[data-md-color-scheme="slate"] .input-group textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.input-group textarea {
    min-height: 120px;
    resize: vertical;
}

.input-group small {
    display: block;
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--md-default-fg-color--light);
    font-style: italic;
}

/* Checkbox Styling */
.input-group label input[type="checkbox"] {
    appearance: none;
    background-color: transparent;
    margin: 0 12px 0 0;
    font: inherit;
    color: currentColor;
    width: 1.4em;
    height: 1.4em;
    border: 2px solid currentColor;
    border-radius: 6px;
    transform: translateY(-0.075em);
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

.input-group label input[type="checkbox"]::before {
    content: "";
    width: 0.8em;
    height: 0.8em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--md-primary-fg-color);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.input-group label input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Button Group Polish */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.generate-btn {
    background: linear-gradient(135deg, var(--md-primary-fg-color) 0%, var(--md-accent-fg-color) 100%);
    color: white;
    border: none;
    padding: 20px 32px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px -10px var(--md-primary-fg-color);
    text-align: center;
}

.example-btn {
    background: linear-gradient(135deg, #7e57c2 0%, #ab47bc 100%);
    /* Distinct purple gradient */
    box-shadow: 0 10px 20px -10px #7e57c2;
}

.generate-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 30px -10px var(--md-primary-fg-color);
    filter: brightness(1.1);
}

.example-btn:hover {
    box-shadow: 0 20px 30px -10px #7e57c2;
}

.generate-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Remove old style overrides block if it exists in markdown to prevent conflicts */
#outfit-generator,
#weapons-generator,
#grenade-generator,
#stackable-generator,
#books-generator,
#ammo-generator,
#aid-generator {
    max-width: none !important;
    margin: 0 !important;
}

/* Premium Dynamic List Styles */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.dynamic-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .dynamic-row {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.dynamic-row input[type="text"],
.dynamic-row input[type="number"] {
    margin-bottom: 0 !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border: 2px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 16px !important;
    background: rgba(0, 0, 0, 0.02) !important;
    color: var(--md-default-fg-color) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-sizing: border-box !important;
}

[data-md-color-scheme="slate"] .dynamic-row input[type="text"],
[data-md-color-scheme="slate"] .dynamic-row input[type="number"] {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.dynamic-row input[type="text"]:focus,
.dynamic-row input[type="number"]:focus {
    outline: none !important;
    border-color: var(--md-primary-fg-color) !important;
    background: var(--md-default-bg-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
}

[data-md-color-scheme="slate"] .dynamic-row input[type="text"]:focus,
[data-md-color-scheme="slate"] .dynamic-row input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Handle multi-input rows (like spawns) */
.dynamic-row:has(.spawn-pos),
.dynamic-row:has(.mm-pos) {
    grid-template-columns: 1fr 1fr 1fr auto;
    /* Map, Pos, Ang, Remove */
}

/* Fallback if :has isn't supported or specific classes needed, but grid usually auto-flows. 
   Better to just let them flex or use flexbox for rows with multiple inputs. */

.dynamic-row {
    display: flex;
    /* Switch back to flex for versatility */
}

.dynamic-row input {
    flex: 1;
}

.dynamic-row .small-input {
    flex: 0.5;
}

.remove-btn {
    background: #FF5252;
    color: white;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
}

.remove-btn:hover {
    background: #D32F2F;
    transform: scale(1.1);
}

.add-btn {
    background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(38, 166, 154, 0.4);
    filter: brightness(1.1);
}

/* Dropdown/Select styling */
.input-group select {
    width: 100%;
    padding: 18px 22px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.input-group select:hover {
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.input-group select:focus {
    outline: none;
    border-color: var(--md-primary-fg-color);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.input-group select option {
    padding: 12px;
    background: white;
    color: #333;
    font-size: 16px;
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .input-group select::-moz-focus-inner {
        border: 0;
    }
    
    .input-group select:-moz-focusring {
        color: transparent;
        text-shadow: 0 0 0 #333;
    }
}

/* Dark mode support for dropdowns */
[data-md-color-scheme="slate"] .input-group select {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.05);
}

[data-md-color-scheme="slate"] .input-group select:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

[data-md-color-scheme="slate"] .input-group select:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

[data-md-color-scheme="slate"] .input-group select option {
    background: #1e1e1e;
    color: #e0e0e0;
}

.add-btn:active {
    transform: translateY(0);
}

/* Hide the top navigation bar */
.md-header {
    display: none;
}

/* Adjust spacing to account for hidden header */
.md-content {
    padding-top: 0;
}

.md-content__inner {
    margin-top: 0;
}

/* Sidebar Disabling */
.md-sidebar--primary,
.md-sidebar--secondary {
    display: none;
}

.md-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.md-main__inner {
    display: block !important;
}

.md-content__inner {
    max-width: 100% !important;
}
