/**
 * Sidebar Component Styles
 * Responsive sidebar with collapsible behavior
 * - Wide screens (≥1600px): Always unfolded
 * - Regular screens (769px-1599px): Collapsible
 * - Mobile (≤768px): Overlay
 */

:host {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10000;

  --sidebar-width: 280px;
  --sidebar-width-collapsed: 60px;
  --sidebar-bg: rgba(10, 10, 10, 0.95);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f7;
  --text-secondary: #d1d1d6;
  --text-placeholder: #8e8e93;
  --accent-yellow: #c9a961;
  --accent-yellow-hover: #d4af37;
  --accent-green: #00f3ff;
  --error-color: #ff6b6b;
  --transition-speed: 0.3s;
}

:host * {
  pointer-events: auto;
}

/* Prevent flash on mobile - hide sidebar until styles are loaded */
:host:not([data-styles-loaded]) {
  visibility: hidden;
}

/* On mobile, ensure sidebar starts hidden even before stylesheet loads */
@media (max-width: 768px) {
  :host:not([data-styles-loaded]) .vision-sidebar {
    transform: translateX(-100%) !important;
    visibility: hidden;
  }
}

/* ============================================================================
   SIDEBAR CONTAINER
   ============================================================================ */

.vision-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh; /* Use dynamic viewport height for mobile browsers */
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--sidebar-border);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed) ease, width var(--transition-speed) ease;
  overflow: hidden;
  font-family: 'Figtree', sans-serif;
  color: var(--text-primary);
}

/* Collapsed state */
.vision-sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
}

/* Desktop hover expansion (769px - 1599px) */
@media (min-width: 769px) and (max-width: 1599px) {
  .vision-sidebar.collapsed:hover {
    width: var(--sidebar-width);
    background: rgba(10, 10, 10, 0.9);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
  }

  /* Show labels on hover when collapsed - prevent icon shift */
  .vision-sidebar.collapsed:hover .vision-menu-item {
    justify-content: flex-start;
    gap: 12px;
    padding-left: 26px; /* Keep consistent padding */
    transform: translateX(0); /* Reset any transform */
  }

  /* Only show hover effects when hovering specific item, not just sidebar */
  .vision-sidebar.collapsed:hover .vision-menu-item:hover {
    transform: translateX(3px);
  }

  .vision-sidebar.collapsed:hover .vision-menu-item:hover::before {
    transform: scaleY(1);
  }

  /* Active items in collapsed:hover stay white */
  .vision-sidebar.collapsed:hover .vision-menu-item.active:hover {
    color: var(--text-primary) !important;
  }

  .vision-sidebar.collapsed:hover .vision-menu-item.active:hover::before {
    background: var(--text-primary);
  }

  .vision-sidebar.collapsed:hover .vision-menu-item .label {
    display: block;
    opacity: 1;
  }

  .vision-sidebar.collapsed:hover .vision-menu-item .icon {
    margin: 0;
  }

  /* Show profile name on hover */
  .vision-sidebar.collapsed:hover #sidebarName {
    opacity: 1;
    height: auto;
    overflow: visible;
  }

  /* Show logo on hover */
  .vision-sidebar.collapsed:hover .vision-sidebar-logo img {
    opacity: 1;
    width: auto;
    overflow: visible;
  }

  /* Show stage header label on hover */
  .vision-sidebar.collapsed:hover .stage-header-toggle {
    max-height: none;
    justify-content: flex-start;
    gap: 12px;
  }

  .vision-sidebar.collapsed:hover .stage-header-toggle .label {
    display: flex;
  }

  /* Show accordion content on hover */
  .vision-sidebar.collapsed:hover .stage-accordion-content {
    display: block;
  }

  /* Show dividers properly on hover */
  .vision-sidebar.collapsed:hover .vision-divider {
    margin: 12px 20px;
  }

  /* Adjust profile section on hover */
  .vision-sidebar.collapsed:hover .vision-sidebar-profile {
    padding: 20px 16px;
    margin-left: 0;
  }
}

/* Mobile overlay state - FULL SCREEN */
.vision-sidebar.open {
  transform: translateX(0);
  width: 100vw !important;
}

/* Mobile hidden state */
@media (max-width: 768px) {
  .vision-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    /* Ensure sidebar is hidden on mobile by default */
    visibility: visible;
  }
  
  .vision-sidebar.collapsed {
    transform: translateX(-100%);
  }
  
  .vision-sidebar.open {
    width: 100vw !important;
    transform: translateX(0);
  }
  
  /* Show sidebar once styles are loaded */
  :host[data-styles-loaded] .vision-sidebar {
    visibility: visible;
  }
}

/* Hide sidebar when modal is active (intro modal, workout overlay, etc.) */
.vision-sidebar.modal-active {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 1 !important; /* Lower z-index to ensure it's behind modals */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Disable pointer events on host when modal is active */
:host(.modal-active) {
  pointer-events: none !important;
  z-index: 1 !important; /* Lower z-index to ensure it's behind modals */
  opacity: 0 !important;
  visibility: hidden !important;
}

:host(.modal-active) * {
  pointer-events: none !important;
}

/* Wide screens - always unfolded */
@media (min-width: 1600px) {
  .vision-sidebar {
    width: var(--sidebar-width);
  }

  .vision-sidebar.collapsed {
    width: var(--sidebar-width);
  }
}

/* ============================================================================
   TOGGLE BUTTON
   ============================================================================ */

.vision-toggle-btn {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition-speed) ease;
  z-index: 10;
  opacity: 0.7;
}

.vision-toggle-btn:hover {
  opacity: 1;
}

/* Hide toggle button on wide screens */
@media (min-width: 1600px) {
  .vision-toggle-btn {
    display: none;
  }
}

.vision-toggle-btn .icon {
  width: 16px;
  height: 16px;
  color: var(--text-primary);
  transition: transform var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vision-toggle-btn .icon svg {
  width: 100%;
  height: 100%;
}

.vision-toggle-btn .icon.rotated {
  transform: rotate(180deg);
}

.vision-toggle-btn .icon.hidden {
  display: none;
}

/* Ensure chevron is visible on desktop when sidebar is collapsed or expanded */
@media (min-width: 769px) {
  .vision-toggle-btn .icon-chevron {
    display: flex !important;
  }
  
  .vision-sidebar.collapsed .vision-toggle-btn .icon-chevron {
    transform: rotate(0deg); /* Point right when collapsed */
  }
  
  .vision-sidebar:not(.collapsed) .vision-toggle-btn .icon-chevron {
    transform: rotate(180deg); /* Point left when expanded */
  }
}

/* Mobile: Make close button bigger and more visible when sidebar is open */
@media (max-width: 768px) {
  /* Hide built-in toggle when sidebar is open; close-btn handles mobile close */
  .vision-sidebar.open .vision-toggle-btn {
    display: none !important;
  }
}

/* Hide built-in toggle entirely when close-btn is injected */
.vision-sidebar.has-mobile-close-btn .vision-toggle-btn {
  display: none !important;
}

/* Hide toggle on wide screens */
@media (min-width: 1600px) {
  .vision-toggle-btn {
    display: none;
  }
}

/* ============================================================================
   LOGO
   ============================================================================ */

.vision-sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.vision-sidebar-logo img {
  max-width: 140px;
  height: auto;
  transition: opacity var(--transition-speed) ease;
}

.vision-sidebar.collapsed .vision-sidebar-logo img {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* ============================================================================
   PROFILE SECTION
   ============================================================================ */

.vision-sidebar-profile {
  padding: 20px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.vision-sidebar.collapsed .vision-sidebar-profile {
  padding: 20px 10px;
/* added to move profile pic left (center)*/
  margin-left: -16px;
}

/* Avatar wrapper styles are now defined in sidebar-component.js inline styles */
/* to support premium ring structure - these are backup/fallback styles */
.avatar-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;

  /* Blue neon glow effect */
  box-shadow:
    0 0 10px rgba(0, 243, 255, 0.4),
    0 0 20px rgba(0, 243, 255, 0.2),
    0 0 30px rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.3);
}

.avatar-wrapper:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 15px rgba(0, 243, 255, 0.6),
    0 0 30px rgba(0, 243, 255, 0.3),
    0 0 45px rgba(0, 243, 255, 0.15);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: white;
  font-family: 'Figtree', sans-serif;
}

#sidebarName {
  font-size: 17px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  font-family: 'Figtree', sans-serif;
  white-space: nowrap;
  transition: opacity var(--transition-speed) ease;
}

.vision-sidebar.collapsed #sidebarName {
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ============================================================================
   MENU ITEMS
   ============================================================================ */

.vision-sidebar-links {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0; /* Critical for flex children to allow scrolling */
  position: relative; /* Needed for sticky positioning */
}

/* Mobile: Ensure links container has proper height constraints */
@media (max-width: 768px) {
  .vision-sidebar-links {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px); /* Use dynamic viewport height for mobile */
    /* Ensure container can scroll on mobile */
    /* Ensure logout button area is always accessible */
    padding-bottom: 0; /* Remove bottom padding since logout has its own spacing */
  }
}

.vision-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  padding-left: 26px;
  color: #666;
  text-decoration: none;
  transition: transform 0.3s ease, color 0.3s ease, background 0.3s ease;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

/* Left border indicator using pseudo-element for smooth animation */
/* Only show on desktop - disabled on mobile to prevent stuck hover states */
.vision-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-green);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

/* Disable left border indicator on mobile/touch devices */
@media (max-width: 768px) {
  .vision-menu-item::before {
    display: none !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .vision-menu-item::before {
    display: none !important;
  }
}

.vision-menu-item:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  color: var(--accent-green);
  transform: translateX(3px); /* Smooth shift right */
}

.vision-menu-item:hover::before {
  transform: scaleY(1); /* Show border on hover */
}

/* Active state: white text/icon, no hover color change */
.vision-menu-item.active {
  color: var(--text-primary) !important;
}

/* Active items: keep white on hover, but still show border/shift */
.vision-menu-item.active:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  color: var(--text-primary) !important; /* Stay white */
  transform: translateX(3px);
}

.vision-menu-item.active::before {
  background: var(--text-primary); /* White border for active */
}

.vision-menu-item.active:hover::before {
  transform: scaleY(1);
}

/* Login button active state (different from page active state) */
/* Ensure login button never uses green active state */
#menu-profile.active {
  background: transparent !important;
  color: #666 !important;
}

#menu-profile.active::before {
  display: none !important;
}

#menu-profile.active .icon {
  color: #666 !important;
}

/* Coaching link active state - never show green (it's external) */
#link-1on1.active {
  background: transparent !important;
  color: #666 !important;
}

#link-1on1.active::before {
  display: none !important;
}

#link-1on1.active .icon {
  color: #666 !important;
}

#link-1on1.active .icon .icon-fill {
  color: #666 !important;
}

#link-1on1.is-pressing .icon {
  color: #666 !important;
}

#link-1on1.is-pressing .icon svg {
  color: #666 !important;
}

#menu-profile.active .icon svg {
  color: #666 !important;
  fill: #666 !important;
}

/* Login button yellow active state */
.vision-menu-item.login-active {
  background: rgba(201, 169, 97, 0.15) !important;
  color: var(--accent-yellow, #c9a961) !important;
}

.vision-menu-item.login-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-yellow, #c9a961) !important;
}

.vision-menu-item.login-active .icon {
  color: var(--accent-yellow, #c9a961) !important;
}

.vision-menu-item.login-active .icon svg {
  color: var(--accent-yellow, #c9a961) !important;
  fill: var(--accent-yellow, #c9a961) !important;
}

.vision-menu-item.login-active .icon .icon-fill {
  color: var(--accent-yellow, #c9a961) !important;
  fill: var(--accent-yellow, #c9a961) !important;
}

.vision-menu-item .icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  will-change: transform;
}

/* Inline SVG icon styles */
.vision-menu-item .icon svg {
  width: 24px;
  height: 24px;
  display: block;
  transition: opacity 0.2s ease, color 0.2s ease;
  fill: currentColor;
  color: currentColor;
}

.vision-menu-item .icon .icon-regular {
  display: block;
}

.vision-menu-item .icon .icon-fill {
  display: none;
}

.vision-menu-item.active .icon .icon-regular {
  display: none !important;
}

.vision-menu-item.active .icon .icon-fill {
  display: block !important;
  color: var(--text-primary) !important;
}

/* Ensure active items are white, not blue - use data attribute for extra specificity */
.vision-menu-item[data-active="true"] {
  color: var(--text-primary) !important;
}

.vision-menu-item[data-active="true"] .icon,
.vision-menu-item[data-active="true"] .icon svg,
.vision-menu-item[data-active="true"] .icon .icon-fill {
  color: var(--text-primary) !important;
}

/* Hover state icon color (non-active items only) */
.vision-menu-item:hover:not(.active):not([data-active="true"]) .icon {
  color: var(--accent-green) !important;
}

.vision-menu-item:hover:not(.active):not([data-active="true"]) .icon svg {
  color: var(--accent-green) !important;
}

.vision-menu-item:hover:not(.active):not([data-active="true"]) .icon .icon-fill {
  color: var(--accent-green) !important;
}

/* Active items stay white on hover */
.vision-menu-item.active:hover .icon,
.vision-menu-item.active:hover .icon svg,
.vision-menu-item.active:hover .icon .icon-fill {
  color: var(--text-primary) !important;
}

/* Disabled links always use regular icons (never filled) */
.vision-menu-item.disabled-link .icon .icon-regular {
  display: block !important;
}

.vision-menu-item.disabled-link .icon .icon-fill {
  display: none !important;
}

.vision-menu-item.disabled-link.active .icon .icon-regular {
  display: block !important;
}

.vision-menu-item.disabled-link.active .icon .icon-fill {
  display: none !important;
}

/* Press animation effect - only apply color change to non-active items */
.vision-menu-item.is-pressing .icon {
  transform: rotate(6deg) scale(1.04);
}

.vision-menu-item.is-pressing:not(.active):not([data-active="true"]) .icon {
  color: var(--accent-green, #00f3ff);
}

.vision-menu-item.is-pressing:not(.active):not([data-active="true"]) .icon svg {
  color: var(--accent-green, #00f3ff);
}

/* Active items keep white color even when pressing */
.vision-menu-item.is-pressing.active .icon,
.vision-menu-item.is-pressing[data-active="true"] .icon {
  color: var(--text-primary) !important;
}

.vision-menu-item.is-pressing.active .icon svg,
.vision-menu-item.is-pressing[data-active="true"] .icon svg {
  color: var(--text-primary) !important;
}

/* Disabled links don't get press animation */
.vision-menu-item.disabled-link.is-pressing .icon {
  transform: none;
  color: rgba(142, 142, 147, 0.4) !important;
}

.vision-menu-item.disabled-link.is-pressing .icon svg {
  color: rgba(142, 142, 147, 0.4) !important;
}

@media (prefers-reduced-motion: reduce) {
  .vision-menu-item .icon,
  .vision-menu-item.is-pressing .icon {
    transition: none !important;
  }
}

.vision-menu-item .label {
  font-size: 0.9rem;
  font-weight: 400;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

/* ============================================================================
   COLLAPSED STATE - Simplified
   When sidebar is collapsed (60px wide), only show centered icons
   ============================================================================ */

.vision-sidebar.collapsed .vision-menu-item {
  justify-content: center;
  gap: 0;
}

.vision-sidebar.collapsed .vision-menu-item .label {
  display: none;
}

.vision-sidebar.collapsed .vision-menu-item .icon {
  margin: 0;
}

/* Stage header - treat like any other menu item when collapsed */
.vision-sidebar.collapsed .stage-header-toggle {
  max-height: 44px;
  justify-content: center;
  gap: 0;
}

.vision-sidebar.collapsed .stage-header-toggle .label {
  display: none;
}

/* Stage accordion content - completely hidden when collapsed */
.vision-sidebar.collapsed .stage-accordion-content {
  display: none;
}

.vision-menu-item.disabled-link {
  opacity: 1;
  cursor: not-allowed;
  color: rgba(142, 142, 147, 0.4) !important;
  background: transparent !important;
}

.vision-menu-item.disabled-link.active {
  color: rgba(142, 142, 147, 0.4) !important;
  background: transparent !important;
}

.vision-menu-item.disabled-link.active::before {
  display: none !important;
}

.vision-menu-item.disabled-link .icon {
  color: rgba(142, 142, 147, 0.4) !important;
}

.vision-menu-item.disabled-link .icon svg {
  color: rgba(142, 142, 147, 0.4) !important;
}

.vision-menu-item.disabled-link.active .icon svg {
  color: rgba(142, 142, 147, 0.4) !important;
}

.vision-menu-item.disabled-link .label {
  color: rgba(142, 142, 147, 0.4) !important;
}

.vision-menu-item.disabled-link:hover {
  background: transparent !important;
  color: rgba(142, 142, 147, 0.4) !important;
}

.vision-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 12px 20px;
}

.vision-sidebar.collapsed .vision-divider {
  margin: 12px 10px;
}

/* ============================================================================
   LOGIN FORM
   ============================================================================ */

/* Auth container positioned after login button */
#sidebarAuthContainer {
  width: 100%;
  overflow: hidden;
  max-height: 0; /* Don't take vertical space by default */
  transition: max-height 0.3s ease;
}

/* Expand container when login form is showing */
#sidebarAuthContainer:has(#vision-login-form.show),
#sidebarAuthContainer.auth-open {
  max-height: 700px; /* Allow space for expanded login form (increased for mobile) */
  overflow: visible; /* Allow form content to be fully visible */
}

/* Mobile: Increase container height to prevent cutoff */
@media (max-width: 768px) {
  #sidebarAuthContainer:has(#vision-login-form.show),
  #sidebarAuthContainer.auth-open {
    max-height: 800px; /* Extra space on mobile for all form elements */
  }
}

/* When auth container is in menu links, remove border-top and adjust padding */
.vision-sidebar-links #sidebarAuthContainer {
  padding: 0;
  margin: 0;
  border-top: none;
  width: 100%;
  overflow: hidden;
}

#vision-login-form {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 20px;
  border-top: 1px solid var(--sidebar-border);
  max-width: 100%;
  box-sizing: border-box;
  background: transparent;
  transform: translateY(-10px);
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, transform 0.3s ease;
}

/* When login form is in menu links, adjust styling */
.vision-sidebar-links #vision-login-form {
  padding: 0 20px;
  border-top: none;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 4px;
}

#vision-login-form.show {
  max-height: 600px; /* Increased to accommodate all form elements */
  opacity: 1;
  padding: 20px 20px;
  transform: translateY(0);
  overflow: visible; /* Allow all content to be visible, including button and divider */
}

/* Mobile: Limit max-height to prevent pushing logout button out of view */
@media (max-width: 768px) {
  #vision-login-form.show {
    max-height: calc(100vh - 300px); /* Leave space for header, logout button, and padding */
    /* Use viewport-based calculation to ensure logout button stays visible */
    overflow-y: auto; /* Allow login form to scroll if content is too tall */
    overflow-x: hidden;
  }
}

/* When login form is in menu links and shown */
.vision-sidebar-links #vision-login-form.show {
  padding: 16px 20px;
}

/* Hide login form when sidebar is collapsed */
.vision-sidebar.collapsed #vision-login-form {
  max-height: 0 !important;
  opacity: 0 !important;
  padding: 0 20px !important;
  overflow: hidden !important;
}

.vision-sidebar.collapsed #vision-login-form.show {
  max-height: 0 !important;
  opacity: 0 !important;
  padding: 0 20px !important;
  overflow: hidden !important;
}

.input-wrapper {
  margin-bottom: 16px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.input-wrapper input {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  transition: border-color var(--transition-speed) ease;
  box-sizing: border-box;
}

.input-wrapper input:focus {
  outline: none;
  border-bottom-color: var(--text-primary);
}

.input-wrapper input::placeholder {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 1;
}

.forgot-password-pill {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.forgot-password-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: rgba(255, 255, 255, 0.3);
}

.login-remember label {
  cursor: pointer;
  user-select: none;
}

#login-button {
  width: 100%;
  height: 44px;
  padding: 0 20px;
  margin: 20px 0 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#login-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

#login-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}

#login-button.loading {
  pointer-events: none;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

#login-button.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#login-error-message {
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid var(--error-color);
  border-radius: 8px;
  color: var(--error-color);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  text-align: center;
}

.signup-link-container {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.6;
}

.signup-link-container a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.signup-link-container a:hover {
  opacity: 0.8;
}

/* ============================================================================
   LOGOUT LINK
   ============================================================================ */

.logout-spacer {
  flex-grow: 1;
  min-height: 0; /* Allow spacer to shrink if needed */
}

.logout-link {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0; /* Prevent logout button from shrinking */
}

/* Mobile: Make logout button sticky at bottom so it's always visible */
@media (max-width: 768px) {
  /* Ensure logout button container is always visible */
  .vision-sidebar-links .logout-link,
  .logout-link {
    position: sticky !important;
    bottom: 0 !important;
    background: var(--sidebar-bg) !important;
    background-clip: padding-box;
    z-index: 1000 !important; /* Very high z-index to ensure it's above everything */
    margin-top: auto !important;
    border-top: 1px solid var(--sidebar-border) !important;
    border-bottom: none !important;
    /* Add shadow to separate from scrolling content */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
    /* Ensure button is always visible - use !important to override any other rules */
    min-height: 48px !important; /* Minimum touch target size */
    display: flex !important; /* Force display */
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Force opacity */
    width: 100% !important; /* Ensure full width */
  }
  
  /* Ensure divider before logout is also visible */
  .logout-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--sidebar-border);
    z-index: 1;
  }
  
  /* Ensure logout spacer doesn't collapse */
  .logout-spacer {
    min-height: 20px !important; /* Minimum height to ensure space */
    flex-shrink: 0 !important; /* Prevent spacer from shrinking */
  }
  
  /* Override any potential hiding rules */
  .vision-sidebar-links .logout-link[style*="display: none"],
  .logout-link[style*="display: none"] {
    display: flex !important;
  }
}

/* ============================================================================
   MOBILE OVERLAY BACKDROP
   ============================================================================ */

@media (max-width: 768px) {
  .vision-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
  }
  
  .vision-sidebar.open ~ .vision-sidebar-backdrop,
  body.sidebar-open .vision-sidebar-backdrop {
    opacity: 1;
    pointer-events: all;
  }
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */

.vision-sidebar-links::-webkit-scrollbar {
  width: 6px;
}

.vision-sidebar-links::-webkit-scrollbar-track {
  background: transparent;
}

.vision-sidebar-links::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.vision-sidebar-links::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
  display: none !important;
}

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

.no-scroll {
  overflow: hidden !important;
}

/* ============================================================================
   VARIANT-A THEME OVERRIDES
   Yellow highlight color instead of cyan for urban/industrial design
   ============================================================================ */

:host([data-theme="variant-a"]) {
  --accent-green: #DFFF00;
}

:host([data-theme="variant-a"]) .vision-menu-item:hover {
  color: #DFFF00;
}

:host([data-theme="variant-a"]) .vision-menu-item::before {
  background: #DFFF00;
}

:host([data-theme="variant-a"]) .vision-menu-item:hover:not(.active):not([data-active="true"]) .icon,
:host([data-theme="variant-a"]) .vision-menu-item:hover:not(.active):not([data-active="true"]) .icon svg,
:host([data-theme="variant-a"]) .vision-menu-item:hover:not(.active):not([data-active="true"]) .icon .icon-fill {
  color: #DFFF00 !important;
}

:host([data-theme="variant-a"]) .vision-menu-item.is-pressing:not(.active):not([data-active="true"]) .icon,
:host([data-theme="variant-a"]) .vision-menu-item.is-pressing:not(.active):not([data-active="true"]) .icon svg {
  color: #DFFF00;
}

:host([data-theme="variant-a"]) .stages-button:hover {
  color: #DFFF00;
}

:host([data-theme="variant-a"]) .stages-button:hover .icon {
  color: #DFFF00;
}

/* Urban mode: On mobile, sidebar slides in from left below top bar */
@media (max-width: 768px) {
  :host([data-theme="variant-a"]) .vision-sidebar {
    top: 61px;
    bottom: 0;
    height: auto;
    width: 280px;
  }

  /* Ensure sidebar fills remaining space when open */
  :host([data-theme="variant-a"]) .vision-sidebar.open {
    top: 61px;
    bottom: 0;
    height: auto;
    width: 280px;
  }

  /* Hide the logo section on mobile - top bar already shows PER/FORM */
  :host([data-theme="variant-a"]) .vision-sidebar-logo {
    display: none;
  }

  /* Position backdrop below the top bar border */
  :host([data-theme="variant-a"]) .vision-sidebar-backdrop {
    top: 61px;
  }

  /* Hide the close button - hamburger in top bar handles closing */
  :host([data-theme="variant-a"]) #sidebarMobileCloseBtn,
  :host([data-theme="variant-a"]) close-btn {
    display: none !important;
  }
}

/* Urban mode: Replace logo image with PER/FORM text */
:host([data-theme="variant-a"]) .vision-sidebar-logo {
  position: relative;
}

:host([data-theme="variant-a"]) .vision-sidebar-logo img {
  display: none;
}

:host([data-theme="variant-a"]) .vision-sidebar-logo::after {
  content: 'PER/FORM';
  font-family: 'Anton', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
}

/* Hide PER/FORM text when sidebar is collapsed */
:host([data-theme="variant-a"]) .vision-sidebar.collapsed .vision-sidebar-logo::after {
  display: none;
}

/* Show PER/FORM text when hovering collapsed sidebar */
@media (min-width: 769px) and (max-width: 1599px) {
  :host([data-theme="variant-a"]) .vision-sidebar.collapsed:hover .vision-sidebar-logo::after {
    display: block;
  }
}

/* Urban mode: Keep toggle chevron visible (except on wide screens where sidebar is always expanded) */
@media (max-width: 1599px) {
  :host([data-theme="variant-a"]) .vision-toggle-btn {
    display: flex;
  }
}

/* Urban mode: Rotate chevron based on sidebar state */
:host([data-theme="variant-a"]) .vision-sidebar.collapsed .vision-toggle-btn .icon-chevron {
  transform: rotate(0deg);
}

:host([data-theme="variant-a"]) .vision-sidebar:not(.collapsed) .vision-toggle-btn .icon-chevron {
  transform: rotate(180deg);
}

/* Rotate chevron when hovering collapsed sidebar */
@media (min-width: 769px) and (max-width: 1599px) {
  :host([data-theme="variant-a"]) .vision-sidebar.collapsed:hover .vision-toggle-btn .icon-chevron {
    transform: rotate(180deg);
  }
}

/* Urban mode: Match sidebar background to urban design - semi-transparent */
:host([data-theme="variant-a"]) .vision-sidebar {
  --sidebar-bg: rgba(15, 15, 15, 0.85);
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Urban mode: Yellow glow for avatar instead of blue */
:host([data-theme="variant-a"]) .avatar-wrapper {
  box-shadow:
    0 0 10px rgba(223, 255, 0, 0.4),
    0 0 20px rgba(223, 255, 0, 0.2),
    0 0 30px rgba(223, 255, 0, 0.1);
  border: 1px solid rgba(223, 255, 0, 0.3);
}

:host([data-theme="variant-a"]) .avatar-wrapper:hover {
  box-shadow:
    0 0 15px rgba(223, 255, 0, 0.6),
    0 0 30px rgba(223, 255, 0, 0.3),
    0 0 45px rgba(223, 255, 0, 0.15);
}

