/* ─── Typography ─────────────────────────────────────────────────────────── */

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif !important;
}

body, button, input, select, textarea {
    font-family: inherit !important;
}

/* ─── Force light mode ───────────────────────────────────────────────────── */

html, body {
    background-color: white !important;
    color: #4a4a4a !important;
}

.navbar, .box, .table, .card, .panel, .message {
    background-color: white !important;
    color: #4a4a4a !important;
}

.title, .subtitle, .label, .menu-label {
    color: #363636 !important;
}

input, textarea, select, .input, .textarea, .select select {
    background-color: white !important;
    color: #363636 !important;
    border-color: #dbdbdb !important;
}

.input::placeholder, input::placeholder, textarea::placeholder {
    color: #b5b5b5 !important;
    opacity: 1 !important;
}

.control.has-icons-left .icon, .control.has-icons-right .icon {
    color: #7a7a7a !important;
}

.table tbody tr {
    background-color: white !important;
    color: #363636 !important;
}

.table.is-striped tbody tr:nth-child(even) {
    background-color: #f5f5f5 !important;
}

.table td, .table th {
    color: #363636 !important;
    font-size: 0.95rem;
}

strong, b, .has-text-weight-bold {
    color: #363636 !important;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: white !important;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: white !important;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */

.navbar-menu {
    display: flex !important;
}

.navbar-end {
    margin-left: auto;
}

/* ─── Left menu ──────────────────────────────────────────────────────────── */

.left-menu {
    width: 250px;
    padding: 0;
    overflow-y: auto;
    flex-shrink: 0;
    background-color: #f5f5f5 !important;
}

.menu-header {
    padding: 1.5rem;
    text-align: center;
}

.menu-items {
    padding: 0.5rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: none;
    width: 100%;
    background: transparent;
    color: #4a4a4a;
    transition: background-color 0.15s ease;
}

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-item.is-active {
    background-color: #00d1b2;
    color: #363636 !important;
}

.menu-item.is-active:hover {
    background-color: #00c4a7;
}

.menu-item.is-active .menu-label {
    color: #363636 !important;
}

.menu-item .icon {
    margin-right: 0.75rem;
    width: 1.25rem;
}

.menu-label {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Lab items */
.menu-item.is-lab {
    color: #7a7a7a;
}

.menu-item.is-lab:hover {
    color: #4a4a4a;
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-item.is-lab.is-active {
    background-color: #00d1b2;
    color: #363636 !important;
}

/* Collapsible Lab section */
.lab-section summary::-webkit-details-marker,
.lab-section summary::marker {
    display: none;
}

.lab-section summary {
    list-style: none;
}

.lab-section summary::before {
    content: "\f054";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.6rem;
    margin-right: 0.4rem;
    display: inline-block;
    transition: transform 0.15s;
}

.lab-section[open] summary::before {
    transform: rotate(90deg);
}

/* ─── Exchange metadata disclosure (pedigree + comment) ─────────────────── */

.exchange-meta {
    display: inline-block;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.exchange-meta__summary::-webkit-details-marker,
.exchange-meta__summary::marker {
    display: none;
    content: "";
}

.exchange-meta__summary {
    list-style: none;
    display: inline-block;
    width: 1rem;
    height: 1rem;
    line-height: 1rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: #7a7a7a;
    border: 1px solid #dbdbdb;
    border-radius: 50%;
    font-size: 0.65rem;
}

.exchange-meta__summary::before {
    content: "i";
    font-family: serif;
    font-style: italic;
    font-weight: 700;
}

.exchange-meta[open] .exchange-meta__summary {
    color: #00d1b2;
    border-color: #00d1b2;
}

.exchange-meta__body {
    display: block;
    margin-top: 0.4rem;
    padding: 0.5rem 0.6rem;
    background: #fafafa;
    border-left: 2px solid #dbdbdb;
    border-radius: 2px;
    font-size: 0.85rem;
}

.exchange-meta__comment {
    margin: 0.35rem 0 0 0;
    color: #4a4a4a;
}

.pedigree-grid {
    display: inline-flex;
    gap: 0.25rem;
}

.pedigree-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    line-height: 1;
}

.pedigree-cell__label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.pedigree-cell__score {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.1rem;
}

.pedigree-cell--1 {
    background: #dcfce7;
    color: #15803d;
}

.pedigree-cell--2 {
    background: #ecfccb;
    color: #4d7c0f;
}

.pedigree-cell--3 {
    background: #fef9c3;
    color: #a16207;
}

.pedigree-cell--4 {
    background: #ffedd5;
    color: #c2410c;
}

.pedigree-cell--5 {
    background: #fee2e2;
    color: #b91c1c;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */

.tabs.is-boxed li.is-active a {
    background-color: #00d1b2 !important;
    border-color: #00d1b2 !important;
    color: #363636 !important;
}

.tabs.is-boxed li:not(.is-active) a {
    background-color: white;
    border-color: #b5b5b5;
    color: #4a4a4a;
}

.tabs.is-boxed li:not(.is-active) a:hover {
    background-color: #f5f5f5 !important;
    border-color: #7a7a7a !important;
    color: #363636 !important;
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .left-menu {
        position: fixed;
        left: -250px;
        height: 100vh;
        z-index: 40;
        transition: left 0.2s;
    }
    .left-menu.is-active {
        left: 0;
    }
    .main-content {
        padding-top: 3rem;
    }
}

/* Row overflow menu: a Bulma dropdown toggled by Elm state (.is-active). */
.row-action-menu .dropdown-menu {
    z-index: 50; /* above the fixed left menu (z-index 40) */
}
/* Force the light palette: Bulma 1.0 otherwise flips the dropdown to dark when
   the OS is in dark mode, which clashes with the rest of the (light) UI. */
.row-action-menu .dropdown-content {
    background-color: #ffffff;
}
/* Render <button> items as full-width, left-aligned dropdown rows. */
.row-action-menu button.dropdown-item {
    width: 100%;
    border: none;
    background-color: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: #363636;
}
.row-action-menu button.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #0a0a0a;
}
