/**
 * Sidebar - Side Menu Component
 *
 * Navigation sidebar med collapse-funktionalitet
 */

/* ===========================================
   SIDE MENU CONTAINER
   =========================================== */
swp-side-menu {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overflow-x: hidden;
}

/* ===========================================
   HEADER
   =========================================== */
swp-side-menu-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-5);
  height: var(--topbar-height);
  padding: 0 var(--spacing-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

swp-side-menu-header > i {
  font-size: 26px;
  color: var(--color-teal);
}

swp-side-menu-logo {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
}

/* Toggle Button */
swp-menu-toggle {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

swp-menu-toggle:hover {
  background: var(--color-background-hover);
  color: var(--color-text);
}

swp-menu-toggle i {
  font-size: 18px;
  color: inherit;
  transition: transform var(--transition-normal);
}

/* ===========================================
   NAVIGATION
   =========================================== */
swp-side-menu-nav {
  flex: 1;
  padding: var(--spacing-3) 0;
  overflow-y: auto;
}

swp-side-menu-group {
  display: block;
  margin-bottom: var(--spacing-2);
}

swp-side-menu-label {
  display: block;
  padding: var(--spacing-2) var(--spacing-4) 6px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

/* ===========================================
   MENU ITEMS
   =========================================== */
swp-side-menu-item,
a[is="swp-side-menu-item"] {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-5) var(--spacing-4);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
}

swp-side-menu-item:hover,
a[is="swp-side-menu-item"]:hover {
  background: var(--color-background-hover);
  text-decoration: none;
}

swp-side-menu-item[data-active="true"],
a[is="swp-side-menu-item"][data-active="true"] {
  background: var(--color-teal-light);
  border-left-color: var(--color-teal);
  color: var(--color-teal);
  font-weight: 500;
}

swp-side-menu-item i,
a[is="swp-side-menu-item"] i {
  font-size: 20px;
  flex-shrink: 0;
}

/* ===========================================
   FOOTER
   =========================================== */
swp-side-menu-footer {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-4);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  flex-shrink: 0;
}

swp-side-menu-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-5);
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
}

swp-side-menu-action:hover {
  background: var(--color-background-hover);
}

swp-side-menu-action.lock:hover {
  color: var(--color-amber);
  border-color: var(--color-amber);
}

swp-side-menu-action.logout:hover {
  color: var(--color-red);
  border-color: var(--color-red);
}

swp-side-menu-action i {
  font-size: 18px;
}

/* ===========================================
   COLLAPSED STATE
   =========================================== */
swp-app-layout.menu-collapsed swp-side-menu {
  overflow: visible;
}

swp-app-layout.menu-collapsed swp-side-menu-logo,
swp-app-layout.menu-collapsed swp-side-menu-label,
swp-app-layout.menu-collapsed swp-side-menu-item span,
swp-app-layout.menu-collapsed swp-side-menu-action span,
swp-app-layout.menu-collapsed a[is="swp-side-menu-item"] span {
  display: none;
}

swp-app-layout.menu-collapsed swp-side-menu-header {
  justify-content: center;
  padding: 0;
}

swp-app-layout.menu-collapsed swp-menu-toggle {
  margin-left: 0;
}

swp-app-layout.menu-collapsed swp-menu-toggle i {
  transform: rotate(180deg);
}

swp-app-layout.menu-collapsed swp-side-menu-item,
swp-app-layout.menu-collapsed a[is="swp-side-menu-item"] {
  justify-content: center;
  padding: var(--spacing-3);
  border-left: none;
}

swp-app-layout.menu-collapsed swp-side-menu-item[data-active="true"],
swp-app-layout.menu-collapsed a[is="swp-side-menu-item"][data-active="true"] {
  border-left: none;
  border-radius: var(--border-radius-lg);
  margin: 0 var(--spacing-2);
}

swp-app-layout.menu-collapsed swp-side-menu-action {
  justify-content: center;
  padding: var(--spacing-3);
}

swp-app-layout.menu-collapsed swp-side-menu-footer {
  padding: var(--spacing-3) var(--spacing-2);
}

/* ===========================================
   TOOLTIP (Collapsed State)
   =========================================== */
.swp-menu-tooltip {
  position: fixed;
  margin: 0;
  padding: 6px var(--spacing-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-md);
  font-family: var(--font-family);
  color: var(--color-text);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: var(--z-tooltip);
}
