/* Mint Menu — Cinnamon menu applet with sidebar */
#menu-popup {
  position: absolute;
  left: 5px;
  bottom: var(--panel-height);
  width: min(730px, calc(100vw - 10px));
  height: min(600px, calc(100vh - var(--panel-height) - 16px));
  background: var(--menu-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-menu) var(--r-menu) 0 0;
  box-shadow: var(--shadow-menu);
  display: flex;
  overflow: hidden;
  z-index: 950;
  animation: menu-in 150ms var(--ease-out);
}
#menu-popup.at-top { top: var(--panel-height); bottom: auto; border-radius: 0 0 var(--r-menu) var(--r-menu); }
#menu-popup.closing { opacity: 0; transform: translateY(10px); transition: opacity 120ms ease-in, transform 120ms ease-in; }
@keyframes menu-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* sidebar strip */
.menu-sidebar {
  width: 66px;
  background: var(--hover-fill);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 12px;
  gap: 6px;
  flex: none;
}
.ms-btn {
  width: 42px; height: 36px;
  border-radius: var(--r-item);
  display: grid; place-items: center;
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}
.ms-btn:hover { background: rgba(255, 255, 255, .55); color: var(--text); }
:root[data-dark="true"] .ms-btn:hover { background: rgba(255, 255, 255, .1); }
.ms-btn.active { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-dark="true"] .ms-btn.active { background: var(--pressed-fill); }
.ms-spacer { flex: 1; }
.ms-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; margin-bottom: 2px; }
.ms-system {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--button-bg);
  color: var(--text-secondary);
  display: grid; place-items: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.ms-system:hover { background: #fff; color: var(--text); }
:root[data-dark="true"] .ms-system:hover { background: var(--button-hover); }
.ms-system.shutdown { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.ms-system.shutdown:hover { background: var(--destructive-hover); }

/* main column */
.menu-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.menu-search-row { padding: 13px 14px 9px; }
.menu-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--entry-bg);
  border: 1px solid var(--entry-border);
  border-radius: var(--r-entry);
  padding: 6px 10px;
}
.menu-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.menu-search-box svg { color: var(--text-insensitive); flex: none; }
.menu-search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: var(--fs-ui); color: var(--text);
}
.menu-content { flex: 1; display: flex; gap: 6px; padding: 4px 14px 14px; min-height: 0; }

/* categories column */
.menu-cats { width: 185px; flex: none; overflow-y: auto; padding-right: 2px; }
.mc-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-item);
  text-align: left;
  color: var(--text);
}
.mc-item svg { color: var(--text-secondary); }
.mc-item:hover, .mc-item.selected { background: var(--hover-fill); }

/* applications column */
.menu-apps { flex: 1; overflow-y: auto; min-width: 0; padding-right: 2px; }
.ma-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-item);
  text-align: left;
}
.ma-item:hover, .ma-item.selected { background: var(--hover-fill); }
.ma-item .ma-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.ma-item .ma-texts { min-width: 0; }
.ma-item .ma-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-item .ma-desc {
  font-size: var(--fs-xsmall); color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-fav {
  margin-left: auto; opacity: 0; color: var(--text-insensitive);
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
}
.ma-item:hover .ma-fav { opacity: 1; }
.ma-fav:hover { background: var(--pressed-fill); color: var(--text); }
.ma-fav.on { opacity: 1; color: #f5a623; }

/* favorites / all apps tile grid */
.menu-tiles {
  flex: 1; overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 4px;
  align-content: start;
  padding-right: 2px;
}
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 6px 10px;
  border-radius: var(--r-item);
  position: relative;
}
.tile:hover { background: var(--hover-fill); }
.tile .t-icon { width: 44px; height: 44px; display: grid; place-items: center; }
.tile .t-label {
  font-size: var(--fs-small); text-align: center; line-height: 1.25;
  max-width: 92px; overflow-wrap: break-word;
}
.tile .ma-fav { position: absolute; top: 4px; right: 4px; }

.menu-empty {
  flex: 1; display: grid; place-items: center;
  color: var(--text-insensitive);
  font-size: var(--fs-ui);
}

@media (max-width: 760px) {
  #menu-popup { left: 4px; right: 4px; width: auto; height: calc(100vh - var(--panel-height) - 8px); }
  .menu-cats { width: 140px; }
}
