.menu-card {
  width: min(500px, 95vw) !important;
  height: min(700px, 85vh);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  background-color: var(--c-surface-container);
  border: 1px solid var(--c-outline-variant);
}

.menu-header {
  display: flex;
  align-items: center;
  padding: 1.25em;
  border-bottom: 1px solid var(--c-outline-variant);
  gap: 1em;
  background-color: var(--c-surface-container-high);
}

.menu-header h2 {
  flex: 1;
  margin: 0;
  font-size: 1.25em;
  font-weight: 600;
}

.menu-viewport {
  position: relative;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 300px;
  flex: 1;
}

.menu-content {
  width: 100%;
  padding: 0.5em 0;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  background-color: var(--c-surface-container);
}

.menu-content.animating {
  position: absolute;
  top: 0;
  left: 0;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s;
}

@keyframes slideOutLeft {
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}
@keyframes slideOutRight {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-out-left {
  animation: slideOutLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-out-right {
  animation: slideOutRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-in-left {
  animation: slideInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger effect */
.menu-content > *:nth-child(1) {
  animation-delay: 0.02s;
}
.menu-content > *:nth-child(2) {
  animation-delay: 0.04s;
}
.menu-content > *:nth-child(3) {
  animation-delay: 0.06s;
}
.menu-content > *:nth-child(4) {
  animation-delay: 0.08s;
}
.menu-content > *:nth-child(5) {
  animation-delay: 0.1s;
}
.menu-content > *:nth-child(6) {
  animation-delay: 0.12s;
}
.menu-content > *:nth-child(7) {
  animation-delay: 0.14s;
}
.menu-content > *:nth-child(8) {
  animation-delay: 0.16s;
}

.menu-item {
  margin: 0 1.25em;
  transition:
    transform 0.1s,
    filter 0.2s;
}

.menu-item:active {
  transform: scale(0.98);
}

.menu-item img {
  width: 22px;
  height: 22px;
}

.menu-item .label {
  flex: 1;
  font-size: 1.05em;
  font-weight: bold;
  text-align: left;
}

.menu-item .chevron {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  margin-right: -0.5em;
  margin-top: -0.25em;
}

.menu-item.danger {
  background-color: var(--c-error-container) !important;
  color: var(--c-error-container-on) !important;
}

.menu-item.danger img {
  filter: none !important;
}

.menu-item > .material-symbols-rounded {
  padding-left: 0.25em;
}

.menu-section-header {
  padding: 1.5em 1.5em 0.5em 2em;
  font-size: 0.85em;
  font-weight: bold;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}
