/**
 * Selection Studio — Sovereign Dark Top Bar
 * Location: /studio/css/topbar.css
 */

.studio-topbar {
    width: 100%;
    height: 52px;
    background: var(--bg-panel, #0f171e);
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    display: grid;
    grid-template-columns: 260px 1fr auto;
    align-items: center;
    padding: 0 16px;
    box-sizing: border-box;
    z-index: 100;
}

#topbar-fundament-anchor,
#topbar-center-hub,
#topbar-future-reserve {
    min-width: 0;
}

#topbar-center-hub {
    display: flex;
    justify-content: center;
}

#topbar-future-reserve {
    display: flex;
    justify-content: flex-end;
}

.topbar-product-zone,
.topbar-delivery-zone,
.topbar-command-center {
    display: flex;
    align-items: center;
}

/* Product Identity (Levo) */
.selection-product-identity {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.selection-product-logo {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    border-radius: 6px;
}

.selection-product-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.015em;
    white-space: nowrap;
}

/* Central Hub Command Buttons (Sredina) */
.topbar-command-center {
    position: relative;
    justify-content: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
}

.topbar-command {
    position: relative;
    min-width: 0;
}

.topbar-command-button {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    /* 👈 Fiksirano sa 44px na tanak 34px profil */
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.topbar-command-button:hover,
.topbar-command-button[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
}

.topbar-command-label {
    color: var(--muted, rgba(255, 255, 255, 0.4));
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.topbar-command-value {
    color: #ffffff;
    font-size: 12px;
    font-weight: 590;
    line-height: 1.2;
}

.topbar-command-chevron {
    color: var(--muted, rgba(255, 255, 255, 0.4));
    font-size: 11px;
    margin-left: 2px;
    transition: transform 140ms ease;
}

.topbar-command-button[aria-expanded="true"] .topbar-command-chevron {
    transform: rotate(180deg);
}

/* Delivery Zone (Desno - Archived, Autosave, Publish, Live) */
.topbar-delivery-zone {
    justify-content: flex-end;
    gap: 12px;
    /* 👈 Pravilan razmak sprečava slepljivanje sa Live dugmetom */
}

/* Archived Lifecycle Button */
.topbar-lifecycle-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.85);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.topbar-lifecycle-button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.topbar-lifecycle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(212, 180, 131, 0.18);
    border: 1px solid rgba(212, 180, 131, 0.35);
    color: var(--gold, #d4b483);
    font-size: 10px;
    font-weight: 700;
}

/* Save Status Indicator */
.topbar-save-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted, rgba(255, 255, 255, 0.5));
    font-size: 12px;
    white-space: nowrap;
}

.topbar-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #48a868;
    box-shadow: 0 0 8px rgba(72, 168, 104, 0.4);
}

/* Publish & Live Actions */
.topbar-publish-action,
.topbar-live-action {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 140ms ease;
}

.topbar-publish-action {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.topbar-publish-action:hover {
    background: rgba(255, 255, 255, 0.12);
}

.topbar-live-action {
    gap: 5px;
    border: none;
    background: var(--gold, #d4b483);
    color: #0b1116;
    font-weight: 650;
}

.topbar-live-action:hover {
    filter: brightness(1.1);
}

.topbar-live-action.is-disabled {
    pointer-events: none;
    opacity: 0.35;
}

/* Dropdown Menus */
.topbar-menu {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 8px);
    left: 0;
    display: none;
    width: 260px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #0f171e;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.topbar-menu.topbar-menu-right {
    left: auto;
    right: 0;
}

.topbar-menu.is-open {
    display: block;
}

.topbar-menu-heading {
    padding: 8px 10px 4px;
    color: var(--muted, rgba(255, 255, 255, 0.4));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.topbar-menu-list {
    display: grid;
    gap: 2px;
}

.topbar-menu-item {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.topbar-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.topbar-menu-item.is-selected {
    background: rgba(39, 117, 255, 0.12);
    color: #fff;
}

.topbar-menu-item.is-destructive {
    color: #ff6961;
}

.topbar-menu-item.is-destructive:hover {
    background: rgba(255, 105, 97, 0.1);
}

.topbar-menu-separator {
    height: 1px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.06);
}

.topbar-menu-empty {
    padding: 16px 12px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}