/* ============================================================
   NAVIGATION — Modern Dashboard Style
   SEO Suite by Beyond Media
   ============================================================ */

:root {
    --topbar-height: 52px;
    --sidebar-width: 56px;
    --sidebar-expanded: 230px;
    --sidebar-bg: #18181b;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-fg: #e4e4e7;
    --sidebar-muted: #a1a1aa;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-accent: #f97316;
    --sidebar-accent-subtle: rgba(249, 115, 22, 0.12);
    --topbar-bg: #18181b;
    --topbar-fg: #fafafa;
    --nav-ease: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */

#top-bar {
    position: fixed;
    height: var(--topbar-height);
    width: 100%;
    top: 0;
    left: 0;
    background: var(--topbar-bg);
    z-index: 1001;
    border-bottom: 1px solid var(--sidebar-border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px 0 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    height: 100%;
}

#site-logo {
    height: 20px;
    width: auto;
    margin: 0 16px;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.topbar-divider {
    width: 1px;
    height: 22px;
    background: var(--sidebar-border);
}

.topbar-project {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem 0.375rem 1rem;
    cursor: pointer;
    border-radius: calc(var(--radius) - 2px);
    transition: background 150ms ease;
    position: relative;
}
.topbar-project:hover {
    background: hsl(0 0% 100% / 0.06);
}
.topbar-project.project-switcher-active {
    background: hsl(0 0% 100% / 0.08);
}
.topbar-project-info {
    display: flex;
    flex-direction: column;
}
.topbar-project-chevron {
    font-size: 0.5rem;
    color: hsl(var(--sidebar-muted));
    transition: transform 200ms ease;
}
.topbar-project.project-switcher-active .topbar-project-chevron {
    transform: rotate(180deg);
}

.topbar-label {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--sidebar-muted);
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.topbar-value {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--topbar-fg);
    line-height: 1.5;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

.topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--sidebar-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--nav-ease);
}
.topbar-icon-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--topbar-fg);
}

.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.6875rem;
    font-weight: 600;
    margin-left: 8px;
    cursor: pointer;
    transition: all var(--nav-ease);
    user-select: none;
}
.topbar-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

#nav {
    position: fixed;
    height: calc(100vh - var(--topbar-height));
    top: var(--topbar-height);
    left: 0;
    display: flex;
    flex-direction: row;
    z-index: 1000;
}

#nav-main-menue {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    height: 100%;
    width: var(--sidebar-width);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
#nav-main-menue::-webkit-scrollbar { display: none; }

.nav-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 2px;
}

/* ── Group separator ── */
.nav-separator {
    width: 24px;
    height: 1px;
    background: var(--sidebar-border);
    margin: 6px 0;
    flex-shrink: 0;
}

/* ── Icon buttons ── */
.nav-icon {
    font-size: 1rem;
    color: var(--sidebar-muted);
    cursor: pointer;
    transition: all var(--nav-ease);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
.nav-icon:hover {
    color: var(--sidebar-fg);
    background: var(--sidebar-hover-bg);
}

/* Active state — left accent bar */
.nav-icon::after {
    content: '';
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 18px;
    border-radius: 0 2px 2px 0;
    background: var(--sidebar-accent);
    transition: transform var(--nav-ease);
}
.nav-icon.active {
    color: var(--sidebar-accent);
    background: var(--sidebar-accent-subtle);
}
.nav-icon.active::after {
    transform: translateY(-50%) scaleY(1);
}

/* ── CSS Tooltip ── */
.nav-icon[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #27272a;
    color: #fafafa;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.01em;
}
/* Hide tooltip when submenu is open */
#nav-second-menue:not(.display-none) ~ .nav-icons .nav-icon[data-tooltip]:hover::before,
.nav-icon.active[data-tooltip]:hover::before {
    display: none;
}


/* ═══════════════════════════════════════════════════════════════
   SECOND LEVEL MENU
   ═══════════════════════════════════════════════════════════════ */

#nav-second-menue {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    height: 100%;
    width: var(--sidebar-expanded);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    animation: slideIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
#nav-second-menue::-webkit-scrollbar { display: none; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

.nav-second-menue-section {
    display: flex;
    flex-direction: column;
    padding: 4px 10px;
}

.nav-second-menue-section + .nav-second-menue-section {
    border-top: 1px solid var(--sidebar-border);
    margin-top: 4px;
    padding-top: 8px;
}

.nav-second-menue-section-topic {
    font-family: var(--font-sans, 'Inter', sans-serif);
    color: var(--sidebar-muted);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 8px 6px;
    margin: 0;
}

.nav-second-menue-section-entry {
    font-family: var(--font-sans, 'Inter', sans-serif);
    color: rgba(228, 228, 231, 0.85);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    padding: 7px 8px;
    border-radius: 6px;
    transition: all var(--nav-ease);
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-second-menue-section-entry i {
    font-size: 0.75rem;
    color: var(--sidebar-muted);
    width: 16px;
    text-align: center;
    transition: color var(--nav-ease);
    flex-shrink: 0;
    opacity: 0.7;
}
.nav-second-menue-section-entry:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}
.nav-second-menue-section-entry:hover i {
    color: var(--sidebar-accent);
    opacity: 1;
}
.nav-second-menue-section-entry.active {
    background: var(--sidebar-accent-subtle);
    color: var(--sidebar-accent);
}
.nav-second-menue-section-entry.active i {
    color: var(--sidebar-accent);
    opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-overlay.display-none { display: none; }

.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--sidebar-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}


/* ═══════════════════════════════════════════════════════════════
   MESSAGE POPUP
   ═══════════════════════════════════════════════════════════════ */

.popup {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popup.display-none { display: none; }

.popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.popup-content {
    position: relative;
    background: hsl(var(--card, 0 0% 100%));
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 520px;
    margin: 16px;
    animation: popupIn 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popupIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.popup-headline h2 {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 1.0625rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.popup-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all var(--nav-ease);
    font-size: 0.8125rem;
}
.popup-close-btn:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.popup-body {
    padding: 16px 24px 24px;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

#notification-box,
#quick-notification-box {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}


/* ═══════════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════════ */

body {
    margin: 0;
    padding: 0;
    background: hsl(var(--background, 0 0% 100%));
    font-family: var(--font-sans, 'Inter', sans-serif);
}

.display-none { display: none !important; }


/* ═══════════════════════════════════════════════════════════════
   PROJECT SWITCHER DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
.project-switcher {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1100;
    width: 320px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 2px);
    box-shadow: 0 12px 36px -8px hsl(0 0% 0% / 0.4), 0 4px 12px -4px hsl(0 0% 0% / 0.2);
    overflow: hidden;
    animation: projectSwitcherIn 150ms ease;
}

@keyframes projectSwitcherIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-switcher-search {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
}

.project-switcher-search i {
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.project-switcher-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: hsl(var(--foreground));
}

.project-switcher-search input::placeholder {
    color: hsl(var(--muted-foreground) / 0.6);
}

.project-switcher-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.25rem;
}

.project-switcher-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.project-switcher-empty {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.project-switcher-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 100ms ease;
    text-align: left;
    font-family: var(--font-sans);
}

.project-switcher-item:hover {
    background: hsl(var(--muted));
}

.project-switcher-item--active {
    background: hsl(var(--primary) / 0.08);
}

.project-switcher-item--active:hover {
    background: hsl(var(--primary) / 0.12);
}

.project-switcher-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.project-switcher-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-switcher-item-meta {
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-switcher-item-check {
    font-size: 0.6875rem;
    color: hsl(var(--primary));
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Topbar Notification Badge */
.topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    background: hsl(var(--destructive));
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}
