/* ============================================
   ETI SPA — Unified Header & Navigation
   shared-header.css  —  Dark Mode Nav
   ============================================ */

/* Header Container */
.unified-header {
    background: #0f172a;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.unified-header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 28px;
}

/* Top Bar: Logo + User */
.unified-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.unified-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.unified-header-brand:hover {
    text-decoration: none;
    color: inherit;
}

.unified-brand-logo {
    width: 34px;
    height: 34px;
    background: #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.unified-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.unified-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.unified-brand-subtitle {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* User Actions (right side) */
.unified-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.unified-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #cbd5e1;
}

.unified-user-badge .user-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
}

.unified-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-family: inherit;
}

.unified-header-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.15);
}

.unified-header-btn.btn-logout {
    color: #f87171;
    border-color: transparent;
}

.unified-header-btn.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Separator line between top bar and nav */
.unified-header-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0;
}

/* ============================================
   Navigation Bar — BIGGER on desktop
   ============================================ */
.unified-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 52px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.unified-nav::-webkit-scrollbar {
    display: none;
}

.unified-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.unified-nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.unified-nav-link.active {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.2);
    font-weight: 600;
}

.unified-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #3b82f6;
    border-radius: 2px 2px 0 0;
}

.unified-nav-link .nav-icon {
    font-size: 16px;
    line-height: 1;
}

.unified-nav-link .nav-label {
    font-size: 14px;
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 1024px) {
    .unified-header-inner {
        padding: 0 16px;
    }

    .unified-nav {
        height: 48px;
        gap: 2px;
    }

    .unified-nav-link {
        padding: 8px 14px;
        font-size: 13px;
        gap: 6px;
    }

    .unified-nav-link .nav-icon {
        font-size: 15px;
    }

    .unified-nav-link .nav-label {
        font-size: 13px;
    }
}

/* ============================================
   Responsive — Mobile: scrollable, labels visible
   ============================================ */
@media (max-width: 768px) {
    .unified-header-top {
        height: 48px;
    }

    .unified-header-inner {
        padding: 0 12px;
    }

    .unified-brand-text {
        display: none;
    }

    .unified-brand-logo {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .unified-user-badge .user-email-text {
        display: none;
    }

    .unified-user-badge .user-role {
        display: none;
    }

    /* Nav: keep labels visible, scroll horizontally */
    .unified-nav {
        height: 44px;
        gap: 2px;
        padding: 0 4px;
        /* ensure it scrolls on small screens */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .unified-nav-link {
        padding: 7px 12px;
        font-size: 13px;
        gap: 5px;
        flex-shrink: 0;   /* prevent labels from collapsing */
    }

    .unified-nav-link .nav-label {
        display: inline;  /* KEEP labels visible on mobile */
        font-size: 12px;
    }

    .unified-nav-link .nav-icon {
        font-size: 14px;
    }

    .unified-header-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* ============================================
   Notification Badge (RDA pending count)
   ============================================ */
.unified-nav-link {
    position: relative;
}

.nav-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ============================================
   Hide unified header on print
   ============================================ */
@media print {
    .unified-header {
        display: none !important;
    }
}
