﻿/* Mobile navigation toggle button */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  height: 18px;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(4px);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: linear-gradient(180deg, #0c1420 0%, #091018 100%);
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-open { left: 0; }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #0c1420 0%, #091018 100%);
  z-index: 1;
}

.mobile-nav-header h2 { font-size: 1.125rem; font-weight: 500; color: var(--text-primary); }

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.mobile-nav-close:hover { color: var(--text-primary); }

.mobile-nav-content { padding: 0.5rem 0; }

/* Pushed to the bottom of the panel by the flex column below. */
.mobile-nav-footer { margin-top: auto; }

.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.mobile-nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
}

.mobile-nav-user-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.mobile-nav-footer .footer-content { padding: 0 1rem; text-align: center; }

.mobile-nav-link {
  display: block;
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  font-size: 0.9375rem;
  border-left: 3px solid transparent;
}

/* MobileNav.tsx's items were all <Link>s, so these rules never needed to
   reset button chrome. This port's "Shared With Me" item opens a modal
   instead of navigating, so it has to be a <button>, which without this
   renders with the UA's default face, border, centered text and
   shrink-to-fit width - visibly unlike the links stacked around it. */
button.mobile-nav-link {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.mobile-nav-link:hover {
  background-color: rgba(47, 143, 255, 0.06);
  color: var(--text-primary);
}

.mobile-nav-link-active {
  background-color: rgba(47, 143, 255, 0.08);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.mobile-nav-section {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.mobile-nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-weight: 500;
}

.mobile-nav-section-toggle:hover {
  background-color: rgba(47, 143, 255, 0.06);
  color: var(--text-primary);
}

.mobile-nav-section-icon { font-size: 0.75rem; transition: transform 0.2s; }
.mobile-nav-section-items { background-color: rgba(0, 0, 0, 0.15); }
.mobile-nav-link-nested { padding-left: 2rem; font-size: 0.875rem; }

@media (max-width: 768px) {
  .mobile-nav-toggle { display: block; }
  /* flex column so .mobile-nav-footer can margin-top:auto to the bottom */
  .mobile-nav { display: flex; flex-direction: column; }
  .mobile-nav-overlay { display: block; }
}