/* ============================================================
   LeafRelay Navigation Styles
   ============================================================ */

/* --- Sidebar icon colors --- */
.leafrelay-nav .navbar-icon svg {
    stroke: currentColor;
    transition: stroke 0.2s ease;
}
.leafrelay-nav .nav-item.active .navbar-icon svg,
.leafrelay-nav .nav-item:hover .navbar-icon svg {
    stroke: var(--steve-emerald, #10b981);
}

/* --- Hide dropdown arrows when sidebar collapsed --- */
.leftbar-closed .leafrelay-nav .arrow {
    display: none !important;
}

/* --- Avatar circle --- */
.lr-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--steve-emerald, #10b981), #14b8a6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Push user item to bottom --- */
.lr-user-item {
    margin-top: auto;
}

/* --- Active indicator: emerald left bar --- */
.leafrelay-nav .nav-item.active > .nav-link {
    position: relative;
}
.leafrelay-nav .nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--steve-emerald, #10b981);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* --- Search trigger kbd font --- */
.lr-search-trigger kbd {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Headbar override --- */
.headbar {
    background: transparent !important;
    border-bottom: 1px solid var(--steve-border, rgba(148, 163, 184, 0.06));
    padding-left: 24px;
    padding-right: 24px;
}

/* ============================================================
   Command Palette
   ============================================================ */

/* Overlay */
.lr-cmd-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}
.lr-cmd-overlay.lr-cmd-visible {
    opacity: 1;
    visibility: visible;
}

/* Box */
.lr-cmd-box {
    width: 520px;
    max-width: 92vw;
    background: var(--steve-surface, #0f1724);
    border: 1px solid var(--steve-border, rgba(148, 163, 184, 0.08));
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(148, 163, 184, 0.04);
    overflow: hidden;
    transform: scale(0.96) translateY(-8px);
    transition: transform 0.18s ease;
}
.lr-cmd-visible .lr-cmd-box {
    transform: scale(1) translateY(0);
}

/* Input row */
.lr-cmd-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}
.lr-cmd-search-icon {
    font-size: 1.2rem;
    color: var(--steve-dim, #94a3b8);
    flex-shrink: 0;
}
.lr-cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--steve-text, #e2e8f0);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.lr-cmd-input::placeholder {
    color: var(--steve-muted, #475569);
}

/* Divider */
.lr-cmd-divider {
    height: 1px;
    background: var(--steve-border, rgba(148, 163, 184, 0.08));
}

/* List */
.lr-cmd-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
}

/* Item */
.lr-cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--steve-dim, #94a3b8);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
    cursor: pointer;
}
.lr-cmd-item:hover,
.lr-cmd-item.lr-cmd-active {
    background: rgba(148, 163, 184, 0.06);
    color: var(--steve-text, #e2e8f0);
    text-decoration: none;
}
.lr-cmd-item-icon {
    font-size: 1.15rem;
    color: var(--steve-dim, #94a3b8);
    flex-shrink: 0;
}
.lr-cmd-item.lr-cmd-active .lr-cmd-item-icon {
    color: var(--steve-emerald, #10b981);
}
.lr-cmd-item-label {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
}
.lr-cmd-item-arrow {
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.12s ease;
    color: var(--steve-dim, #94a3b8);
}
.lr-cmd-item.lr-cmd-active .lr-cmd-item-arrow {
    opacity: 1;
    color: var(--steve-emerald, #10b981);
}

/* Scrollbar for command list */
.lr-cmd-list::-webkit-scrollbar {
    width: 4px;
}
.lr-cmd-list::-webkit-scrollbar-track {
    background: transparent;
}
.lr-cmd-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 4px;
}

/* ============================================================
   Subtab Bar — Glassmorphism Page-Level Navigation
   ============================================================ */

.lr-subtab-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0 -24px;
    padding: 0 24px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Light mode override */
.mode-light .lr-subtab-bar {
    background: rgba(255, 255, 255, 0.72);
    border-bottom-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.lr-subtab-inner {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lr-subtab-inner::-webkit-scrollbar {
    display: none;
}

.lr-subtab {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--steve-dim, #94a3b8);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    position: relative;
    letter-spacing: 0.01em;
}

.lr-subtab:hover {
    color: var(--steve-text, #e2e8f0);
    background: rgba(148, 163, 184, 0.06);
    text-decoration: none;
}

.lr-subtab.active {
    color: var(--steve-emerald, #10b981);
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
}

.lr-subtab.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--steve-emerald, #10b981);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

/* Light mode subtab overrides */
.mode-light .lr-subtab {
    color: #64748b;
}
.mode-light .lr-subtab:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}
.mode-light .lr-subtab.active {
    color: #059669;
    background: rgba(16, 185, 129, 0.08);
}

/* --- Mobile: scroll hint gradient --- */
@media (max-width: 768px) {
    .lr-subtab-bar {
        margin: 0 -12px;
        padding: 0 12px;
    }
    .lr-subtab {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
    .lr-subtab-bar::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(15, 23, 42, 0.65));
        pointer-events: none;
        border-radius: 0;
    }
    .mode-light .lr-subtab-bar::after {
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.72));
    }
}
