/* ============================================================
   buildlog-mods.css
   Styles for the "Parts used in this build" section on buildlog.php
   Reuses mods-tab.css classes for badges, cells, forms.
   Only layout/section-specific styles live here.
============================================================ */

/* ----------------------------------------------------------------
   Section wrapper
---------------------------------------------------------------- */
.blmods-section {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .625rem;
}

/* New build highlight — draws attention when isNewBuild is true */
.blmods-section--new {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .1);
}

.blmods-section--new .blmods-heading {
    color: #0d6efd;
}

/* ----------------------------------------------------------------
   Header row
---------------------------------------------------------------- */
.blmods-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.blmods-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .4rem;
    color: #212529;
}

.blmods-heading .ti {
    font-size: 1.1rem;
    opacity: .7;
}

/* ----------------------------------------------------------------
   Add part button
---------------------------------------------------------------- */
.blmods-add-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: .45rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    background: #fff;
    color: #212529;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.blmods-add-toggle:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

.blmods-add-toggle:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* ----------------------------------------------------------------
   Empty states
---------------------------------------------------------------- */
.blmods-empty {
    color: #6c757d;
    font-size: .9rem;
    margin: 0;
}

.blmods-empty--owner {
    text-align: center;
    padding: 2rem 1rem;
}

.blmods-empty--owner .ti {
    font-size: 2rem;
    display: block;
    margin-bottom: .5rem;
    opacity: .35;
}

.blmods-empty--owner p {
    margin: 0 0 .25rem;
}

.blmods-empty__sub {
    font-size: .85rem;
    color: #6c757d;
}

/* ----------------------------------------------------------------
   Table — reuses .mods-table styles from mods-tab.css
   Only overrides needed for the buildlog context
---------------------------------------------------------------- */
.blmods-table-wrap {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.blmods-table-wrap:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

.blmods-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.blmods-table thead th {
    padding: .6rem 1rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    white-space: nowrap;
}

.blmods-table tbody tr {
    transition: background .1s;
}

.blmods-table tbody tr:hover {
    background: #f8f9fa;
}

.blmods-table tbody tr + tr {
    border-top: 1px solid #f1f3f5;
}

.blmods-table td {
    padding: .75rem 1rem;
    vertical-align: middle;
}

/* ----------------------------------------------------------------
   Edit / add form wrappers — reuse mods-edit-form styles
---------------------------------------------------------------- */
.blmods-edit-wrap,
.blmods-add-form-wrap {
    margin-bottom: 1rem;
}

.blmods-edit-form,
.blmods-add-form {
    border-left-color: #0d6efd;
}

/* ----------------------------------------------------------------
   New build prompt banner
   Shown above the section when isNewBuild === true
---------------------------------------------------------------- */
.blmods-new-prompt {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: .5rem;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    color: #1e40af;
}

.blmods-new-prompt .ti {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: .05rem;
}

.blmods-new-prompt p {
    margin: 0;
}

.blmods-new-prompt strong {
    display: block;
    margin-bottom: .2rem;
}

/* ----------------------------------------------------------------
   Responsive
---------------------------------------------------------------- */
@media (max-width: 575px) {
    .blmods-section {
        padding: 1rem;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .blmods-table thead { display: none; }

    .blmods-table,
    .blmods-table tbody,
    .blmods-table tr { display: block; width: 100%; }

    .blmods-table tbody tr {
        padding: .875rem 1rem;
        border-top: 1px solid #dee2e6;
    }

    .blmods-table td {
        display: flex;
        align-items: baseline;
        gap: .5rem;
        padding: .25rem 0;
        border: none;
    }

    .blmods-table td[data-label]:not([data-label=""])::before {
        content: attr(data-label) ":";
        font-size: .75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: #6c757d;
        min-width: 80px;
        flex-shrink: 0;
    }

    .blmods-table-wrap {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .blmods-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .blmods-add-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* ----------------------------------------------------------------
   Series-specific styles
---------------------------------------------------------------- */

/* Page column */
.blmods-cell-page {
    white-space: nowrap;
    min-width: 80px;
}

/* Link to the specific page this mod was added from */
.blmods-page-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .85rem;
    color: #6c757d;
    text-decoration: none;
}

.blmods-page-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.blmods-page-link:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Dot indicator for the current page */
.blmods-page-link--current {
    color: #0d6efd;
    font-weight: 500;
}

.blmods-page-current-indicator {
    font-size: .6rem;
    vertical-align: middle;
}

/* Info note in the add form for series builds */
.blmods-series-note {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .85rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: .375rem;
    padding: .625rem .75rem;
    margin-bottom: 1rem;
}

.blmods-series-note .ti {
    flex-shrink: 0;
    margin-top: .1rem;
}

.blmods-series-note p {
    margin: 0;
}

/* ----------------------------------------------------------------
   Vendor / Installer field
---------------------------------------------------------------- */
.mods-vendor-search-wrap {
    position: relative;
}

.mods-vendor-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.mods-vendor-result {
    padding: 8px 14px;
    font-size: .875rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background .1s;
}

.mods-vendor-result:last-child { border-bottom: none; }
.mods-vendor-result:hover,
.mods-vendor-result--focused { background: #f1f3f5; }
.mods-vendor-result--empty { color: #adb5bd; font-style: italic; cursor: default; }
.mods-vendor-result--empty:hover { background: transparent; }

.mods-vendor-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: .875rem;
    color: #212529;
    background: #f0f4ff;
    border: 1px solid #c5d3f6;
    border-radius: .375rem;
    padding: 6px 12px;
}

.mods-vendor-selected__name {
    flex: 1;
    font-weight: 500;
}

.mods-vendor-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    min-width: 24px;
    min-height: 24px;
    justify-content: center;
    border-radius: 50%;
    transition: color .15s, background .15s;
}

.mods-vendor-clear:hover { color: #dc3545; background: #fff; }
.mods-vendor-clear:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }

.mods-vendor-link {
    color: #0d6efd;
    text-decoration: none;
    font-size: .875rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.mods-vendor-link:hover { text-decoration: underline; }
.mods-vendor-link:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; border-radius: 2px; }

.mods-add-form__hint {
    font-size: .78rem;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 0;
}

.mods-add-form__hint a { color: #0d6efd; text-decoration: none; }
.mods-add-form__hint a:hover { text-decoration: underline; }