/* SIDEBAR ICON */
:root {
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.35);
  outline-offset: 2px;
}

/* BRAND */
.site-header {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 76px;
}

.site-logos {
  grid-column: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.site-logo--campus {
  width: 44px;
  height: 44px;
}

.site-logo--campus img,
.site-logo--partner img {
  display: block;
  object-fit: contain;
}

.site-logo--campus img {
  width: 100%;
  height: 100%;
}

.site-logo--partner img {
  width: clamp(120px, 13vw, 150px);
  height: auto;
  max-height: 36px;
}

.site-title {
  grid-column: 2;
  max-width: min(34vw, 260px);
  color: inherit;
  justify-self: center;
  text-align: center;
}

.site-title h1 {
  margin: 0;
  color: #374151;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.site-actions {
  grid-column: 3;
  flex: 0 0 auto;
  justify-self: end;
}

.sidebar-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: 0.25s;
  color: #9ca3af;
}

.sidebar-icon:hover {
  background: #22c55e;
  color: white;
}

.sidebar-icon.active {
  background: linear-gradient(to top right, #22c55e, #10b981);
  color: white;
  box-shadow: 0 6px 15px rgba(34, 197, 94, 0.35);
}

/* MOBILE NAV */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 1px solid #e5e7eb;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 50;
  display: none; /* default hidden */
}
.search-input {
  width: 20rem;
}

/* MOBILE ICON */
.nav-mobile {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 18px;
  color: #9ca3af;
  transition: 0.25s;
}

.nav-mobile:hover {
  background: #22c55e;
  color: white;
  transform: translateY(-2px);
}

.nav-mobile.active {
  background: linear-gradient(to top right, #22c55e, #10b981);
  color: white;
  box-shadow: 0 6px 15px rgba(34, 197, 94, 0.35);
}

/* cuaca */

#weatherCard * {
  transition: all 0.4s ease;
}

#weatherIcon i {
  transition: all 0.4s ease;
}

.icon-sun {
  animation: sunPulse 2s infinite;
}
@keyframes sunPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* CLOUD */
.icon-cloud {
  opacity: 0.9;
}

/* CLOUD SUN */
.icon-cloud-sun {
  animation: float 3s ease-in-out infinite;
}

/* RAIN */
.icon-rain {
  animation: rainBounce 1.5s infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes rainBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

#weatherCard span,
#weatherCard h1 {
  transition: opacity 0.3s ease;
}

/* dashboard */
/* gauge */
.gauge-wrapper {
  position: relative;
}

/* WAJIB: biar SVG masuk penuh */
#gauge {
  width: 100%;
  height: 100%;
}

/* GAUGE STYLE */
.gauge-wrapper .dial {
  stroke: #dadadc;
  stroke-width: 7;
}

.gauge-wrapper .value {
  stroke: #22c55e;
  stroke-width: 7;
}

.gauge-wrapper .value-text {
  fill: #22c55e;
  font-size: 16px;
  font-weight: bold;
}

/* thermometer */
#termometer {
  width: 22px;
  height: 129px;
  position: relative;
  background: #f1f1f1;
  border: 3px solid #333;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* BULB BAWAH */
#termometer::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -20px;
  width: 50px;
  height: 50px;
  background: red;
  border: 3px solid #333;
  border-radius: 50%;
}

/* ISI MERAH */
#temperature {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: red;
  border-radius: 10px;
  transition: height 0.5s ease;
}

.text-temp {
  font-family: "Science Gothic", sans-serif;
}

/* TOOLTIP */
#temperature::before {
  content: attr(data-value);

  position: absolute;

  left: -45px;
  right: auto;

  top: -10px;

  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 4px;
}

/* GARIS GRADUASI */
#graduations {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 60%;
  top: 20%;
  border-top: 1px solid rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

#graduations::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 40%;
  top: 30%;
  border-top: 1px solid rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

.text-ph {
  font-family: "Science Gothic", sans-serif;
}

/* home */
.hero-media-frame {
  background: #0f172a url("../assets/hero-poster.webp") center / cover no-repeat;
  contain: paint;
}

.hero-video {
  opacity: 0;
  transform: translateZ(0) scale(1.1);
  transition: opacity 0.45s ease;
  will-change: opacity;
}

.hero-video.is-ready {
  opacity: 1;
}

.pwa-install {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0);
  pointer-events: none;
  transition: background 0.22s ease;
}

.pwa-install.is-visible {
  background: rgba(15, 23, 42, 0.36);
  pointer-events: auto;
}

.pwa-install__panel {
  position: relative;
  width: min(100%, 420px);
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  transform: translateY(28px);
  opacity: 0;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
}

.pwa-install.is-visible .pwa-install__panel {
  transform: translateY(0);
  opacity: 1;
}

.pwa-install__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 34px;
}

.pwa-install__icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #dcfce7;
}

.pwa-install__icon img {
  display: block;
}

.pwa-install h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.pwa-install p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.pwa-install__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.pwa-install__primary,
.pwa-install__secondary,
.pwa-install__close {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.pwa-install__primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: #16a34a;
  font-size: 14px;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.pwa-install__primary:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.pwa-install__secondary {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: #475569;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 700;
}

.pwa-install__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #64748b;
  background: transparent;
}

.pwa-install__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

@keyframes zoomSlow {
  0% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1.1);
  }
}

/* gambar jalan */
/* Infinite Icon Carousel */
.icons-marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.icons-marquee {
  display: flex;
  align-items: center;
  gap: 5rem;
  animation: scroll-left 25s linear infinite;
  width: max-content;
}

@keyframes scroll-left {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .icons-marquee {
    gap: 2rem;
  }

  .icons-marquee i {
    font-size: 2.5rem !important;
  }
}

/* sensors */
/* nitrogen */
.gauge-container.four {
  position: relative;
  width: 160px;
  height: 110px;
}

/* Paksa gauge SVG masuk container */
.gauge-container,
.gauge-container svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.gauge-nitrogen > .gauge .dial {
  stroke: #e5e7eb;
  stroke-width: 11;
}

.gauge-nitrogen > .gauge .value {
  stroke: #22c55e;
  stroke-dasharray: none;
  stroke-width: 11;
}

.gauge-nitrogen > .gauge .value-text {
  fill: #22c55e;
  transform: translate3d(25%, 25%, 0);
  font-size: 17px;
  font-weight: 600;
}

/* fosfor */
.gauge-phosphorus > .gauge .dial {
  stroke: #e5e7eb;
  stroke-width: 11;
}

.gauge-phosphorus > .gauge .value {
  stroke: #3b82f6;
  stroke-dasharray: none;
  stroke-width: 11;
}

.gauge-phosphorus > .gauge .value-text {
  fill: #3b82f6;
  transform: translate3d(25%, 25%, 0);
  font-size: 17px;
  font-weight: 600;
}

/* kalium */
.gauge-potassium > .gauge .dial {
  stroke: #e5e7eb;
  stroke-width: 11;
}

.gauge-potassium > .gauge .value {
  stroke: #f59e0b;
  stroke-dasharray: none;
  stroke-width: 11;
}

.gauge-potassium > .gauge .value-text {
  fill: #f59e0b;
  transform: translate3d(25%, 25%, 0);
  font-size: 17px;
  font-weight: 600;
}

/* ec */
#gaugeEc > .gauge .dial {
  stroke: #e5e7eb;
  stroke-width: 10;
}

#gaugeEc > .gauge .value {
  stroke: #10b981;
  stroke-width: 10;
}

#gaugeEc > .gauge .value-text {
  fill: #10b981;
  font-size: 17px;
  font-weight: 700;
}

/* ph bar */
#phSignal .bar {
  width: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.3s ease;
}

#phSignal .active {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* history */
/* gauge total data */
#gaugeTotalData > .gauge .dial {
  stroke: #c3c5c8;
  stroke-width: 10;
}

/* VALUE BAR */
#gaugeTotalData > .gauge .value {
  stroke: #ffffff;
  stroke-width: 10;
}

/* VALUE TEXT */
#gaugeTotalData > .gauge .value-text {
  fill: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

/* Responsive search */

@media (max-width: 640px) {
  .site-header {
    min-height: 72px;
    gap: 8px;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .site-logos {
    gap: 6px;
  }

  .site-logo--campus {
    width: 34px;
    height: 34px;
  }

  .site-logo--partner img {
    width: 82px;
    max-height: 25px;
  }

  .site-title {
    max-width: 32vw;
  }

  .site-title h1 {
    font-size: 14px;
  }

  .site-actions {
    gap: 8px;
  }

  .site-actions > a,
  .site-actions #profileImage {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 360px) {
  .site-logo--campus {
    width: 32px;
    height: 32px;
  }

  .site-logo--partner img {
    width: 74px;
    max-height: 23px;
  }

  .site-title h1 {
    font-size: 13px;
  }

  .site-actions > a,
  .site-actions #profileImage {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 428px) {
  .mobile-nav {
    display: flex;
  }

  #gaugeEc > .gauge .value-text,
  .gauge-potassium > .gauge .value-text,
  .gauge-phosphorus > .gauge .value-text,
  .gauge-nitrogen > .gauge .value-text {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
