/* =============================================================================
   Ship Context Bar - production styles for #ship-navigation-panel
   Prefix: cab- (contextual action bar)
   ============================================================================= */

/* ── Bar layout ────────────────────────────────────────────────────────────── */

.cab-bar {
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, rgb(7 8 13 / 90%) 0%, rgb(7 7 13 / 90%) 100%);
    border: 1px solid rgba(197, 160, 89, 0.12);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    position: relative;
    min-height: 80px;
}

.cab-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(/assets/parchment-BIko6U1V.avif);
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

.cab-bar > * {
    position: relative;
    z-index: 1;
}

/* ── POI slots - left zone ─────────────────────────────────────────────────── */

.cab-slots {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

#ship-navigation-panel .cab-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 51px;
    height: 51px;
    border: 1px solid rgba(197, 160, 89, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(197, 160, 89, 0.03);
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        box-shadow 0.15s;
}

#ship-navigation-panel .cab-slot::before {
    display: none;
}

#ship-navigation-panel .cab-slot:hover {
    background: rgba(197, 160, 89, 0.09);
    border-color: rgba(197, 160, 89, 0.35);
}

#ship-navigation-panel .cab-slot.is-active {
    background: rgba(197, 160, 89, 0.14);
    border-color: rgba(197, 160, 89, 0.55);
    box-shadow:
        0 0 8px rgba(197, 160, 89, 0.18),
        inset 0 0 6px rgba(197, 160, 89, 0.1);
}

#ship-navigation-panel .cab-slot.is-zero {
    opacity: 0.35;
}

.cab-slot-icon {
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cab-slot-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Slightly smaller icons for fishing, mining, ships to balance visual weight */
.cab-slot-img--sm {
    width: 22px;
    height: 22px;
    margin-top: -4px;
}

/* ── Slot count badge ──────────────────────────────────────────────────────── */

.cab-slot-badge {
    position: absolute;
    top: -6px;
    right: -5px;
    background: rgb(18 19 22);
    border: 1px solid rgb(39 40 42);
    color: var(--gold);
    border-radius: var(--radius-sm);
    padding: 2px 4px;
    font-size: var(--font-size-xs);
    letter-spacing: 0.03em;
    font-weight: 600;
}

.cab-slot-label {
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ── Context zone - right panel ────────────────────────────────────────────── */

.cab-context {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-lg) 0 var(--space-md);
    width: 33%;
    flex-shrink: 0;
    border-left: 1px solid rgba(197, 160, 89, 0.15);
    background: rgba(197, 160, 89, 0.05);
}

.cab-entity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cab-entity-ref {
    font-size: 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-family: var(--font-body);
}

.cab-entity-name {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cab-entity-sub {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── CTA action button ─────────────────────────────────────────────────────── */

.cab-cta {
    display: none;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(197, 160, 89, 0.18);
    border: 1px solid rgba(197, 160, 89, 0.45);
    border-radius: var(--radius-sm);
    color: var(--gold);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.12s;
}

.cab-cta:hover {
    background: rgba(197, 160, 89, 0.28);
}

.cab-cta-void {
    font-size: var(--font-size-xs);
    font-style: italic;
    color: var(--text-tertiary);
}

/* ── Locate / cancel icon buttons ─────────────────────────────────────────── */

.cab-locate-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    background: none;
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: var(--radius-sm);
    color: rgba(197, 160, 89, 0.6);
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s;
    margin-left: -0.3rem;
}

.cab-locate-btn:hover {
    border-color: rgba(197, 160, 89, 0.6);
    color: var(--gold);
}

#cab-cancel-btn {
    display: none;
}

.cab-btn-icon {
    width: 1.2rem;
    height: 1.2rem;
    opacity: 0.6;
    display: block;
}

.cab-locate-btn:hover .cab-btn-icon {
    opacity: 1;
}

/* ── CTA variants ──────────────────────────────────────────────────────────── */

.cab-cta.is-dock {
    background: rgba(197, 160, 89, 0.22);
    border-color: rgba(197, 160, 89, 0.55);
}

.cab-cta.is-dock:hover {
    background: rgba(197, 160, 89, 0.32);
}

.cab-cta.is-sail {
    background: rgba(197, 160, 89, 0.12);
    border-color: rgba(197, 160, 89, 0.35);
}

.cab-cta.is-icon {
    padding: 0 0.5rem;
    margin-top: -1px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cab-cta-icon {
    width: 1.6rem;
    height: 1.6rem;
    display: block;
}
.cab-cta-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    margin-left: 0.5rem;
}

.cab-cta.is-danger {
    background: var(--cab-engage-bg);
    border-color: var(--cab-engage-border);
    color: var(--text-danger);
}

.cab-cta.is-danger:hover {
    background: rgba(180, 30, 30, 0.4);
}

.cab-cta.is-danger.is-engaged,
.cab-cta.is-danger.is-engaged:hover {
    background: var(--cab-engaged-bg);
    cursor: default;
    pointer-events: none;
}

.cab-cta.is-locked {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.08);
    opacity: 0.5;
    pointer-events: none;
}

/* ── Nearby entities drawer ────────────────────────────────────────────────── */

.cab-drawer {
    display: none;
    background: rgba(8, 12, 18, 0.97);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.cab-drawer.is-open {
    display: block;
}

.cab-drawer-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
}

.cab-row-icon {
    display: block;
    width: 1em;
    height: 1em;
    object-fit: contain;
    opacity: 0.85;
}

.cab-drawer-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    flex: 1;
}

.cab-drawer-count {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-family: var(--font-body);
}

.cab-drawer-close {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.1rem var(--space-2xs);
    border-radius: var(--radius-sm);
    line-height: 1;
}

.cab-drawer-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.cab-drawer-body {
    display: flex;
    flex-direction: column;
    max-height: 250px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cab-drawer-empty {
    padding: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-style: italic;
}

.cab-drawer-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.1s;
}

.cab-drawer-row:last-child {
    border-bottom: none;
}

.cab-drawer-row:hover {
    background: rgba(197, 160, 89, 0.04);
}

/* ── Drawer row - navigation column (bearing / distance / ETA) ─────────────── */

.cab-row-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
    min-width: 60px;
}

.cab-row-bearing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    min-width: 16px;
    color: rgba(197, 160, 89, 0.6);
}

.cab-row-bearing-icon {
    width: 14px;
    height: 14px;
    transform: rotate(calc(var(--cab-bearing-deg, 0) * 1deg));
    transform-origin: center;
}

.cab-row-dist {
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 40px;
}

/* ── Drawer row - entity info column ──────────────────────────────────────── */

.cab-row-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.cab-row-name {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cab-row-tag {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(197, 160, 89, 0.35);
    border-radius: var(--radius-sm);
    padding: 1px var(--space-2xs);
    line-height: 1.3;
}

.cab-row-type {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.cab-row-label {
    color: var(--text-muted, var(--text-tertiary));
    font-size: var(--font-size-sm);
}

.cab-row-value {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
}

.cab-row-btn {
    padding: var(--space-2xs) var(--space-xs);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(197, 160, 89, 0.1);
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: var(--radius-sm);
    color: var(--gold);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.12s;
}

.cab-row-btn:hover {
    background: rgba(197, 160, 89, 0.2);
}

.cab-row-btn.is-danger {
    background: rgba(180, 40, 40, 0.15);
    border-color: rgba(200, 70, 70, 0.35);
    color: var(--text-danger);
}

.cab-row-btn.is-danger:hover {
    background: rgba(180, 40, 40, 0.28);
}

.cab-row-btn.is-disabled,
.cab-row-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.cab-row-actions {
    display: flex;
    gap: var(--space-2xs);
    flex-shrink: 0;
    align-items: center;
}

/* ── Legacy .scb-btn - used by tile inspector ──────────────────────────────── */

.scb-btn {
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    min-width: 82px;
    font-weight: 600;
    background: rgba(197, 160, 89, 0.12);
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: var(--radius-sm);
    color: var(--gold);
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    transition:
        background 0.15s,
        color 0.15s;
}

.scb-btn:hover {
    background: rgba(197, 160, 89, 0.22);
    color: #f0d585;
}

.scb-btn--sec {
    background: transparent;
    color: var(--text-secondary);
    border-color: rgba(197, 160, 89, 0.12);
    font-weight: 400;
}

.scb-btn--sec:hover {
    background: rgba(197, 160, 89, 0.08);
    color: var(--gold);
}
