* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ground-color: #7bed9f;
  --tree-color: #555;
  --tower-color: #555;
  --house-color: #f0d9b5;
  --roof-color: #c0392b;
  --moon-base: #d0cdae;
  --moon-shadow: #8f8c73;
  --sun-bg: #f1c40f;
  --sun-shadow: 0 0 20px #f1c40f, 0 0 60px #f39c12;
  --cloud-color: #ffffff;
  --bird-color: #333;
  --window-light: #f1c40f;
  --tower-light-color: #2c3e50;
  /* Variabel Bayangan Bintang (Diisi JS) */
  --star-s-shadow: none;
  --star-m-shadow: none;
}

body {
  font-family: "Clear Sans", sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  background-color: #fff;
  color: #000;
  transition:
    background 1.5s ease,
    color 1.5s ease;
  position: relative;
}

/* Time Theme */
body.pagi {
  background: linear-gradient(180deg, #a1c4fd 0%, #c2e9fb 100%);
  color: #2c3e50;
  --ground-color: #96ceb4;
  --tree-color: #588157;
  --tower-color: #95a5a6;
  --house-color: #fdf4dc;
  --roof-color: #d98e73;
  --cloud-color: #ffffff;
  --tower-light-color: #bdc3c7;
  --sun-bg: #ffdf7d;
  --sun-shadow:
    0 0 25px #ffca28, 0 0 50px rgba(255, 167, 38, 0.6),
    0 0 80px rgba(255, 235, 59, 0.3);
  --bird-color: #4a5568;
}
body.siang {
  background: linear-gradient(180deg, #4facfe 0%, #70e1f5 100%);
  color: #000;
  --ground-color: #4cd137;
  --tree-color: #009432;
  --tower-color: #666f70;
  --house-color: #f39c12;
  --roof-color: #c0392b;
  --cloud-color: #ffffff;
  --tower-light-color: #95a5a6;
  --sun-bg: #fff9c4;
  --sun-shadow:
    0 0 35px #fff9c4, 0 0 80px rgba(255, 235, 59, 0.9),
    0 0 150px rgba(255, 255, 255, 0.8);
  --bird-color: #2d3436;
}
body.sore {
  background: linear-gradient(180deg, #fa709a 0%, #fee140 100%);
  color: #4a2c2c;
  --ground-color: #252629;
  --tree-color: #4a2c2c;
  --tower-color: #4a2c2c;
  --house-color: #5d4037;
  --roof-color: #3e2723;
  --cloud-color: #ffe3e3;
  --tower-light-color: #f1c40f;
  --sun-bg: #fe7045;
  --sun-shadow:
    0 0 25px #ff5722, 0 0 60px rgba(187, 66, 29, 0.8),
    0 0 100px rgba(255, 87, 34, 0.5);
  --bird-color: #4a2c2c;
}
body.malam {
  background: linear-gradient(180deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  color: #fff;
  --ground-color: #1e272e;
  --tree-color: #0a0a0a;
  --tower-color: #121212;
  --house-color: #1c1c1c;
  --roof-color: #000000;
  --cloud-color: #2c3e50;
  --tower-light-color: #f1c40f;
  --bird-color: #000;
}

/* Sky */
.sky-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sun-mover {
  position: absolute;
  top: 15%;
  left: -10vw;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.5s ease;
}
body.pagi .sun-mover,
body.siang .sun-mover,
body.sore .sun-mover {
  opacity: 1;
  animation: moveSunAcrossSky 200s linear infinite;
}
.realistic-sun {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--sun-bg);
  box-shadow: var(--sun-shadow);
  transition:
    background 2s ease,
    box-shadow 2s ease;
}
@keyframes moveSunAcrossSky {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(130vw);
  }
}

/* Moon */
.moon-mover {
  position: absolute;
  top: 15%;
  left: -10%;
  z-index: 2;
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}
body.malam .moon-mover {
  opacity: 1;
  animation: moveMoonAcrossSky 300s linear infinite;
}
.realistic-moon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--moon-base);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 10px 2px var(--moon-base),
    0 0 30px 5px rgba(208, 205, 174, 0.4);
  transition: box-shadow 1s ease;
}
.realistic-moon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0.6;
  background-image:
    radial-gradient(circle at 30% 40%, var(--moon-shadow) 0%, transparent 15%),
    radial-gradient(circle at 70% 60%, var(--moon-shadow) 0%, transparent 20%);
  background-size: 100% 100%;
}
.moon-phase-shadow {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 50%;
  background-color: transparent;
  box-shadow: inset 0px 0px 0 0 rgba(0, 0, 0, 0.8);
  transition: box-shadow 1s ease;
  z-index: 2;
}
.moon-new {
  opacity: 0.2 !important;
  box-shadow: none !important;
}
@keyframes moveMoonAcrossSky {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(130vw);
  }
}

/* Stars */
.stars-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 2s ease;
  z-index: 1;
}
body.malam .stars-wrapper {
  opacity: 1;
}
.star-layer {
  border-radius: 50%;
  background: transparent;
}
.star-s {
  width: 1px;
  height: 1px;
  box-shadow: var(--star-s-shadow);
  animation: animStar 150s linear infinite;
}
.star-s:after {
  content: " ";
  position: absolute;
  top: 100vh;
  width: 1px;
  height: 1px;
  background: transparent;
  box-shadow: var(--star-s-shadow);
}
.star-m {
  width: 2px;
  height: 2px;
  box-shadow: var(--star-m-shadow);
  animation: animStar 250s linear infinite;
}
.star-m:after {
  content: " ";
  position: absolute;
  top: 100vh;
  width: 2px;
  height: 2px;
  background: transparent;
  box-shadow: var(--star-m-shadow);
}
@keyframes animStar {
  from {
    transform: translateY(0px);
  }
  to {
    transform: translateY(-100vh);
  }
}

/* Shooting Star*/
.shooting-stars-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateZ(45deg);
  z-index: 1;
  opacity: 0;
}
body.malam .shooting-stars-wrapper {
  opacity: 1;
}
.shooting-star {
  position: absolute;
  height: 2px;
  background: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 1),
    rgba(0, 0, 255, 0)
  );
  border-radius: 999px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
  animation:
    tail 3s ease-in-out infinite,
    shooting 3s ease-in-out infinite;
  opacity: 0;
  width: 0;
}
@keyframes tail {
  0% {
    width: 0;
  }
  30% {
    width: 100px;
  }
  100% {
    width: 0;
  }
}
@keyframes shooting {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(300px);
    opacity: 0;
  }
}

/* Clouds */
.clouds-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 3;
  overflow: hidden;
  opacity: 1;
  transition: opacity 2s ease;
}
body.malam .clouds-container {
  opacity: 0.3;
}
.cloud {
  position: absolute;
  background: var(--cloud-color);
  border-radius: 200px;
  opacity: 0.8;
  transition: background-color 1.5s ease;
  animation: floatCloud linear infinite;
}
.cloud::after,
.cloud::before {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 200px;
}
.cloud-v1 {
  width: 120px;
  height: 40px;
}
.cloud-v1::after {
  width: 50px;
  height: 50px;
  top: -25px;
  left: 20px;
}
.cloud-v1::before {
  width: 60px;
  height: 60px;
  top: -35px;
  right: 20px;
}
.cloud-v2 {
  width: 110px;
  height: 45px;
}
.cloud-v2::after {
  width: 70px;
  height: 70px;
  top: -30px;
  left: 10px;
}
.cloud-v2::before {
  width: 40px;
  height: 40px;
  top: -15px;
  right: 15px;
}
.cloud-v3 {
  width: 130px;
  height: 35px;
}
.cloud-v3::after {
  width: 40px;
  height: 40px;
  top: -20px;
  left: 15px;
}
.cloud-v3::before {
  width: 65px;
  height: 65px;
  top: -30px;
  right: 10px;
}
@keyframes floatCloud {
  from {
    transform: translateX(-200px);
  }
  to {
    transform: translateX(120vw);
  }
}
@keyframes floatCloudReverse {
  from {
    transform: translateX(120vw);
  }
  to {
    transform: translateX(-200px);
  }
}

/* Birds */
.birds-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.5s ease;
}
body.malam .birds-container {
  opacity: 0;
}
.bird {
  position: absolute;
  width: 16px;
  height: 8px;
  animation: flyAcross 30s linear infinite;
}
.bird-wing-left,
.bird-wing-right {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 2px;
  background-color: var(--bird-color);
  border-radius: 2px;
  transition: background-color 1.5s ease;
}
.bird-wing-left {
  left: 0;
  transform-origin: right center;
  animation: wingFlapL 0.4s infinite alternate linear;
}
.bird-wing-right {
  right: 0;
  transform-origin: left center;
  animation: wingFlapR 0.4s infinite alternate linear;
}
@keyframes wingFlapL {
  from {
    transform: rotate(-25deg);
  }
  to {
    transform: rotate(10deg);
  }
}
@keyframes wingFlapR {
  from {
    transform: rotate(25deg);
  }
  to {
    transform: rotate(-10deg);
  }
}
@keyframes flyAcross {
  from {
    left: -50px;
  }
  to {
    left: 110%;
  }
}

/* App */
.sidebar {
  width: 200px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  z-index: 10;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.menu-item:hover {
  transform: scale(1.05);
}
.icon-box {
  width: 60px;
  height: 60px;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 1.2rem;
  border-radius: 15px;
}
.menu-label {
  font-size: 13px;
  font-weight: 500;
}

.icon-box a i {
  color: #000;
}

body.malam .icon-box a i {
  color: #ffffff;
}

/* Center Content*/
.center-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.clock-container {
  text-align: center;
  margin-bottom: 80px;
}
.time-wrapper {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}
.clock {
  font-family: "DS-Digital", sans-serif;
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0;
  letter-spacing: 2px;
}
.wib-label {
  font-family: "Inter", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: inherit;
}
.date-display {
  font-family: "Clear Sans", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}

/* Landscape & Village */
.right-content {
  flex: 1.2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 40px;
  z-index: 10;
}
.main-frame {
  width: 100%;
  height: 75%;
  max-width: 600px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.village-container {
  display: flex;
  align-items: flex-end;
  position: relative;
  bottom: 55px;
  width: 100%;
  justify-content: center;
  padding: 0 10px;
  height: auto;
  overflow: visible;
}

.tree,
.house,
.tower-structure {
  position: relative;
  bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 3px;
}
.house {
  margin: 0 4px;
}
.tower-structure {
  margin: 0 5px;
  z-index: 8;
  bottom: 0;
}

.tree-top {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 25px solid var(--tree-color);
  margin-bottom: -10px;
  z-index: 2;
  transition: border-bottom-color 1.5s ease;
}
.tree-mid {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 35px solid var(--tree-color);
  margin-bottom: -10px;
  z-index: 1;
  transition: border-bottom-color 1.5s ease;
}
.tree-trunk {
  width: 6px;
  height: 10px;
  background-color: #3e2723;
  transition: background-color 1.5s ease;
}
body.malam .tree-trunk {
  background-color: var(--tree-color);
}
.roof {
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-bottom: 25px solid var(--roof-color);
  position: relative;
  top: 1px;
  transition: border-bottom-color 1.5s ease;
}
.house.main .roof::before {
  content: "";
  position: absolute;
  top: 5px;
  right: -20px;
  width: 6px;
  height: 12px;
  background-color: var(--roof-color);
  transition: background-color 1.5s ease;
}
.walls {
  width: 40px;
  height: 30px;
  background-color: var(--house-color);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 1.5s ease;
}
.window {
  width: 6px;
  height: 9px;
  background-color: #444;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: background-color 1.5s ease;
}
body.malam .window,
body.sore .window {
  background-color: var(--window-light);
  box-shadow: 0 0 5px var(--window-light);
}
.tower-top-piece {
  width: 0;
  height: 0;
  border-left: 45px solid transparent;
  border-right: 45px solid transparent;
  border-bottom: 55px solid var(--tower-color);
  transition: all 1.5s ease;
  z-index: 2;
}
.tower-body-piece {
  width: 60px;
  height: 45px;
  background-color: var(--tower-color);
  display: flex;
  justify-content: center;
  padding-top: 10px;
  transition: all 1.5s ease;
  position: relative;
}
.tower-bottom-piece {
  width: 90px;
  height: 20px;
  background-color: var(--tower-color);
  display: flex;
  justify-content: center;
  padding-top: 5px;
  transition: all 1.5s ease;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.tower-light-piece {
  width: 10px;
  height: 15px;
  background-color: var(--tower-light-color);
  border-radius: 20px 20px 0 0;
  transition: all 1.5s ease;
}
body.malam .tower-light-piece,
body.sore .tower-light-piece {
  box-shadow: 0 0 15px var(--tower-light-color);
}

.landscape-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 180px;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.hill {
  position: absolute;
  bottom: -50px;
  left: -20%;
  width: 150%;
  height: 180px;
  background-color: var(--ground-color);
  border-radius: 50% 50% 0 0;
  transition: background-color 1.5s ease;
}
.hill-2 {
  position: absolute;
  bottom: -60px;
  right: -10%;
  width: 100%;
  height: 140px;
  background-color: var(--ground-color);
  border-radius: 50% 50% 0 0;
  opacity: 0.8;
  transition: background-color 1.5s ease;
}
.copyright-text {
  position: absolute;
  bottom: 40px;
  width: 100%;
  text-align: center;
  color: rgb(255, 255, 255);
  font-size: 12px;
  font-weight: 600;
  z-index: 20;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    padding: 20px;
  }
  .menu-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
  .icon-box {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .menu-label {
    display: none;
  }
  .center-content {
    padding: 20px 0;
  }
  .clock {
    font-size: 4rem;
  }
  .wib-label {
    font-size: 1rem;
  }
  .date-display {
    font-size: 0.9rem;
  }
  .right-content {
    padding: 10px;
    align-items: center;
  }
  .main-frame {
    height: 250px;
    align-items: flex-end;
  }
  .landscape-container {
    height: 100px;
    position: fixed;
    bottom: 0;
  }
  .hill {
    height: 100px;
    bottom: -40px;
  }
  .realistic-moon {
    width: 50px;
    height: 50px;
  }

  .village-container {
    width: 100%;
    bottom: 20px;
    transform-origin: bottom center;
    transform: scale(0.65);
    overflow: visible;
    justify-content: center;
    left: 0;
  }
  .copyright-text {
    right: 0;
    bottom: 17px;
    width: 100%;
    text-align: center;
  }
}
