/* ─────────────────────────────────────────────────────────
   launcher.css — MEA Hub Launcher
   Compact floating sheet — tidak full width, tidak terlalu tinggi
   ───────────────────────────────────────────────────────── */

/* ── Backdrop ───────────────────────────────────────────── */
#launcher-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#launcher-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Sheet — floating, tidak mentok ────────────────────── */
#launcher-sheet {
  position: fixed;
  /* Naik dari bottom nav — tidak mengisi full layar */
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  /* Margin kiri kanan — tidak mentok */
  left: 16px;
  right: 16px;
  /* Max height — sekitar sampai area "Akses Cepat" dari bawah */
  max-height: 46vh;
  overflow-y: auto;

  /* Glass — base on MEA --surface (#131C2E), lebih terang dari sebelumnya */
  background: rgba(19, 28, 46, 0.96);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(129, 212, 250, 0.14);
  border-radius: 20px;
  z-index: 1101;

  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.30s cubic-bezier(0.32, 1.15, 0.58, 1),
    opacity 0.25s ease;

  box-shadow:
    0 -2px 32px rgba(129, 212, 250, 0.05),
    0 8px 40px rgba(0, 0, 0, 0.40),
    0 0 0 1px rgba(129, 212, 250, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#launcher-sheet.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Aurora hairline top */
#launcher-sheet::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(129, 212, 250, 0.30) 30%,
    rgba(160, 220, 255, 0.45) 50%,
    rgba(129, 212, 250, 0.30) 70%,
    transparent 100%
  );
  border-radius: 1px;
  pointer-events: none;
}

/* ── Handle ─────────────────────────────────────────────── */
.launcher-handle {
  width: 32px;
  height: 3px;
  background: rgba(129, 212, 250, 0.22);
  border-radius: 2px;
  margin: 10px auto 14px;
}

/* ── Section title ──────────────────────────────────────── */
.launcher-section-title {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(129, 212, 250, 0.45);
  padding: 0 16px;
  margin-bottom: 8px;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
}

/* ── Grid ───────────────────────────────────────────────── */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 0 10px 10px;
}

/* ── App Item ───────────────────────────────────────────── */
.launcher-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: rgba(138, 154, 173, 0.75);
  background: transparent;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Active items — default state carries subtle MEA accent identity */
.launcher-app-item:not(.disabled) {
  background: rgba(129, 212, 250, 0.025);
  border-color: rgba(129, 212, 250, 0.07);
  color: rgba(240, 244, 248, 0.62);
}

.launcher-app-item:not(.disabled):hover,
.launcher-app-item:not(.disabled):active {
  background: rgba(129, 212, 250, 0.10);
  border-color: rgba(129, 212, 250, 0.22);
  color: #F0F4F8;
  transform: translateY(-1px);
}

.launcher-app-item:not(.disabled):active {
  transform: scale(0.95);
  transition-duration: 0.1s;
}

/* ── Disabled ───────────────────────────────────────────── */
.launcher-app-item.disabled {
  cursor: default;
  opacity: 0.28;
  pointer-events: none;
}

/* ── Label ──────────────────────────────────────────────── */
.launcher-app-label {
  font-size: 0.66rem;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  text-align: center;
  line-height: 1.3;
}

/* ── Soon badge ─────────────────────────────────────────── */
.soon-badge {
  display: inline-block;
  font-size: 0.48rem;
  font-weight: 600;
  background: rgba(129, 212, 250, 0.07);
  color: rgba(129, 212, 250, 0.50);
  border: 1px solid rgba(129, 212, 250, 0.10);
  border-radius: 3px;
  padding: 1px 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Divider ────────────────────────────────────────────── */
.launcher-divider {
  height: 1px;
  background: rgba(36, 48, 80, 0.8);
  margin: 4px 10px 10px;
}

/* ── Scrollbar hidden ───────────────────────────────────── */
#launcher-sheet::-webkit-scrollbar { width: 0; }

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #launcher-sheet,
  #launcher-backdrop,
  .launcher-app-item { transition: none; }
}

/* ── Desktop — panel compact dekat logo MEA di sidebar ───── */
@media (min-width: 768px) {
  /* Sidebar punya backdrop transparan sendiri untuk klik-di-luar;
     full-screen dim dari mobile tidak diperlukan di desktop */
  #launcher-backdrop.open {
    opacity: 0;
    pointer-events: none;
  }

  #launcher-sheet {
    left: 244px;
    right: auto;
    bottom: auto;
    top: 124px;
    width: 320px;
    max-height: 60vh;
    z-index: 1145; /* di atas sidebar-panel (1140), di bawah logo MEA (1160) */
    transform: translateX(-12px);
  }

  #launcher-sheet.open {
    transform: translateX(0);
  }
}
