/* ─────────────────────────────────────────────────
   Dashboard Aplikasi — iOS 26 Liquid Glass Design
   ───────────────────────────────────────────────── */

/* ── 1. RESET & TOKENS ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Glass surfaces */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-strong: rgba(255, 255, 255, 0.14);
  --glass-bg-hover: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-strong: rgba(255, 255, 255, 0.30);
  --glass-blur: blur(28px) saturate(180%);
  --glass-blur-strong: blur(40px) saturate(200%);

  /* Brand */
  --brand: #3b82f6;
  --brand-glow: rgba(59, 130, 246, 0.35);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.60);
  --text-tertiary: rgba(255, 255, 255, 0.38);

  /* Status colours */
  --status-online: #34d399;
  --status-offline: #f87171;
  --status-maintenance: #fbbf24;
  --status-beta: #60a5fa;

  /* Layout */
  --topbar-h: 72px;
  --filter-h: 52px;
  --dock-h: 100px;
  --grid-gap: 28px;
  --icon-size: 76px;
  --icon-radius: 22px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. BODY & CANVAS ── */
html,
body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--text-primary);
  background: #0a0a1a;
  -webkit-font-smoothing: antialiased;
}

/* ── 3. ANIMATED GRADIENT BLOBS (wallpaper) ── */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, #0d0a2e 0%, #0a0a1a 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: blobFloat 20s ease-in-out infinite alternate;
}

.blob-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #4f46e5 0%, #7c3aed 60%, transparent 100%);
  top: -200px;
  left: -150px;
  animation-duration: 18s;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #0891b2 0%, #06b6d4 60%, transparent 100%);
  top: 10%;
  right: -100px;
  animation-duration: 22s;
  animation-delay: -6s;
}

.blob-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #be185d 0%, #ec4899 50%, transparent 100%);
  bottom: 20%;
  left: 20%;
  animation-duration: 26s;
  animation-delay: -10s;
}

.blob-4 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #065f46 0%, #10b981 60%, transparent 100%);
  bottom: 5%;
  right: 15%;
  animation-duration: 30s;
  animation-delay: -4s;
}

@keyframes blobFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(40px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-30px, 50px) scale(0.95);
  }

  100% {
    transform: translate(20px, -20px) scale(1.02);
  }
}

/* ── 4. TOPBAR ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 100;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(10, 10, 26, 0.5);
  border-bottom: 1px solid var(--glass-border);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.logo-mark {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
  line-height: 1;
}

.brand-tld {
  color: var(--brand);
  font-weight: 400;
}

.topbar-title-group {
  display: flex;
  flex-direction: column;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 8px 14px;
  backdrop-filter: blur(16px);
  transition: border-color 0.2s, background 0.2s;
}

.search-wrap:focus-within {
  border-color: rgba(167, 139, 250, 0.5);
  background: var(--glass-bg-strong);
}

.search-icon {
  font-size: 16px;
  color: var(--text-tertiary);
  line-height: 1;
}

#search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  width: 200px;
}

#search-input::placeholder {
  color: var(--text-tertiary);
}

/* Clock */
.clock {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

/* ── 5. FILTER BAR ── */
.filter-bar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  height: var(--filter-h);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(10, 10, 26, 0.35);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  backdrop-filter: blur(12px);
}

.filter-pill:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
}

.filter-pill.active {
  background: rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.55);
  color: #c4b5fd;
  font-weight: 600;
}

/* ── 6. APP GRID ── */
.app-grid-container {
  position: relative;
  z-index: 10;
  min-height: calc(100vh - var(--topbar-h) - var(--filter-h) - var(--dock-h));
  padding-top: calc(var(--topbar-h) + var(--filter-h) + 36px);
  padding-bottom: calc(var(--dock-h) + 40px);
  padding-left: 28px;
  padding-right: 28px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--grid-gap) 12px;
  max-width: 1400px;
  margin: 0 auto;
  justify-items: center;
}

/* ── 7. APP CARD (icon + label) ── */
.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 28px;
  transition: transform 0.25s var(--ease-spring);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: cardIn 0.4s var(--ease-spring) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-card:hover {
  transform: scale(1.10);
}

.app-card:active {
  transform: scale(0.96);
}

/* Icon shell */
.app-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: var(--icon-radius);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.50),
    0 2px 8px rgba(0, 0, 0, 0.30),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 1px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease-smooth);
  flex-shrink: 0;
}

/* Liquid Glass inner sheen */
.app-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg,
      rgba(255, 255, 255, 0.30) 0%,
      rgba(255, 255, 255, 0.05) 40%,
      transparent 70%);
  z-index: 1;
  pointer-events: none;
}

/* Bottom reflection */
.app-icon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  border-radius: 0 0 var(--icon-radius) var(--icon-radius);
  background: linear-gradient(to bottom,
      transparent,
      rgba(0, 0, 0, 0.18));
  z-index: 1;
  pointer-events: none;
}

.app-card:hover .app-icon {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(255, 255, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.30),
    inset 0 -1px 1px rgba(0, 0, 0, 0.25);
}

.icon-emoji {
  position: relative;
  z-index: 2;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Status badge */
.status-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(10, 10, 26, 0.9);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.status-badge.online {
  background: var(--status-online);
}

.status-badge.offline {
  background: var(--status-offline);
  animation: pulseBad 2s ease-in-out infinite;
}

.status-badge.maintenance {
  background: var(--status-maintenance);
  animation: pulseMaint 3s ease-in-out infinite;
}

.status-badge.beta {
  background: var(--status-beta);
}

@keyframes pulseBad {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(248, 113, 113, 0), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

@keyframes pulseMaint {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(251, 191, 36, 0), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

/* App label */
.app-label {
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 15px;
  padding-top: 60px;
}

/* ── 8. DETAIL CARD (modal) ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.detail-card {
  position: fixed;
  z-index: 210;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 40px));
  border-radius: 28px;
  background: rgba(20, 20, 40, 0.72);
  backdrop-filter: blur(50px) saturate(220%);
  -webkit-backdrop-filter: blur(50px) saturate(220%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.60),
    0 2px 0 rgba(255, 255, 255, 0.12) inset;
  overflow: hidden;
  animation: cardPop 0.3s var(--ease-spring);
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.90);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.detail-card-inner {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.22);
  position: relative;
  overflow: hidden;
}

.detail-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.detail-title-group {
  flex: 1;
  min-width: 0;
}

.detail-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-version {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 2px;
  display: block;
}

.detail-close {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.detail-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.detail-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Meta grid */
.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-meta-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
}

.meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* URL row */
.detail-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
}

.meta-url {
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.detail-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border-radius: 50px;
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s var(--ease-smooth);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.detail-open-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Status in detail */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}

.status-pill::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pill.online {
  color: var(--status-online);
}

.status-pill.online::before {
  background: var(--status-online);
}

.status-pill.offline {
  color: var(--status-offline);
}

.status-pill.offline::before {
  background: var(--status-offline);
}

.status-pill.maintenance {
  color: var(--status-maintenance);
}

.status-pill.maintenance::before {
  background: var(--status-maintenance);
}

.status-pill.beta {
  color: var(--status-beta);
}

.status-pill.beta::before {
  background: var(--status-beta);
}

/* Tags */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  padding: 4px 10px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── 9. DOCK ── */
.dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 14px 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  border: 1px solid var(--glass-border-strong);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.50),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
  max-width: calc(100vw - 40px);
  overflow-x: auto;
  scrollbar-width: none;
}

.dock::-webkit-scrollbar {
  display: none;
}

.dock-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Dock icon — smaller version */
.dock-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-spring);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    inset 0 -1px 1px rgba(0, 0, 0, 0.22);
}

.dock-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.dock-icon:hover {
  transform: translateY(-8px) scale(1.12);
}

.dock-icon:active {
  transform: translateY(0) scale(0.95);
}

.dock-icon-inner {
  position: relative;
  z-index: 2;
  line-height: 1;
}

.dock-status-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(10, 10, 26, 0.9);
  z-index: 5;
}

.dock-status-badge.online {
  background: var(--status-online);
}

.dock-status-badge.offline {
  background: var(--status-offline);
}

.dock-status-badge.maintenance {
  background: var(--status-maintenance);
}

.dock-status-badge.beta {
  background: var(--status-beta);
}

/* ── 10. UTILITY & HIDDEN ── */
[hidden] {
  display: none !important;
}

/* ── 11. SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── 12. RESPONSIVE ── */
@media (max-width: 600px) {
  :root {
    --icon-size: 64px;
    --icon-radius: 18px;
    --grid-gap: 20px;
  }

  .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px 8px;
  }

  .topbar-inner {
    padding: 0 16px;
  }

  #search-input {
    width: 130px;
  }

  .filter-bar {
    padding: 0 16px;
  }

  .app-grid-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .clock {
    display: none;
  }
}