/* wwwroot/css/GBL/navbar.css */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
    background: #0e0e0f;
    border-bottom: 1px solid #1e1e20;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 2rem;
    backdrop-filter: blur(8px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-brand-icon {
    font-size: 20px;
    line-height: 1;
}

.navbar-brand-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 3px;
    color: #fff;
    line-height: 1;
}

    .navbar-brand-text span {
        color: #c9a84c;
    }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-link {
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
    transition: color 0.15s;
}

    .navbar-link:hover,
    .navbar-link.active {
        color: #c9a84c;
    }

.navbar-user {
    position: relative;
}

    .navbar-user::after {
        content: '';
        position: absolute;
        top: 100%;
        left: -20px;
        right: -20px;
        height: 12px;
    }

.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c, #a07830);
    color: #0e0e0f;
    font-size: 13px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    letter-spacing: 0.5px;
    user-select: none;
}

    .navbar-avatar:hover,
    .navbar-user:hover .navbar-avatar {
        border-color: #c9a84c;
    }

.navbar-dropdown {
    position: absolute;
    top: 100%;
    padding-top: 12px;
    right: 0;
    width: 220px;
    background: #161618;
    border: 1px solid #2a2a2c;
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

.navbar-user:hover .navbar-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid #222;
}

.dropdown-header-name {
    font-size: 13px;
    font-weight: 500;
    color: #e8e4dc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-header-nivel {
    font-size: 11px;
    color: #c9a84c;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.dropdown-menu {
    padding: 6px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: #999;
    transition: background 0.12s, color 0.12s;
}

    .dropdown-item:hover {
        background: #1e1e20;
        color: #e8e4dc;
    }

.dropdown-item-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: #222;
    margin: 6px 6px;
}

.dropdown-item-danger {
    color: #7a4040;
}

    .dropdown-item-danger:hover {
        background: #e24b4a11;
        color: #e24b4a;
    }

.navbar-categories-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .navbar-categories-dropdown::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 12px;
    }

.navbar-categories-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
    font-family: 'DM Sans', sans-serif;
    user-select: none;
    white-space: nowrap;
}

.navbar-categories-btn {
    background: transparent;
    border: 1px solid #2a2a2c;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c9a84c;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    transition: background 0.15s, border-color 0.15s;
    min-width: 120px;
    max-width: 160px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .navbar-categories-btn:hover {
        background: rgba(201, 168, 76, 0.08);
        border-color: rgba(201, 168, 76, 0.3);
    }

.navbar-categories-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #161618;
    border: 1px solid #2a2a2c;
    border-radius: 10px;
    min-width: 200px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 100;
    padding: 6px;
}

.navbar-categories-dropdown.open .navbar-categories-menu {
    display: flex;
    flex-direction: column;
}

#categories-menu {
    min-width: 300px;
}

.navbar-categories-item {
    padding: 5px 14px;
    color: #999;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

    .navbar-categories-item:hover {
        background: #1e1e20;
        color: #e8e4dc;
    }

    .navbar-categories-item.active {
        font-weight: 600;
        color: #c9a84c;
        background: rgba(201, 168, 76, 0.08);
        border-left: 2px solid #c9a84c;
        padding-left: 12px;
    }

.navbar-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.navbar-lang-btn {
    font-size: 1.3rem;
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.2s;
}

    .navbar-lang-btn:hover,
    .navbar-lang-btn.active {
        opacity: 1;
    }

/* ── Quick action buttons ─────────────────────── */

.navbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 100;
}

.navbar-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-md);
    border: 0.5px solid transparent;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 18px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .navbar-action-btn:hover {
        background: rgba(201, 168, 76, 0.08);
        border-color: rgba(201, 168, 76, 0.3);
        color: #c9a84c;
    }

    .navbar-action-btn:active {
        transform: scale(0.96);
    }

    /* Tooltip */
    .navbar-action-btn::after {
        content: attr(data-tooltip);
        position: absolute;
        top: calc(100% + 8px);
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        background: #161618;
        color: #e8e4dc;
        border: 1px solid #2a2a2c;
        border-radius: 6px;
        font-size: 12px;
        white-space: nowrap;
        padding: 4px 8px;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.15s;
        z-index: 1001;
    }

    .navbar-action-btn:hover::after {
        opacity: 1;
    }

    .navbar-action-btn.disabled {
        opacity: 0.3;
        cursor: not-allowed;
        pointer-events: none;
    }

/* ── Cadastros submenu ─────────────────────────── */

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: #ccc;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s, background 0.15s;
}

    .dropdown-submenu-toggle:hover {
        color: #fff;
        background: #1e1e20;
    }

.dropdown-submenu-arrow {
    margin-left: auto;
    font-size: 16px;
    color: #555;
    transition: transform 0.2s;
    line-height: 1;
}

.dropdown-submenu.open .dropdown-submenu-arrow {
    transform: rotate(90deg);
}

.dropdown-submenu-menu {
    display: none;
    flex-direction: column;
    background: #111113;
    border-top: 1px solid #1e1e20;
    border-bottom: 1px solid #1e1e20;
}

.dropdown-submenu.open .dropdown-submenu-menu {
    display: flex;
}

.dropdown-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 28px;
    font-size: 12px;
    color: #999;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.3px;
}

    .dropdown-subitem:hover {
        color: #c9a84c;
        background: #c9a84c0d;
    }

.dropdown-subitem-icon {
    font-size: 13px;
    opacity: 0.7;
}

/* ── navbar-top: wrapper visível só no mobile ─── */
.navbar-top {
    display: contents; /* desktop: filhos participam no flex do .navbar normalmente */
}

/* ════════════════════════════════════════════════
   MOBILE — portrait (≤ 768px)
   Navbar vira duas linhas:
     Linha 1 (52px): logo  +  avatar
     Linha 2 (44px): dropdowns  +  quick actions
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {

    .navbar {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        justify-content: flex-start;
    }

    /* Linha 1: logo + ícones + avatar */
    .navbar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.75rem;
        height: 52px;
        flex-shrink: 0;
        gap: 8px;
    }

    /* logo um pouco menor pra sobrar espaço pros ícones */
    .navbar-brand img {
        height: 40px;
    }

    .navbar-brand-text {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    /* ícones de ação mais compactos */
    .navbar-quick-actions {
        gap: 2px;
    }

    .navbar-action-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

        .navbar-action-btn svg {
            width: 15px;
            height: 15px;
        }

        .navbar-action-btn::after {
            display: none;
        }

    /* Linha 2: dropdowns dividindo o espaço disponível */
    .navbar-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0 0.75rem;
        height: 44px;
        border-top: 1px solid #1e1e20;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        scrollbar-width: none;
        width: 100%;
        margin-left: 0;
    }

        .navbar-nav::-webkit-scrollbar {
            display: none;
        }

    .navbar-categories-label {
        display: none;
    }

    /* cada dropdown cresce igualmente pra ocupar o espaço disponível */
    .navbar-categories-dropdown {
        flex: 1 1 0;
        min-width: 0; /* permite encolher/crescer sem quebrar o layout flex */
    }

    .navbar-categories-btn {
        width: 100%;
        min-width: 0;
        max-width: none;
        font-size: 11px;
        padding: 4px 6px;
        letter-spacing: 0.3px;
        text-align: center;
    }

    .navbar-categories-dropdown,
    .navbar-quick-actions {
        flex-shrink: 0;
    }

    .navbar-dropdown {
        right: 0;
        left: auto;
        width: 200px;
    }
}

.error-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--navbar-bg, #1a1a2e);
    line-height: 1;
    pointer-events: none;
}

.validation-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #c9a84c;
    color: #0e0e0f;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #0e0e0f;
}

/* PHOTO AVATAR */

.navbar-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.navbar-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.navbar-avatar-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.navbar-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.navbar-avatar-wrapper:hover .navbar-avatar-overlay {
    opacity: 1;
}

.navbar-avatar-wrapper {
    position: relative;
}

.navbar-avatar-camera-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4a017;
    border: 2px solid #1a1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    padding: 0;
    transition: transform 0.15s ease;
}

    .navbar-avatar-camera-btn:hover {
        transform: scale(1.1);
    }

.navbar-brand {
    order: 1;
}

.navbar-nav {
    order: 2;
    margin-left: auto;
}

.navbar-quick-actions {
    order: 3;
}

.navbar-user {
    order: 4;
}
.disabled-feature {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: auto;
}