/**
 * SIRIUS OS 2026 - ELEMENTARY OS 5.1 HERA (PANTHEON DESKTOP) STYLESHEET
 * Creator & Development : Alfian Ananda (162331) • Copyright 2026
 */

:root {
  --hera-blueberry: #3689e6;
  --hera-blueberry-dark: #0d52bf;
  --hera-strawberry: #c6262e;
  --hera-banana: #f9c440;
  --hera-lime: #68b723;
  --hera-slate: #273445;
  --hera-headerbar: linear-gradient(180deg, #fafafa 0%, #eaeaea 100%);
  --hera-popover-bg: rgba(250, 250, 252, 0.96);
  --hera-popover-border: rgba(0, 0, 0, 0.22);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --hera-curve: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, select {
  user-select: text;
  -webkit-user-select: text;
}

/* =========================================================================
   1. WALLPAPER ELEMENTARY OS 5.1 HERA (ASHIM D'SILVA / MOUNTAIN DUSK STYLE)
   ========================================================================= */
body {
  font-family: 'Inter', 'Open Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #141923;
  background-image:
    radial-gradient(circle at 50% 18%, rgba(243, 156, 107, 0.34) 0%, rgba(196, 98, 138, 0.22) 28%, transparent 62%),
    radial-gradient(circle at 18% 35%, rgba(54, 137, 230, 0.28) 0%, transparent 50%),
    radial-gradient(circle at 85% 40%, rgba(114, 87, 165, 0.28) 0%, transparent 52%),
    linear-gradient(180deg,
      #162238 0%,
      #273859 24%,
      #4a4e69 48%,
      #845ec2 65%,
      #d65db1 78%,
      #ff9671 88%,
      #1b202b 100%
    );
  color: #1e293b;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* Siluet Pegunungan Berlapis Khas Wallpaper Elementary OS 5.1 Hera */
.hera-wallpaper-mountains {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hera-wallpaper-mountains::before {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 44%;
  background: linear-gradient(180deg, rgba(28, 35, 51, 0.72) 0%, rgba(15, 20, 30, 0.95) 100%);
  clip-path: polygon(0% 48%, 16% 24%, 33% 42%, 52% 14%, 71% 38%, 88% 20%, 100% 36%, 100% 100%, 0% 100%);
}

.hera-wallpaper-mountains::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 32%;
  background: linear-gradient(180deg, #121722 0%, #090c12 100%);
  clip-path: polygon(0% 56%, 22% 28%, 41% 52%, 64% 22%, 82% 46%, 100% 25%, 100% 100%, 0% 100%);
}

/* =========================================================================
   2. WINGPANEL (ELEMENTARY OS TOP BAR)
   ========================================================================= */
#top-header-bar {
  height: calc(30px + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: max(0.75rem, calc(var(--safe-left) + 0.75rem));
  padding-right: max(0.75rem, calc(var(--safe-right) + 0.75rem));
  background: linear-gradient(180deg, rgba(16, 20, 28, 0.82) 0%, rgba(16, 20, 28, 0.56) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  transition: background 0.2s ease;
}

body.app-open-mode #top-header-bar {
  background: #1a1e24;
  border-bottom: 1px solid #0f1318;
}

.wingpanel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  transition: background 0.15s ease, transform 0.12s ease;
  cursor: pointer;
}

.wingpanel-btn:hover,
.wingpanel-btn.active {
  background: rgba(255, 255, 255, 0.16);
}

.wingpanel-btn:active {
  transform: scale(0.96);
}

/* =========================================================================
   3. GRANITE POPOVER (SLINGSHOT LAUNCHER & CALENDAR POPOVER)
   ========================================================================= */
.hera-popover {
  background: var(--hera-popover-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--hera-popover-border);
  border-radius: 8px;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: #273445;
}

.hera-popover-arrow-left::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 26px;
  width: 14px;
  height: 14px;
  background: #fafafc;
  border-left: 1px solid var(--hera-popover-border);
  border-top: 1px solid var(--hera-popover-border);
  transform: rotate(45deg);
}

.hera-popover-arrow-center::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  margin-left: -7px;
  width: 14px;
  height: 14px;
  background: #fafafc;
  border-left: 1px solid var(--hera-popover-border);
  border-top: 1px solid var(--hera-popover-border);
  transform: rotate(45deg);
}

/* =========================================================================
   4. DESKTOP WORKSPACE & ICON TILES
   ========================================================================= */
#home-view {
  padding-bottom: calc(5.8rem + var(--safe-bottom));
}

.hera-desktop-card {
  background: rgba(18, 24, 36, 0.56);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

#springboard-viewport,
#library-viewport,
.springboard-tile,
.lib-grid-tile,
.folder-app-tile {
  touch-action: none;
}

#app-grid,
#library-grid {
  will-change: transform;
  transition: transform 0.2s var(--hera-curve), opacity 0.2s ease;
}

.app-squircle {
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease, background 0.18s ease;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.app-squircle:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(54, 137, 230, 0.55);
}

.app-squircle:active {
  transform: scale(0.92);
}

/* Label Ikon di Desktop (Putih dengan Drop Shadow Tajam ala Linux Desktop) */
.desktop-icon-label {
  display: block;
  width: 100%;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92), 0 0 6px rgba(0, 0, 0, 0.65);
}

/* Label Ikon di dalam Slingshot / Folder (Gelap di atas latar terang) */
.slingshot-icon-label {
  display: block;
  width: 100%;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
  color: #273445;
}

/* =========================================================================
   5. PLANK DOCK (ELEMENTARY OS BOTTOM GLASS DOCK)
   ========================================================================= */
#bottom-dock-wrapper {
  bottom: max(0.35rem, calc(var(--safe-bottom) + 0.2rem));
}

.sirius-plank-dock {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(226, 232, 240, 0.14) 100%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  touch-action: none;
}

.plank-item {
  transition: transform 0.2s var(--spring);
}

.plank-item:hover {
  transform: translateY(-7px) scale(1.15);
}

.plank-item:active {
  transform: translateY(-2px) scale(0.95);
}

.plank-running-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #64baff;
  box-shadow: 0 0 6px #3689e6, 0 0 10px #64baff;
}

/* =========================================================================
   6. GRANITE / GTK+ WINDOW MANAGER (ELEMENTARY HERA WINDOW)
   ========================================================================= */
#os-window {
  top: calc(30px + var(--safe-top));
  bottom: 0;
  left: 0;
  right: 0;
  transition: opacity 0.18s ease, transform 0.2s var(--hera-curve);
  will-change: opacity, transform;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.45);
}

.hera-gtk-headerbar {
  height: 38px;
  background: linear-gradient(180deg, #f7f7f7 0%, #e4e4e7 100%);
  border-bottom: 1px solid #b4b4b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #273445;
  padding: 0 10px;
}

.hera-win-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3f3f46;
  border: 1px solid transparent;
  transition: all 0.14s ease;
  cursor: pointer;
}

.hera-win-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

.hera-win-btn-close:hover {
  background: #e11d48;
  border-color: #be123c;
  color: #ffffff;
}

.window-minimized {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.96);
  pointer-events: none;
  visibility: hidden;
}

.window-maximized {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

/* Mode Fullscreen Jendela (Sembunyikan Wingpanel Atas saat di-toggle) */
body.hera-window-fullscreen #os-window {
  top: var(--safe-top);
}

/* =========================================================================
   7. ANIMASI JIGGLE, SHATTER, SWIPE & MODALGRANITE
   ========================================================================= */
@keyframes iosJiggle {
  0% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.8deg); }
  100% { transform: rotate(-1.8deg); }
}
.jiggle-active {
  animation: iosJiggle 0.28s ease-in-out infinite;
}

@keyframes tileImplode {
  0% { transform: scale(1); filter: brightness(1); opacity: 1; }
  30% { transform: scale(1.14) rotate(4deg); filter: brightness(1.35); opacity: 0.9; }
  100% { transform: scale(0.15) rotate(-12deg); opacity: 0; }
}
.tile-shattering {
  pointer-events: none !important;
  animation: tileImplode 0.26s cubic-bezier(0.36, 0, 0.66, -0.56) forwards !important;
}

.shatter-shard {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  will-change: transform, opacity;
  box-shadow: 0 4px 10px rgba(54, 137, 230, 0.35);
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.52s ease-out;
}

@keyframes swipeSlideLeft {
  0% { opacity: 0.5; transform: translate3d(32px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes swipeSlideRight {
  0% { opacity: 0.5; transform: translate3d(-32px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
.page-anim-left {
  animation: swipeSlideLeft 0.18s var(--hera-curve) forwards;
}
.page-anim-right {
  animation: swipeSlideRight 0.18s var(--hera-curve) forwards;
}

.empty-slot-guide {
  border: 1.5px dashed rgba(100, 186, 255, 0.45);
  background: rgba(54, 137, 230, 0.14);
  border-radius: 16px;
}

.slot-drop-highlight {
  border: 2px solid #64baff !important;
  background: rgba(54, 137, 230, 0.35) !important;
  transform: scale(1.04);
  border-radius: 16px;
}

.folder-merge-target .app-squircle {
  transform: scale(1.14) !important;
  box-shadow: 0 0 0 3px #3689e6 !important;
}

#sirius-assistive {
  transition: transform 0.28s var(--hera-curve), opacity 0.22s ease;
  touch-action: none;
}
.assistive-right-hidden {
  right: 0px;
  left: auto;
  transform: translate3d(calc(100% - 26px), 0, 0);
  opacity: 0.78;
}
.assistive-right-open {
  right: 0px;
  left: auto;
  transform: translate3d(0, 0, 0);
  opacity: 1;
}
.assistive-left-hidden {
  left: 0px;
  right: auto;
  transform: translate3d(calc(-100% + 26px), 0, 0);
  opacity: 0.78;
}
.assistive-left-open {
  left: 0px;
  right: auto;
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

#drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-50%, -50%, 0) scale(1.12);
  transition: none;
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.95) translateY(-6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-modal-pop {
  animation: modalPop 0.18s var(--hera-curve) forwards;
}

.swal2-popup.sirius-swal {
  background: #fafafc !important;
  border: 1px solid rgba(0, 0, 0, 0.22) !important;
  border-radius: 12px !important;
  color: #1e293b !important;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38) !important;
}

.admin-scrollable {
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* Responsivitas Tinggi Layar Kecil (Mobile / Laptop Compact) */
@media (max-height: 820px) {
  #home-view {
    padding-bottom: calc(5.2rem + var(--safe-bottom)) !important;
  }
  #app-grid,
  #library-grid {
    gap: 0.45rem 0.45rem !important;
  }
  #app-grid .app-squircle,
  #library-grid .app-squircle {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 14px !important;
  }
}

@media (max-height: 700px) {
  .springboard-slot {
    min-height: 68px !important;
  }
  #app-grid,
  #library-grid {
    gap: 0.35rem 0.4rem !important;
  }
  #library-grid .app-squircle,
  #app-grid .app-squircle {
    width: 2.7rem !important;
    height: 2.7rem !important;
    border-radius: 12px !important;
    padding: 0.32rem !important;
  }
  .desktop-icon-label,
  .slingshot-icon-label {
    font-size: 9.5px !important;
    margin-top: 2px !important;
  }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(54, 137, 230, 0.45); border-radius: 9999px; }
