@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Exo+2:wght@400;600;700&family=Roboto:wght@400;500&display=swap');

:root {
    --primary-bg: #0d0d1a; /* Deep space black */
    --secondary-bg: #1c1c2e; /* Dark nebula purple */
    --accent-bg: #2a2a4a; /* Cosmic blue-gray */
    --primary-accent: #7b00ff; /* Vibrant neon purple */
    --secondary-accent: #00eaff; /* Electric cyan */
    --danger-accent: #ff0066; /* Neon magenta for errors */
    --danger-accent-bg: rgba(255, 0, 102, 0.2); /* --- NEW: Background for danger highlights --- */
    --text-primary: #e6e6ff; /* Pale lavender for main text */
    --text-secondary: #b0b0ff; /* Soft blue for secondary text */
    --text-tertiary: #8080b3; /* Muted gray-purple */
    --highlight: #3a3a6a; /* Glowing blue highlight */
    --highlight-border: #d9d9d9; /* Silver border */
    --dimmed: rgba(44, 44, 77, 0.6); /* Dimmed overlay */
    --dimmed-border: #4a4a77; /* Subtle border */
    --glow: rgba(255, 255, 255, 0.3); /* White glow for "lights on" */
}

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}


#addModal .select2-container--open .select2-dropdown.select2-dropdown {
    z-index: 41000 !important; /* Increased from 31000 */
    position: absolute !important;
    background: var(--secondary-bg);
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--glow);
}



h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 3.2rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--primary-accent), 0 0 20px rgba(123, 0, 255, 0.5);
    margin: 10px 0;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

h1:hover {
    transform: scale(1.03);
    text-shadow: 0 0 15px var(--primary-accent), 0 0 25px rgba(123, 0, 255, 0.5);
}

h2, h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--secondary-accent);
}

h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

.dimmed { color: var(--text-tertiary); opacity: 0.8; }
.forced-highlight {
    background: var(--highlight);
    border: 2px solid var(--highlight-border);
    box-shadow: 0 0 10px var(--glow);
}
.forced-dim { background: var(--dimmed); border: 1px solid var(--dimmed-border); }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--accent-bg);
    box-shadow: 0 0 15px var(--glow), 0 0 30px rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.2s ease;
}

th {
    background: var(--secondary-bg);
    color: var(--text-primary);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
    text-shadow: 0 0 5px var(--glow);
}

tr:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

select, input[type="text"], input[type="number"], input[type="email"], textarea {
    padding: 10px;
    margin: 5px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--secondary-accent);
    box-shadow: 0 0 8px var(--glow);
    outline: none;
}

select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23d9d9d9" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 35px;
}

button {
    padding: 12px 24px;
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 0 10px var(--glow);
    transition: all 0.3s ease;
}

button:hover {
    background: linear-gradient(90deg, var(--secondary-accent), var(--primary-accent));
    transform: translateY(-3px);
    box-shadow: 0 0 15px var(--glow);
}

button:active {
    transform: translateY(0);
}

button.secondary {
    background: linear-gradient(90deg, var(--danger-accent), #cc0055);
}

button.secondary:hover {
    background: linear-gradient(90deg, #ff3399, var(--danger-accent));
}

.filter-box, .editor-panel, .feedback-form, .upload-section, .review, .instructions, .features, .ads {
    background: var(--secondary-bg);
    border: 2px solid #d9d9d9;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 0 15px var(--glow), 0 0 30px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.filter-box:hover, .editor-panel:hover, .feedback-form:hover, .upload-section:hover, .review:hover, .instructions:hover, .features:hover, .ads:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px var(--glow), 0 0 40px rgba(255, 255, 255, 0.25);
}

.filter-box::before, .editor-panel::before, .feedback-form::before, .upload-section::before, .review::before, .instructions::before, .features::before, .ads::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.1), transparent 70%);
    z-index: 0;
    opacity: 0.6;
}

.filter-box > *, .editor-panel > *, .feedback-form > *, .upload-section > *, .review > *, .instructions > *, .features > *, .ads > * {
    position: relative;
    z-index: 1;
}

.form-section, .editor-panel form {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.form-actions {
    flex: 1 1 100%;
    display: flex;
    justify-content: flex-end;
}

.edit-input {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

header {
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.3), var(--secondary-bg) 60%);
    padding: 20px;
    box-shadow: 0 0 25px var(--glow), 0 0 50px rgba(255, 255, 255, 0.35);
    border: 3px solid #d9d9d9;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 8px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

header:hover {
    transform: scale(1.02);
    box-shadow: 0 0 35px var(--glow), 0 0 60px rgba(255, 255, 255, 0.45);
}

.logo {
    height: 120px;
    width: auto;
    position: absolute;
    left: 20px;
    top: 30%;
    transform: translateY(-50%);
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.7));
}

.nav-links {
    display: flex;
    justify-content: center;
    padding: 0;
}

.nav-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

.nav-links li a {
    color: #e6e6ff;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.nav-links li a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.7);
}

.nav-links li a.active {
    background: rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.9);
}

.nav-links li a.disabled {
    color: #8080b3;
    cursor: not-allowed;
    text-shadow: none;
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1200;
    pointer-events: auto;
    padding: 10px; /* Increase touch area */
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.hero {
    background: linear-gradient(rgba(13, 13, 26, 0.7), rgba(13, 13, 26, 0.7)), url('/static/images/large_preview.png') center/cover no-repeat;
    padding: 80px 20px;
    text-align: center;
    border-radius: 10px;
    margin: 25px 0;
    box-shadow: 0 0 15px var(--glow), 0 0 30px rgba(255, 255, 255, 0.2);
}

.cta-button {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    box-shadow: 0 0 10px var(--glow);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: linear-gradient(90deg, var(--secondary-accent), var(--primary-accent));
    transform: translateY(-3px);
    box-shadow: 0 0 15px var(--glow);
}

.instructions ul {
    list-style: disc;
    margin-left: 25px;
    color: var(--text-secondary);
}

.features dl dt {
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--glow);
}

.features dl dd {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.ad-placeholder {
    background: var(--accent-bg);
    padding: 25px;
    text-align: center;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--glow);
    width: 100%;
    max-height: 300px;
    overflow: auto;
}

footer {
    text-align: center;
    padding: 25px;
    color: var(--text-primary);
    background: var(--secondary-bg);
    box-shadow: 0 0 15px var(--glow);
    border-radius: 8px;
}

.tagline {
    color: var(--text-primary);
    font-size: 20px;
    margin: 12px 0;
    text-align: center;
    text-shadow: 0 0 5px var(--glow);
}

.upload-instruction {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.upload-warning, .slot-warning {
    color: var(--danger-accent);
    font-weight: bold;
    margin-top: 12px;
    text-align: center;
    text-shadow: 0 0 5px rgba(255, 0, 102, 0.5);
}

#editModal, #addModal, #presetModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 26, 0.85);
    z-index: 1000;
    overflow-y: auto;
}

#editModal.active, #addModal.active, #presetModal.active {
    display: block;
    opacity: 1;
}

.modal-content {
    background: var(--secondary-bg);
    border: 2px solid #d9d9d9;
    border-radius: 10px;
    padding: 25px;
    margin: 60px auto;
    width: 90%;
    max-width: 960px;
    transform: scale(0.95);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px var(--glow), 0 0 30px rgba(255, 255, 255, 0.2);
}

.modal-content:hover {
    transform: scale(1);
    box-shadow: 0 0 20px var(--glow), 0 0 40px rgba(255, 255, 255, 0.25);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 22px;
    color: var(--secondary-accent);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #d9d9d9;
    text-shadow: 0 0 10px var(--glow);
}

#preset-list, #results, #attachment-results, #slot-items-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #d9d9d9;
    padding: 8px;
    background: var(--accent-bg);
    border-radius: 6px;
    box-shadow: inset 0 0 8px var(--glow);
}

#preset-list div, #results div, #attachment-results div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #d9d9d9;
    transition: background 0.2s ease;
}

#preset-list div.active {
    background: var(--highlight);
    color: var(--text-primary);
    font-weight: bold;
    box-shadow: 0 0 8px var(--glow);
}

.results div:hover, #attachment-results div:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.03);
}

.results img, .slot-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    transition: transform 0.3s ease;
    box-shadow: 0 0 10px var(--glow);
}

.results img:hover, .slot-item img:hover {
    transform: scale(1.08);
}

.slot-item, .attachment-list div, .cargo-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #d9d9d9;
    transition: background 0.2s ease;
}

.slot-item.attachment::before, .attachment-list div::before {
    content: "├──";
    margin-right: 8px;
    color: var(--secondary-accent);
}

.slot-item.sub-attachment::before {
    content: "│   └──";
    margin-right: 8px;
    color: var(--danger-accent);
}

.flash-messages {
    text-align: center;
    margin: 12px;
}

.flash-messages p {
    font-weight: bold;
    padding: 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px var(--glow);
    animation: fadeIn 0.5s ease forwards;
}

.flash-messages p.error {
    color: var(--danger-accent);
    border: 1px solid var(--danger-accent);
}

.flash-messages p.info, .flash-messages p.success {
    color: var(--secondary-accent);
    border: 1px solid var(--secondary-accent);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes light-pulse {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
    100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
}

.table-container {
    width: 100%;
    overflow-x: auto;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--secondary-bg);
    border: 2px solid #d9d9d9;
    border-radius: 10px;
    box-shadow: 0 0 15px var(--glow), 0 0 30px rgba(255, 255, 255, 0.2);
}

.item-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    table-layout: auto;
    background: var(--accent-bg);
}

.item-table th, .item-table td {
    padding: 10px;
    border: 1px solid #d9d9d9;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-height: 80px;
    font-size: 13px;
    vertical-align: top;
}

.item-table th {
    background: var(--secondary-bg);
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--glow);
}

.item-table th:nth-child(1), .item-table td:nth-child(1) { width: 40px; }
.item-table th:nth-child(2), .item-table td:nth-child(2) { width: 120px; }
.item-table th:nth-child(3), .item-table td:nth-child(3),
.item-table th:nth-child(4), .item-table td:nth-child(4) {
    width: 350px;
    min-width: 350px;
    max-width: 350px;
    padding: 0;
    overflow: visible;
    box-sizing: border-box;
}
.item-table th:nth-child(5), .item-table td:nth-child(5) { width: 80px; }
.item-table th:nth-child(6), .item-table td:nth-child(6) { width: 120px; }

.item-table tr:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.highlighted-row {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: var(--text-primary);
    font-weight: bold;
    text-shadow: 0 0 8px rgba(123, 0, 255, 0.6);
    animation: light-pulse 2s infinite alternate;
}

.item-table .attachment-list, .item-table .cargo-list {
    display: block;
    position: relative;
    width: 350px;
    min-width: 350px;
    max-width: 350px;
    max-height: 220px;
    font-size: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    white-space: normal;
}

.item-table .group {
    border: 1px solid #d9d9d9;
    padding: 5px;
    margin: 2px 0;
    border-radius: 6px;
    background: var(--secondary-bg);
    box-shadow: 0 0 5px var(--glow);
    font-size: 12px;
    width: 340px;
    min-width: 340px;
    box-sizing: border-box;
}

.group-header {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 14px;
    text-shadow: 0 0 5px var(--glow);
}

.modal-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 100%;
}

.edit-panel, .preview-panel {
    flex: 1;
    min-width: 320px;
    background: var(--secondary-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--glow);
}

.preview-panel {
    border: 1px solid #d9d9d9;
    max-height: 550px;
    overflow-y: auto;
    min-width: 380px;
}

.preview-panel pre {
    white-space: pre-wrap;
    font-family: 'Roboto', monospace;
    font-size: 12px;
    color: var(--text-primary);
    margin: 0;
    word-break: normal;
}

.cargo-group, .attachment-group {
    border: 1px solid #d9d9d9;
    padding: 8px;
    margin: 8px 0;
    border-radius: 6px;
    background: var(--accent-bg);
    box-shadow: 0 0 8px var(--glow);
}

.attachment-item, .cargo-item, .preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    flex-wrap: wrap;
}

.attachment-item select, .cargo-item select {
    flex: 1;
    max-width: 220px;
}

.attachment-item .item-name, .cargo-item .item-name, .preset-item .item-name {
    flex: 1;
    min-width: 140px;
    color: var(--text-primary);
}

.attachment-item button, .cargo-item button, .preset-item button {
    margin-left: 10px;
}

.item-list {
    max-height: 550px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
}

.control-group:not(.item-picker) {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group.item-picker {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 12px;
}

.control-label {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    margin: 0;
    text-shadow: 0 0 5px var(--glow);
}

#dynamicItemPicker {
    width: 380px;
    background: var(--secondary-bg);
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 10px;
    color: var(--text-primary);
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    box-shadow: 0 0 10px var(--glow);
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23d9d9d9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select2-container--open .select2-dropdown {
    z-index: 1000000 !important; /* Insanely high to override everything */
    position: absolute !important;
    background: var(--secondary-bg);
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--glow);
}

.item-picker .select2-container {
    width: 380px !important;
    animation: light-pulse 2s infinite alternate;
}

/* CORRECTED VERSION for style.css */

.item-picker .select2-container--default .select2-selection--single {
    background: #ffffff; /* Changed to white */
    border: 1px solid #cccccc; /* A standard light border */
    border-radius: 8px;
    height: 42px;
    box-shadow: none; /* Removed glow */
}

.item-picker .select2-selection__rendered {
    line-height: 40px; /* Adjusted for centering */
    padding-left: 16px;
    color: #333333; /* Changed to a dark, readable text color */
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    text-shadow: none; /* Removed the shadow that makes it "fuzzy" */
}

.item-picker .select2-selection__arrow {
    height: 42px;
    right: 12px;
}

.item-picker .select2-results__option {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--secondary-accent);
    font-family: 'Exo 2', sans-serif;
    transition: all 0.3s ease;
}

.item-picker .select2-results__option--highlighted {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: var(--text-primary);
    text-shadow: 0 0 6px rgba(123, 0, 255, 0.6);
}

.item-picker .select2-results__group {
    font-weight: 700;
    color: #d9d9d9;
    padding: 14px 16px;
    font-size: 15px;
    text-shadow: 0 0 5px var(--glow);
}

.item-picker .select2-container--disabled .select2-selection--single {
    background: var(--dimmed);
    border-color: var(--dimmed-border);
    cursor: not-allowed;
    box-shadow: none;
}

.content-boxes {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.content-box {
    background: var(--secondary-bg);
    border: 2px solid #d9d9d9;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px var(--glow), 0 0 30px rgba(255, 255, 255, 0.2);
    flex: 1;
    min-width: 280px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px var(--glow), 0 0 40px rgba(255, 255, 255, 0.25);
}

.content-box h3 {
    margin: 0 0 10px 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: var(--secondary-accent);
    text-shadow: 0 0 6px rgba(0, 234, 255, 0.5);
}

.content-box p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
/* ============================================= */
/* === FORCE CHOICES.JS DROPDOWN BACKGROUND === */
/* ============================================= */

/* Ensure the overall dropdown container has a dark background */
.choices__list--dropdown,
.choices__list[aria-expanded] {
     background-color: #2a2a4a !important; /* Use your accent background color */
     border: 1px solid var(--highlight-border) !important; /* Use a brighter border */
     z-index: 55 !important;
}

/* Target the dropdown list items (keep original light color or adjust slightly) */
.choices__list--dropdown .choices__item--choice,
.choices__list[aria-expanded] .choices__item--choice {
    color: var(--text-secondary) !important; /* Use your secondary text color (light blue/lavender) */
    background-color: transparent !important; /* Make item background transparent */
    padding: 10px !important;
    margin: 0 !important;
    font-size: 14px !important;
}

/* Style the highlighted item */
.choices__list--dropdown .choices__item--choice.is-highlighted,
.choices__list[aria-expanded] .choices__item--choice.is-highlighted {
    background-color: var(--primary-accent) !important; /* Use your primary accent (purple) for highlight */
    color: #ffffff !important; /* White text when highlighted */
}

 /* Style the input field where you type (match your theme) */
 .choices__input--cloned {
    color: var(--text-primary) !important;
    background-color: var(--secondary-bg) !important; /* Slightly darker than accent for input */
    padding: 8px !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--highlight-border) !important; /* Add a bottom border */
 }

 /* Style the placeholder text */
.choices__list .choices__placeholder {
     color: var(--text-tertiary) !important; /* Muted gray-purple */
 }

@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 12px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    .form-section, .editor-panel form {
        flex-direction: column;
        align-items: stretch;
    }

    select, input, button, textarea {
        width: 100%;
        margin: 6px 0;
        font-size: 13px;
    }

    th, td {
        padding: 8px 12px;
    }

    .item-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .modal-content {
        margin: 30px auto;
        max-width: 95vw;
    }

    .logo {
        height: 90px;
        left: 12px;
    }

    .content-boxes {
        flex-direction: column;
    }

    .content-box {
        min-width: 100%;
    }

    .item-table .attachment-list, .item-table .cargo-list {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .modal-container {
        flex-direction: column;
        gap: 8px;
    }

    .edit-panel, .preview-panel {
        min-width: 100%;
    }

    .item-table th:nth-child(3), .item-table td:nth-child(3),
    .item-table th:nth-child(4), .item-table td:nth-child(4) {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .item-table .group {
        min-width: 270px;
    }

    .attachment-item, .cargo-item, .preset-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .attachment-item .item-name, .cargo-item .item-name, .preset-item .item-name {
        min-width: 100%;
    }

    .attachment-item select, .cargo-item select {
        width: 100%;
    }

    .attachment-item button, .cargo-item button, .preset-item button {
        margin-left: 0;
        margin-top: 6px;
    }

    .ad-placeholder {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    /* Mobile Navigation Styles */
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        background: var(--secondary-bg);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        border-radius: 0 0 8px 8px;
    }

    .nav-links.active {
        display: block;
    }

    .nav-links ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #d9d9d9;
        text-align: center;
    }

    .nav-links li a:hover {
        background: var(--highlight);
        transform: none;
    }

    header {
        padding-bottom: 15px;
    }

    header {
        position: relative;
        z-index: 1000; /* Ensure header doesn't block hamburger */
    }

    .logo {
        z-index: 1100; /* Below hamburger */
    }

    .tagline {
        z-index: 1100; /* Below hamburger */
    }


    .table-container {
        overflow-x: auto;
        position: relative;
        width: 100%;
        margin-top: 20px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    /* Scroll indicator */
    .scroll-indicator {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.2);
        padding: 5px 10px;
        border-radius: 10px;
        font-size: 12px;
        color: var(--text-primary);
        z-index: 1000;
        box-shadow: 0 0 5px var(--glow);
        transition: opacity 0.3s ease;
    }

    /* Modal adjustments */
    #editModal {
        top: 0;
        height: 100%;
    }

    .modal-content {
        width: 95%;
        max-width: 300px;
        padding: 10px;
        margin: 5px auto;
    }

    .modal-content .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content .form-group input {
        width: 100%;
    }

    /* Table column adjustments */
    .item-table {
        font-size: 10px;
    }

    .item-table th, .item-table td {
        padding: 4px !important;
    }

    .item-table th:nth-child(1), .item-table td:nth-child(1) {
        width: 30px !important;
    }

    .item-table th:nth-child(2), .item-table td:nth-child(2) {
        width: 120px !important;
    }

    .item-table th:nth-child(3), .item-table td:nth-child(3) {
        width: 40px !important;
    }

    .item-table th:nth-child(4), .item-table td:nth-child(4) {
        width: 40px !important;
    }

    .item-table th:nth-child(5), .item-table td:nth-child(5) {
        width: 40px !important;
    }

    .item-table th:nth-child(6), .item-table td:nth-child(6) {
        display: none;
    }

    .item-table th:nth-child(7), .item-table td:nth-child(7) {
        display: none;
    }

    .item-table th:nth-child(8), .item-table td:nth-child(8) {
        width: 60px !important;
    }

    .item-table th:nth-child(9), .item-table td:nth-child(9) {
        display: none;
    }

    .item-table th:nth-child(10), .item-table td:nth-child(10) {
        display: none;
    }

    .item-table th:nth-child(11), .item-table td:nth-child(11) {
        display: none;
    }

    .item-table th:nth-child(12), .item-table td:nth-child(12) {
        width: 50px !important;
    }

    /* Form adjustments */
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group label {
        width: 100%;
        margin-bottom: 4px;
    }

    .form-group select, .form-group input {
        width: 100%;
        max-width: none;
    }

    .item-picker .select2-container {
        width: 100% !important;
    }

    /* Add new rules here */
    #editModal, #addModal, #presetModal {
        top: 0 !important;
        height: 100% !important;
    }

    .language-selector {
        background: var(--secondary-bg);
        border: 1px solid #d9d9d9;
        color: var(--text-primary);
        padding: 8px;
        border-radius: 6px;
        font-family: 'Exo 2', sans-serif;
        font-size: 14px;
        cursor: pointer;
        box-shadow: 0 0 5px var(--glow);
        appearance: none;
        background-image: url('data:image/svg+xml;utf8,<svg fill="%23d9d9d9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
        background-position: right 8px center;
        background-repeat: no-repeat;
        background-size: 12px;
        padding-right: 30px;
        width: 120px;
    }

    .language-selector:focus {
        border-color: var(--secondary-accent);
        box-shadow: 0 0 8px var(--glow);
        outline: none;
    }

    @media (max-width: 768px) {
        .language-selector {
            width: 100%;
            margin: 10px 0;
        }

        .nav-links li {
            text-align: center;
        }
    }
}