/* Heimdall 3D Clean Portal - Glowing Icons & Multi-Themes */
@import url("https://fonts.googleapis.com/css2?family=Play:wght@400;700&family=Inter:wght@400;500;600;700&display=swap");

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========================================================
   THEME DEFINITIONS (4 VARIATIONS)
   1. Obsidian (Dark Cyan)
   2. Emerald (Dark Jade)
   3. Sapphire (Dark Royal Indigo)
   4. Light (Putih Cerah)
   ======================================================== */
:root, [data-theme="obsidian"] {
  --bg-image: url("storage/bg/img_bg1.jpg");
  --mask-color: #080c14;
  --bg-overlay: radial-gradient(circle at 50% 20%, rgba(14, 23, 42, 0.45) 0%, rgba(8, 12, 20, 0.90) 100%);
  --theme-accent: #38bdf8;
  --theme-glow: rgba(56, 189, 248, 0.35);
  --icon-bg: rgba(16, 24, 40, 0.78);
  --icon-border: rgba(56, 189, 248, 0.24);
  --icon-border-top: rgba(255, 255, 255, 0.45);
  --icon-border-bottom: rgba(0, 0, 0, 0.65);
  --icon-glow-soft: rgba(56, 189, 248, 0.25);
  --icon-glow: rgba(56, 189, 248, 0.45);
  --icon-glow-intense: rgba(56, 189, 248, 0.85);
  --icon-specular: rgba(255, 255, 255, 0.55);
  --icon-shadow-alpha: 0.75;
  --icon-shadow-sub: 0.5;
  --icon-shadow-inner: 0.55;
  --icon-shadow-hover-alpha: 0.88;
  --img-shadow-alpha: 0.55;
  --img-shadow-hover-alpha: 0.75;
  --icon-img-glow: rgba(56, 189, 248, 0.30);
  --switcher-bg: rgba(12, 17, 28, 0.85);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --title-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 1px rgba(0, 0, 0, 0.9);
  --title-hover-color: #38bdf8;
  --title-hover-shadow: 0 0 10px rgba(56, 189, 248, 0.9), 0 1px 2px rgba(0, 0, 0, 0.95);
  --dot-color: #38bdf8;
  --dot-glow: rgba(56, 189, 248, 0.75);
}

[data-theme="emerald"] {
  --mask-color: #051311;
  --bg-overlay: radial-gradient(circle at 50% 20%, rgba(6, 40, 32, 0.50) 0%, rgba(5, 19, 17, 0.92) 100%);
  --theme-accent: #10b981;
  --theme-glow: rgba(16, 185, 129, 0.35);
  --icon-bg: rgba(8, 28, 24, 0.78);
  --icon-border: rgba(16, 185, 129, 0.28);
  --icon-border-top: rgba(255, 255, 255, 0.45);
  --icon-border-bottom: rgba(0, 0, 0, 0.65);
  --icon-glow-soft: rgba(16, 185, 129, 0.25);
  --icon-glow: rgba(16, 185, 129, 0.45);
  --icon-glow-intense: rgba(16, 185, 129, 0.85);
  --icon-specular: rgba(255, 255, 255, 0.55);
  --icon-shadow-alpha: 0.75;
  --icon-shadow-sub: 0.5;
  --icon-shadow-inner: 0.55;
  --icon-shadow-hover-alpha: 0.88;
  --img-shadow-alpha: 0.55;
  --img-shadow-hover-alpha: 0.75;
  --icon-img-glow: rgba(16, 185, 129, 0.30);
  --switcher-bg: rgba(6, 22, 19, 0.85);
  --text-main: #ecfdf5;
  --text-muted: #6ee7b7;
  --title-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 1px rgba(0, 0, 0, 0.9);
  --title-hover-color: #34d399;
  --title-hover-shadow: 0 0 10px rgba(16, 185, 129, 0.9), 0 1px 2px rgba(0, 0, 0, 0.95);
  --dot-color: #10b981;
  --dot-glow: rgba(16, 185, 129, 0.75);
}

[data-theme="sapphire"] {
  --mask-color: #0a0c1e;
  --bg-overlay: radial-gradient(circle at 50% 20%, rgba(20, 24, 60, 0.50) 0%, rgba(10, 12, 30, 0.92) 100%);
  --theme-accent: #6366f1;
  --theme-glow: rgba(99, 102, 241, 0.38);
  --icon-bg: rgba(18, 22, 50, 0.78);
  --icon-border: rgba(99, 102, 241, 0.28);
  --icon-border-top: rgba(255, 255, 255, 0.45);
  --icon-border-bottom: rgba(0, 0, 0, 0.65);
  --icon-glow-soft: rgba(99, 102, 241, 0.25);
  --icon-glow: rgba(99, 102, 241, 0.45);
  --icon-glow-intense: rgba(129, 140, 248, 0.85);
  --icon-specular: rgba(255, 255, 255, 0.55);
  --icon-shadow-alpha: 0.75;
  --icon-shadow-sub: 0.5;
  --icon-shadow-inner: 0.55;
  --icon-shadow-hover-alpha: 0.88;
  --img-shadow-alpha: 0.55;
  --img-shadow-hover-alpha: 0.75;
  --icon-img-glow: rgba(99, 102, 241, 0.30);
  --switcher-bg: rgba(12, 15, 36, 0.85);
  --text-main: #f5f7ff;
  --text-muted: #a5b4fc;
  --title-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 1px rgba(0, 0, 0, 0.9);
  --title-hover-color: #a5b4fc;
  --title-hover-shadow: 0 0 10px rgba(99, 102, 241, 0.9), 0 1px 2px rgba(0, 0, 0, 0.95);
  --dot-color: #818cf8;
  --dot-glow: rgba(129, 140, 248, 0.75);
}

/* 4. THEME PUTIH CERAH */
[data-theme="light"] {
  --mask-color: #f8fafc;
  --bg-overlay: radial-gradient(circle at 50% 20%, rgba(15, 23, 42, 0.62) 0%, rgba(2, 6, 23, 0.90) 100%);
  --theme-accent: #0284c7;
  --theme-glow: rgba(2, 132, 199, 0.40);
  --icon-bg: rgba(255, 255, 255, 0.92);
  --icon-border: rgba(15, 23, 42, 0.10);
  --icon-border-top: rgba(255, 255, 255, 1);
  --icon-border-bottom: rgba(15, 23, 42, 0.14);
  --icon-glow-soft: rgba(2, 132, 199, 0.22);
  --icon-glow: rgba(2, 132, 199, 0.40);
  --icon-glow-intense: rgba(14, 165, 233, 0.75);
  --icon-specular: rgba(255, 255, 255, 1);
  --icon-shadow-alpha: 0.14;
  --icon-shadow-sub: 0.08;
  --icon-shadow-inner: 0.05;
  --icon-shadow-hover-alpha: 0.24;
  --img-shadow-alpha: 0.18;
  --img-shadow-hover-alpha: 0.28;
  --icon-img-glow: rgba(2, 132, 199, 0.22);
  --switcher-bg: rgba(255, 255, 255, 0.95);
  --text-main: #0f172a;
  --text-muted: #475569;
  --title-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
  --title-hover-color: #0284c7;
  --title-hover-shadow: 0 0 12px rgba(14, 165, 233, 0.55), 0 1px 2px rgba(255, 255, 255, 0.95);
  --dot-color: #f59e0b;
  --dot-glow: rgba(245, 158, 11, 0.75);
}

[data-theme="light"] #tomcatBg {
  background-color: #0b0f19;
}

/* 5. THEME PINK (Pink Rose / Cyber Rose) */
[data-theme="pink"] {
  --mask-color: #170716;
  --bg-overlay: radial-gradient(circle at 50% 20%, rgba(56, 12, 45, 0.52) 0%, rgba(23, 7, 22, 0.93) 100%);
  --theme-accent: #f43f5e;
  --theme-glow: rgba(244, 63, 94, 0.42);
  --icon-bg: rgba(36, 10, 32, 0.78);
  --icon-border: rgba(244, 63, 94, 0.28);
  --icon-border-top: rgba(255, 255, 255, 0.45);
  --icon-border-bottom: rgba(0, 0, 0, 0.65);
  --icon-glow-soft: rgba(244, 63, 94, 0.25);
  --icon-glow: rgba(236, 72, 153, 0.45);
  --icon-glow-intense: rgba(244, 63, 94, 0.85);
  --icon-specular: rgba(255, 255, 255, 0.55);
  --icon-shadow-alpha: 0.75;
  --icon-shadow-sub: 0.5;
  --icon-shadow-inner: 0.55;
  --icon-shadow-hover-alpha: 0.88;
  --img-shadow-alpha: 0.55;
  --img-shadow-hover-alpha: 0.75;
  --icon-img-glow: rgba(244, 63, 94, 0.32);
  --switcher-bg: rgba(28, 8, 24, 0.85);
  --text-main: #fff1f2;
  --text-muted: #fda4af;
  --title-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 1px rgba(0, 0, 0, 0.9);
  --title-hover-color: #fb7185;
  --title-hover-shadow: 0 0 10px rgba(244, 63, 94, 0.9), 0 1px 2px rgba(0, 0, 0, 0.95);
  --dot-color: #ec4899;
  --dot-glow: rgba(236, 72, 153, 0.85);
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--mask-color);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  transition: background-color 0.35s ease;
}

/* Background image revealed underneath smoke mask */
#tomcatBg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--mask-color);
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: opacity;
}

.bg-layer.active {
  opacity: 1;
}

.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--bg-overlay);
  transition: background-image 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

/* Top mask canvas for silky smoke/ink carve */
#tomcatMask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: block;
}

@media (hover: none), (pointer: coarse) {
  #tomcatMask {
    display: none !important;
  }
}

/* Container */
.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========================================================
   HEADER & 3D SINGLE THEME DOT TOGGLE (Kanan Atas)
   ======================================================== */
.top-bar {
  width: 100%;
  max-width: 1360px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 36px;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--switcher-bg);
  border: 1px solid var(--icon-border);
  border-top: 1px solid var(--icon-border-top);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  outline: none;
  box-shadow: 
    0 8px 20px -4px rgba(0, 0, 0, var(--icon-shadow-alpha)),
    0 0 16px var(--icon-glow-soft),
    inset 0 1px 2px var(--icon-specular);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-btn:hover {
  transform: scale(1.12) translateY(-1px);
  border-color: var(--theme-accent);
  box-shadow: 
    0 12px 24px -4px rgba(0, 0, 0, var(--icon-shadow-hover-alpha)),
    0 0 25px var(--dot-color),
    inset 0 1px 2px var(--icon-specular);
}

.theme-toggle-btn:active {
  transform: scale(0.92) translateY(1px);
}

/* 1 Titik Berwarna 3D Spherical Glow */
.theme-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--dot-color);
  box-shadow: 
    0 0 12px var(--dot-color),
    0 0 24px var(--dot-glow),
    inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.4),
    inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.85);
  transition: background-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================================
   HEIMDALL 3D FLOATING ICONS (CENTERED & BALANCED)
   ======================================================== */
.grid-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 36px 24px;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
}

/* App Tile: CLEAN & BORDERLESS (Zero Outer Box, Centered) */
.app-tile {
  width: 130px;
  flex: 0 0 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 10px 6px;
  gap: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  text-decoration: none;
  color: var(--text-main);
  transform-style: preserve-3d;
  perspective: 900px;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ========================================================
   APPLE-STYLE SILKY FLOATING ELEVATION (OPTION 1)
   Zero aggressive tilting / zero jitter, graceful lift & glowing bloom
   ======================================================== */
.app-icon-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
    
  transform: translateY(0) scale(1);
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* Soft, Organic Radial Neon Bloom Behind Floating Icon (Silky Expansion) */
.app-icon-wrap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%) scale(0.9);
  border-radius: 50%;
  background: radial-gradient(circle, var(--theme-accent) 0%, var(--theme-glow) 45%, transparent 72%);
  opacity: 0.12;
  filter: blur(12px);
  z-index: -1;
  will-change: opacity, transform;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.35s ease;
  pointer-events: none;
}

/* Hover: Graceful Floating Lift (Apple macOS Elevation) */
.app-tile:hover .app-icon-wrap {
  transform: translateY(-8px) scale(1.08);
}

.app-tile:hover .app-icon-wrap::before {
  opacity: 0.78;
  transform: translate(-50%, -50%) scale(1.42);
  filter: blur(15px);
}

.app-tile:active .app-icon-wrap {
  transform: translateY(-2px) scale(0.96) !important;
  transition-duration: 0.12s;
}

/* Pure Floating 3D Logo / Icon with Smooth Soft Drop Shadow */
.app-icon {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  will-change: transform, filter;
  transition: filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.app-tile:hover .app-icon {
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.75));
}

/* Title Label Under Icon - PIN SHARP & CRISP TYPOGRAPHY */
.app-title {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 136px;
  text-align: center;
  text-shadow: var(--title-shadow);
  transform: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.app-tile:hover .app-title {
  color: var(--title-hover-color);
  text-shadow: var(--title-hover-shadow);
  transform: none !important;
}

/* ========================================================
   RESPONSIVENESS (Mobile, Tablet, Desktop)
   ======================================================== */
@media (max-width: 1024px) {
  .app-grid {
    gap: 30px 18px;
    max-width: 980px;
  }
  .app-tile {
    width: 120px;
    flex: 0 0 120px;
  }
  .app-icon-wrap {
    width: 68px;
    height: 68px;
  }
  .app-icon-wrap::before {
    width: 70px;
    height: 70px;
  }
  .app-icon {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 24px 14px 48px;
  }
  .top-bar {
    margin-bottom: 24px;
  }
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }
  .theme-dot {
    width: 13px;
    height: 13px;
  }
  .app-grid {
    gap: 22px 12px;
  }
  .app-tile {
    width: 102px;
    flex: 0 0 102px;
    gap: 10px;
    padding: 8px 4px;
  }
  .app-icon-wrap {
    width: 58px;
    height: 58px;
  }
  .app-icon-wrap::before {
    width: 60px;
    height: 60px;
  }
  .app-icon {
    width: 48px;
    height: 48px;
  }
  .app-title {
    font-size: 12px;
    max-width: 102px;
  }
}

@media (max-width: 360px) {
  .app-grid {
    gap: 16px 8px;
  }
  .app-tile {
    width: 92px;
    flex: 0 0 92px;
  }
  .app-icon-wrap {
    width: 50px;
    height: 50px;
  }
  .app-icon-wrap::before {
    width: 52px;
    height: 52px;
  }
  .app-icon {
    width: 40px;
    height: 40px;
  }
  .app-title {
    font-size: 11px;
    max-width: 92px;
  }
}
