/* =====================================================
   MODULE: NAVIGATION
   Glow nav buttons from Print OS v4 + standard navbars,
   tabs, breadcrumbs, sidebar, pagination.
   Per-theme overrides for all 5 themes.
   Toggle: modules.navigation in theme-config.json
   ===================================================== */

/* ============= GLOW NAV BUTTONS (Print OS v4) ============= */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    border: var(--ol-btn, 1.5px) solid var(--glow-purple, #8a53f9);
    border-radius: var(--radius-lg, 0.75rem);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 0 10px var(--glow-purple, rgba(138, 83, 249, 0.3));
    text-decoration: none;
}
.nav-btn:hover { box-shadow: 0 0 16px var(--glow-purple, rgba(138, 83, 249, 0.5)); }
.nav-btn.active { box-shadow: 0 0 16px var(--glow-purple, rgba(138, 83, 249, 0.5)); font-weight: 700; }

/* Section-specific glow colors */
.nav-btn-dashboard { border-color: var(--glow-purple); box-shadow: 0 0 10px var(--glow-purple); }
.nav-btn-dashboard:hover, .nav-btn-dashboard.active { box-shadow: 0 0 16px var(--glow-purple); }

.nav-btn-printing { border-color: var(--glow-blue, #3b82f6); box-shadow: 0 0 10px var(--glow-blue, rgba(59, 130, 246, 0.3)); }
.nav-btn-printing:hover, .nav-btn-printing.active { box-shadow: 0 0 16px var(--glow-blue, rgba(59, 130, 246, 0.5)); }

.nav-btn-packing { border-color: var(--glow-pink, #ec4899); box-shadow: 0 0 10px var(--glow-pink, rgba(236, 72, 153, 0.3)); }
.nav-btn-packing:hover, .nav-btn-packing.active { box-shadow: 0 0 16px var(--glow-pink, rgba(236, 72, 153, 0.5)); }

.nav-btn-done { border-color: var(--glow-yellow, #facc15); box-shadow: 0 0 10px var(--glow-yellow, rgba(250, 204, 21, 0.3)); }
.nav-btn-done:hover, .nav-btn-done.active { box-shadow: 0 0 16px var(--glow-yellow, rgba(250, 204, 21, 0.5)); }

.nav-btn-wip { border-color: var(--glow-white, rgba(255, 255, 255, 0.4)); box-shadow: 0 0 10px var(--glow-white); }
.nav-btn-wip:hover, .nav-btn-wip.active { box-shadow: 0 0 16px var(--glow-white); }

/* ============= TOP BAR ============= */
.topbar {
    background: var(--bg-secondary);
    padding: 0.625rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.625rem;
    border-bottom: 1px solid var(--border-primary);
}
.topbar-left, .topbar-right { display: flex; gap: 0.625rem; align-items: center; }
.topbar-brand { font-size: var(--font-size-lg, 1.125rem); font-weight: 800; color: var(--text-primary); }

/* ============= APP HEADER ============= */
.app-header {
    background: var(--bg-secondary);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--accent);
}
.app-header h1 { font-size: var(--font-size-3xl, 1.875rem); font-weight: 800; line-height: 1.1; }
.app-header img { height: 3.75rem; width: auto; }

/* ============= NAVBAR ============= */
.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 3.5rem;
    gap: 1rem;
}
.navbar-brand {
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-right: 2rem;
}
.navbar-links { display: flex; gap: 0.25rem; height: 100%; }
.navbar-link {
    display: flex;
    align-items: center;
    padding: 0 0.875rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    height: 100%;
}
.navbar-link:hover { color: var(--text-primary); border-bottom-color: var(--border-secondary); }
.navbar-link.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.navbar-actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }

/* ============= TABS ============= */
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tab {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}
.tab:hover { background: var(--border-primary); }
.tab.active { background: var(--accent); color: #ffffff; }

/* Underline Tabs */
.tabs-underline { display: flex; gap: 0; border-bottom: 2px solid var(--border-primary); }
.tab-underline {
    padding: 0.75rem 1.25rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    background: none;
    border-top: none; border-left: none; border-right: none;
}
.tab-underline:hover { color: var(--text-primary); }
.tab-underline.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ============= BREADCRUMBS ============= */
.breadcrumbs { display: flex; align-items: center; gap: 0.375rem; font-size: var(--font-size-sm, 0.875rem); color: var(--text-tertiary); }
.breadcrumb-item { color: var(--text-tertiary); text-decoration: none; }
.breadcrumb-item:hover { color: var(--text-primary); }
.breadcrumb-item.current { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-tertiary); opacity: 0.5; }

/* ============= SIDEBAR ============= */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    overflow-y: auto;
    padding: 1rem 0;
    z-index: 100;
}
.sidebar-header { padding: 0 1rem 1rem; border-bottom: 1px solid var(--border-primary); margin-bottom: 0.5rem; }
.sidebar-section { padding: 0.5rem 0; }
.sidebar-section-title {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.375rem 1rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-link.active { background: var(--bg-accent-subtle); color: var(--accent); font-weight: 600; }
.sidebar-link-icon { width: 1.25rem; text-align: center; }

/* ============= PAGINATION ============= */
.pagination { display: flex; align-items: center; gap: 0.25rem; }
.page-btn {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md, 0.5rem);
    cursor: pointer;
    transition: all 0.2s ease;
}
.page-btn:hover { background: var(--bg-hover); }
.page-btn.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============= LIGHT THEME ============= */
[data-theme="white-glass"] .nav-btn {
    border: 2px solid var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
[data-theme="white-glass"] .nav-btn:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); filter: brightness(1.1); }
[data-theme="white-glass"] .navbar { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); }
[data-theme="white-glass"] .sidebar { background: rgba(255, 255, 255, 0.9); }
[data-theme="white-glass"] .tab.active { background: var(--accent); color: white; }

/* ============= RETRO THEME — 3D nav ============= */
[data-theme="retro"] .nav-btn {
    background: #c0c0c0;
    border: none;
    border-radius: 0 !important;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #ffffff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
    color: #000;
}
[data-theme="retro"] .nav-btn:hover { background: #d4d0c8; filter: none; }
[data-theme="retro"] .nav-btn:active {
    box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
[data-theme="retro"] .navbar {
    background: #c0c0c0;
    border-bottom: none;
    box-shadow: inset 0 -1px 0 #808080;
}
[data-theme="retro"] .sidebar {
    background: #c0c0c0;
    border-right: 1px solid #808080;
}
[data-theme="retro"] .tab {
    border-radius: 0 !important;
    background: #c0c0c0;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #ffffff;
}
[data-theme="retro"] .tab.active { background: #000080; color: #fff; }
[data-theme="retro"] .page-btn { border-radius: 0 !important; background: #c0c0c0; border: 1px solid #808080; }
[data-theme="retro"] .page-btn.active { background: #000080; color: #fff; }

/* ============= HOMEBREW THEME — green terminal ============= */
[data-theme="homebrew"] .nav-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 0 !important;
    color: #00ff00;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.1);
}
[data-theme="homebrew"] .nav-btn:hover {
    background: rgba(0, 255, 0, 0.06);
    border-color: #00ff00;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}
[data-theme="homebrew"] .navbar {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}
[data-theme="homebrew"] .navbar-link { color: rgba(0, 255, 0, 0.6); }
[data-theme="homebrew"] .navbar-link:hover { color: #00ff00; }
[data-theme="homebrew"] .navbar-link.active { color: #00ff00; border-bottom-color: #00ff00; }
[data-theme="homebrew"] .sidebar {
    background: rgba(0, 0, 0, 0.4);
    border-right: 1px solid rgba(0, 255, 0, 0.1);
}
[data-theme="homebrew"] .sidebar-link { color: rgba(0, 255, 0, 0.6); }
[data-theme="homebrew"] .sidebar-link:hover { color: #00ff00; background: rgba(0, 255, 0, 0.04); }
[data-theme="homebrew"] .sidebar-link.active { color: #00ff00; background: rgba(0, 255, 0, 0.08); }
[data-theme="homebrew"] .tab {
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(0, 255, 0, 0.6);
}
[data-theme="homebrew"] .tab:hover { color: #00ff00; }
[data-theme="homebrew"] .tab.active { background: rgba(0, 255, 0, 0.12); color: #00ff00; border: 1px solid rgba(0, 255, 0, 0.4); }
[data-theme="homebrew"] .page-btn {
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.2);
    color: rgba(0, 255, 0, 0.6);
}
[data-theme="homebrew"] .page-btn.active { background: rgba(0, 255, 0, 0.12); color: #00ff00; border-color: rgba(0, 255, 0, 0.4); }

/* ============= SKEUOMORPHIC THEME — gradient navbar ============= */
[data-theme="skeuomorphic"] .navbar {
    background: linear-gradient(to bottom, #f5f0e8, #ece7df);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
[data-theme="skeuomorphic"] .nav-link:hover {
    background: rgba(255,255,255,0.5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}
[data-theme="skeuomorphic"] .nav-link.active {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}
[data-theme="skeuomorphic"] .nav-tabs .nav-link.active {
    border-bottom-color: transparent;
    background: #ffffff;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
}
