* {
    box-sizing: border-box;
    font-family: "Segoe UI", "Roboto", "Courier New", monospace;
}

body {
    background: #1e2a2e;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    color: #e2e8f0;
    display: flex;
    justify-content: center;
}

/* Outer container – fills viewport, no rounding */
.app-container {
    max-width: 1280px;
    width: 100%;
    height: 100vh;
    background: #11181c;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header – no rounding */
.header-bar {
    background: #0b1218;
    border-bottom: 2px solid #2d3a46;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #48b5b5;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tools dropdown */
.tools-dropdown {
    position: relative;
}

.tools-btn {
    background: #1e293b;
    border: 2px solid #3b4e6b;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    color: #b9c7d9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 12px;
    min-width: 200px;
    z-index: 100;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: #cbd5e6;
    text-decoration: none;
    font-size: 0.8rem;
    border-bottom: 1px solid #1e293b;
}

.dropdown-menu a:hover {
    background: #1e293b;
    color: #48b5b5;
}

/* ---- Three‑column layout – fills remaining height, scrolls inside ---- */
.app-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #11181c;
    overflow: hidden;
}

.left-sidebar {
    width: 260px;
    background: #0f172a;
    border-right: 2px solid #2d3a46;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.right-sidebar {
    width: 280px;
    background: #0f172a;
    border-left: 2px solid #2d3a46;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #11181c;
    min-width: 0;
    padding: 12px;
}

.table-wrapper {
    flex: 1;
    background: #0f172a;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
}

/* Section containers – compact padding */
.controls-section,
.textarea-section,
.helix-nav,
.bookmarks-section,
.saved-dna-section {
    padding: 12px;
    border-bottom: 1px solid #2d3a46;
}

.controls-section:last-child,
.textarea-section:last-child {
    border-bottom: none;
}

/* ---- Right sidebar headings – reduced margins/padding ---- */
.helix-nav h3,
.bookmarks-section h3,
.saved-dna-section h3 {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #b9c7d9;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

/* ---- Buttons (reduced rounding) ---- */
button {
    background: #2d3e44;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
    color: white;
    font-family: monospace;
}

button.primary {
    background: #2c6e6e;
    border-bottom: 2px solid #48b5b5;
}

button.success {
    background: #2b6e4c;
    border-bottom: 2px solid #67b886;
}

button.compare-toggle {
    background: #4b3b6e;
    border-bottom: 2px solid #8b6ed9;
}

button.compare-toggle.active {
    background: #6b4e9e;
    border-bottom-color: #c49eff;
}

button.diversity-remove {
    background: #8b5a2b;
    border-bottom: 2px solid #d49b3a;
}

button.random-diversity {
    background: #2b6e4c;
    border-bottom: 2px solid #67b886;
}

button.small,
button.icon-btn,
button.clear-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
}

button.clear-btn {
    background: #7f4a4a;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Textareas & links */
textarea {
    background: #0f1720;
    border: 1px solid #334155;
    color: #cbd5e6;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    resize: vertical;
    width: 100%;
}

.textarea-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.textarea-actions a {
    color: #add8e6;
    font-size: 0.7rem;
    text-decoration: none;
    font-weight: bold;
}

.textarea-actions a:hover {
    text-decoration: underline;
}

/* ---- Table header links (?) – updated to match theme ---- */
.gene-table th a {
    color: #48b5b5;
    text-decoration: none;
    font-weight: normal;
    margin-left: 4px;
}

.gene-table th a:hover {
    text-decoration: underline;
    color: #7fdbdb;
}

/* Filter bar */
.filter-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.filter-input {
    background: #0f1720;
    border: 1px solid #475569;
    color: #e2e8f0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: monospace;
    flex: 1;
    max-width: 300px;
}

.clear-filter-btn {
    background: #7f4a4a;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    color: white;
}

/* Gene table */
.gene-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 12px;
    font-family: "Courier New", monospace;
}


.gene-table th {
    background: #1e293b;
    color: #e2e8f0;
    padding: 8px 6px;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gene-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #2d3a4a;
    vertical-align: middle;
    text-align: center;
}

.gene-table tr.helix-even {
    background-color: #0f172a;
	scroll-margin-top:36px;
}

.gene-table tr.helix-odd {
    background-color: #1a2533;
	scroll-margin-top:36px;
}


/* ---- Nucleotide select – fixed width, subtle rounding, compact, centered ---- */
select.nuc-select {
    width: 72px;
    font-family: monospace;
    font-weight: bold;
    font-size: 0.77rem;
    border-radius: 5px;
    padding: 3px 5px;
    cursor: pointer;
    border: 1px solid #4b5563;
    background-color: #0a0f18;
    color: white;
    text-align: left;
    text-align-last: left;  /* centers the visible selected value */
    margin: 0;
}

/* Try to center the dropdown options (works in Firefox) */
select.nuc-select option {
    background-color: #0a0f18;
    color: white;
}

/* Color coding for selected value (keeps the select itself colored) */
select.nuc-select.A-selected {
    background-color: #facc15;
    color: #1e1a0a;
    border-color: #facc15;
}
select.nuc-select.C-selected {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}
select.nuc-select.G-selected {
    background-color: #22c55e;
    color: #0a2f1a;
    border-color: #22c55e;
}
select.nuc-select.T-selected {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* The dropdown options inside the select are NOT modified – they keep native styling */

.final-value-badge {
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Bookmark star */
.bookmark-star {
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.1s;
    display: inline-block;
    color: #4b5563;
}

.bookmark-star.bookmarked {
    color: #facc15;
    text-shadow: 0 0 2px #ffd966;
}

/* Bookmark items */
.bookmarks-list {
    overflow-y: auto;
    text-align: left;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin: 4px 0;
    background: #1e293b;
    border-radius: 8px;
    font-size: 0.7rem;
    font-family: monospace;
    cursor: pointer;
}

.bookmark-item:hover {
    background: #2d3e44;
}

.bookmark-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bookmark-info strong {
    color: #facc15;
    font-size: 0.7rem;
}

.bookmark-value-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: bold;
    margin-left: 6px;
}

.remove-bookmark {
    background: #7f4a4a;
    border: none;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: 8px;
    min-width: auto;
}

.empty-bookmarks {
    color: #7e8a98;
    font-style: italic;
    text-align: center;
    padding: 12px;
    font-size: 0.7rem;
}

/* Helix navigation */
.helix-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.helix-btn {
    background: #1e293b;
    border: 1px solid #475569;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    min-width: 36px;
}

.helix-btn:hover {
    background: #3b4e6b;
}

.helix-highlight {
    background-color: #2c6e6e !important;
    transition: background 0.1s;
}

/* Compare mode */
.diff-highlight {
    background-color: rgba(255, 140, 100, 0.25) !important;
}

.compare-load-btn {
    background: #4b3b6e;
    border-bottom: 2px solid #8b6ed9;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    cursor: pointer;
}

/* DNA Library (fully restored) */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    background: #0f172a;
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 6px;
    border: 2px solid transparent;
}

.category-item.selected {
    border-color: #3b82f6;
    background: #1e2a3a;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-name {
    flex: 1;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
}

.drag-handle {
    cursor: grab;
    color: #64748b;
    font-size: 0.8rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.entry-list {
    list-style: none;
    padding-left: 20px;
    margin: 6px 0 0;
}

.entry-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: #1e293b;
    border-radius: 6px;
    margin: 4px 0;
    cursor: pointer;
    font-size: 0.7rem;
}

.entry-item:hover {
    background: #334155;
}

.entry-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.entry-actions button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 2px 4px;
    font-size: 0.6rem;
    cursor: pointer;
    min-width: auto;
}

.entry-actions button:hover {
    color: #f1f5f9;
}

.library-controls,
.import-export-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.library-controls button,
.import-export-btns button {
    flex: 1;
    font-size: 0.7rem;
    padding: 5px 8px;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2c6e6e;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 1000;
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
}

/* Description cell */
.desc-td {
    text-align: center;
    font-size: 0.7rem;
    color: #b9c7d9;
    max-width: 180px;
    white-space: nowrap;
    overflow-x: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.desc-td:hover {
    white-space: normal;
    word-break: break-word;
}

#dnaShortenerLink {
    display: none;
    margin-right: auto;
}
#dnaShortenerLink.visible {
    display: inline;
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .left-sidebar {
        width: 220px;
    }
    .right-sidebar {
        width: 260px;
    }
}