/* ==========================================================================
   BrightDocs Unified Navigation
   ========================================================================== */

/* ----------------------------------------
   Top Header Bar
   ---------------------------------------- */
.bd-top-header {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Left section - primary nav */
.bd-header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Center section - logo */
.bd-brand {
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.bd-brand:hover {
    opacity: 0.9;
}

/* ----------------------------------------
   Primary Navigation (Documents | Email)
   ---------------------------------------- */
.bd-primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px;
    border-radius: 8px;
    flex-shrink: 0;
}

.bd-primary-nav-item {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    border: none;
    background: transparent;
    text-decoration: none;
}

.bd-primary-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.bd-primary-nav-item.active {
    background: white;
    color: #667eea;
}

.bd-nav-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* ----------------------------------------
   Header Right Section (utilities)
   ---------------------------------------- */
.bd-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

.bd-header-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 16px;
}

.bd-header-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bd-icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* Queue Status Indicator */
.bd-queue-indicator {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.bd-queue-indicator.active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
}

.bd-queue-indicator .spin {
    animation: bd-spin 1s linear infinite;
}

@keyframes bd-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* User Menu */
.bd-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    color: white;
}

.bd-user-menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bd-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.bd-user-name {
    font-size: 13px;
    font-weight: 500;
}

.bd-logout-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.bd-logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ----------------------------------------
   Contextual Sub-Navigation Bar
   ---------------------------------------- */
.bd-sub-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 48px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.bd-sub-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bd-sub-nav-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
}

.bd-sub-nav-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.bd-sub-nav-tab.active {
    background: #ede9fe;
    color: #667eea;
}

.bd-sub-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bd-sub-nav-btn {
    padding: 6px 12px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e5e7eb;
    background: white;
}

.bd-sub-nav-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.bd-sub-nav-btn.danger {
    color: #dc2626;
}

.bd-sub-nav-btn.danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* ----------------------------------------
   Main Content Layout
   ---------------------------------------- */
.bd-app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.bd-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bd-documents-inner {
    flex: 1;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Wider search container */
.bd-documents-inner .simple-search-container {
    max-width: 900px;
}

.bd-documents-inner .search-panel {
    max-width: none;
}

/* ----------------------------------------
   Responsive Adjustments
   ---------------------------------------- */
@media (max-width: 768px) {
    .bd-top-header {
        padding: 0 12px;
        height: 52px;
    }

    .bd-brand {
        font-size: 16px;
        position: static;
        transform: none;
    }

    .bd-header-left {
        flex: 0;
    }

    .bd-primary-nav-item {
        padding: 6px 12px;
        font-size: 13px;
    }

    .bd-header-right {
        gap: 8px;
        flex: 0;
    }

    .bd-user-name {
        display: none;
    }

    .bd-sub-nav {
        padding: 0 12px;
        height: 44px;
    }

    .bd-sub-nav-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
}