/* === macOS style Launchpad === */
.app-launcher {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 50px;
  box-sizing: border-box;
}

.app-launcher.hidden {
  display: none;
}

.app-launcher-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transition: opacity 0.25s ease;
  opacity: 0;
}

.app-launcher.active .app-launcher-backdrop {
  opacity: 1;
}

.app-launcher-content {
  position: relative;
  width: min(1040px, 92vw);
  height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  transform: scale(1.15);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.app-launcher.active .app-launcher-content {
  transform: scale(1);
  opacity: 1;
}

/* Search bar */
.launchpad-search-container {
  width: 100%;
  max-width: 280px;
  margin-bottom: 30px;
  position: relative;
}

.launchpad-search-input {
  width: 100%;
  padding: 6px 12px 6px 30px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.launchpad-search-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.launchpad-search-input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
  text-align: left;
}

/* Search icon */
.launchpad-search-container::before {
  content: "⌕";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-55%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 16px;
  pointer-events: none;
}

/* Grid layout */
.launchpad-grid-container {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  box-sizing: border-box;
}

.launchpad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 24px 16px;
  width: 100%;
  max-width: 900px;
  justify-items: center;
  padding: 10px;
}

.launchpad-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100px;
  border: none;
  background: transparent;
  cursor: pointer;
  outline: none;
  color: #ffffff;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: launchpadItemPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.launchpad-item:hover {
  transform: scale(1.08);
}

.launchpad-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: filter 0.15s;
}

.launchpad-icon-svg {
  background: transparent !important;
  box-shadow: none !important;
}

.launchpad-icon-svg svg {
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.launchpad-name {
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launchpad-empty {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-align: center;
  padding: 40px;
}

/* Pagination dots at the bottom */
.launchpad-pagination {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 20px;
  justify-content: center;
}

.launchpad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.launchpad-dot:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

.launchpad-dot.active {
  background: #ffffff;
  transform: scale(1.2);
}

/* Animations */
@keyframes launchpadItemPop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.app-launcher-open {
  overflow: hidden;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  .launchpad-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 16px 12px;
  }
  .launchpad-icon, .launchpad-icon-svg svg {
    width: 60px;
    height: 60px;
    font-size: 32px;
    border-radius: 13px;
  }
  .launchpad-item {
    width: 80px;
  }
}
