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

body {
  font-family: 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;

  /* BACKGROUND DIKUNCI (FIXED) */
  background-image: url('../img/gedung-dpmptsp.png');
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
}

/* CONTAINER */
.portal-container {
  position: relative;
  min-height: 100vh;
  padding: 25px;
}

/* OVERLAY */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

/* HEADER */
.header {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* FIX LOGO (COMPACT SIZE) */
.logo {
  width: clamp(240px, 25vw, 400px);
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45));
}

/* MAIN PANEL (COMPACT SIZE) */
.main-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1050px;
  margin: 110px auto 0;
  background: rgba(30,30,30,0.45);
  border-radius: 20px;
  padding: 25px;

  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 25px;

  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* LEFT (SWIPER AREA) */
.left-side {
  width: 100%;
  height: 100%;
}

.banner-card {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.banner-card .swiper,
.banner-card .swiper-wrapper,
.banner-card .swiper-slide {
  width: 100%;
  height: 100%;
}

.banner-card .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* RIGHT (MENU GRID) */
.right-side {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px 20px;
  align-content: center;
}

.menu-card {
  text-decoration: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: .3s ease;
  padding: 5px 0;
}

/* ICON (COMPACT SIZE) */
.icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(91,196,255,0.2);
  border: 2px solid rgba(126,222,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 15px;
  backdrop-filter: blur(5px);
  transition: .3s ease;
  box-shadow: 0 0 15px rgba(0,191,255,0.2);
}

.menu-card h3 {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.menu-card:hover {
  transform: translateY(-6px);
}

.menu-card:hover .icon-wrap {
  transform: scale(1.05);
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  box-shadow: 0 0 25px rgba(0,191,255,0.7);
}

.menu-card.active .icon-wrap {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
}

/* FOOTER */
.footer {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1050px;
  margin: 20px auto 0;
  padding: 15px 25px;
  text-align: center;
  color: #fff;
  border-radius: 15px;
  background: rgba(30,30,30,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 1px;
  background: rgba(255,255,255,0.15);
}

.footer h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.footer p {
  font-size: 11px;
  margin-bottom: 2px;
  opacity: 0.8;
}

/* GSAP OPA-1 FIX */
.logo, .main-panel, .banner-card, .menu-card, .footer {
  opacity: 1;
}

/* ==========================================
   MEDIA QUERIES RESPONSIVE RAPI
   ========================================== */

/* TABLET / MEDIUM SCREEN */
@media(max-width:850px) {
  .main-panel {
    max-width: 768px;
    display: grid;
    grid-template-columns: 50% 1fr;
    gap: 20px;
    margin-top: 130px;
    padding: 20px;
    align-items: stretch;
  }

  .left-side {
    width: 100%;
  }

  .banner-card {
    height: 100%;
    min-height: 280px;
  }

  .right-side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 35px 15px;
    padding: 10px 0;
  }

  .menu-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    height: 100%;
  }

  .icon-wrap {
    width: 65px;
    height: 65px;
    font-size: 28px;
    margin-bottom: 16px;
    flex-shrink: 0;
  }

  .menu-card h3 {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    margin: 0;
    word-break: break-word;
  }

  .footer {
    max-width: 768px;
    padding: 15px;
    margin-top: 30px;
  }
}

/* SMARTPHONE / MOBILE SCREEN (OTOMATIS SAMA TINGGI & SEJAJAR) */
@media(max-width:480px){
  .portal-container {
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
  }

  .header {
    position: relative;
    top: 0;
    margin-top: 10px;
    margin-bottom: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .logo {
    width: 170px;
    height: auto;
  }

  .main-panel {
    margin-top: 30px;
    width: 100%;
    max-width: 100%;
    padding: 14px;
    display: grid;
    grid-template-columns: 53% 1fr;
    gap: 12px;
    border-radius: 15px;
    align-items: stretch; /* MEMAKSA tinggi area kiri dan kanan selalu sama rata */
    background: rgba(30, 30, 30, 0.55);
  }

  .left-side {
    width: 100%;
    height: 100%;
  }

  .banner-card {
    height: 100%; /* Menghapus angka 325px, berubah jadi 100% mengikuti tinggi panel */
    min-height: 200px; /* Batas minimal agar di HP super kecil tidak gepeng */
    border-radius: 12px;
  }

  .right-side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr 1fr; /* Membagi baris atas & bawah seimbang */
    gap: 20px 12px;
    height: 100%;
  }

  .menu-card {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Konten icon & teks otomatis di tengah-tengah tinggi baris */
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 5px 0;
  }

  .icon-wrap {
    width: 50px;
    height: 50px;
    font-size: 22px;
    margin-bottom: 10px;
  }

  .menu-card h3 {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0;
  }

  .footer {
    width: 100%;
    margin-top: 30px;
    padding: 15px;
  }
}

/* ==========================================
   DESKTOP PREMIUM GLASSMORPHISM REDESIGN
   ========================================== */
@media (min-width: 851px) {
  body {
    overflow: hidden; /* Prevent scrolling entirely on desktop */
  }

  .portal-container {
    height: 100vh;
    min-height: 100vh;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
  }

  .header {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: auto;
    margin-bottom: 0;
  }

  .logo {
    width: 280px;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
  }

  .main-panel {
    margin: 0 auto;
    max-width: 1120px;
    height: 350px;
    padding: 20px;
    gap: 20px;
    grid-template-columns: 210px 1fr;
    background: rgba(20, 20, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.55);
  }

  .left-side {
    height: 100%;
    max-height: 310px;
    min-height: 0;
  }

  .banner-card {
    height: 100%;
    max-height: 310px;
    min-height: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  }

  .right-side {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    align-content: center;
    height: 100%;
  }

  .menu-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 10px 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .icon-wrap {
    width: 75px;
    height: 75px;
    border-radius: 20px;
    background: #ffffff; /* White background to make all logos fully visible */
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .menu-card h3 {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.4s ease;
  }

  .menu-card img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .menu-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  }

  .menu-card:hover .icon-wrap {
    transform: scale(1.15); /* Enlarge the icon wrap on hover */
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
  }

  .menu-card:hover img {
    transform: scale(1.1); /* Slightly enlarge the image inside on hover */
  }

  .menu-card:hover h3 {
    color: #fff;
  }

  /* Website (1st) */
  .menu-card:nth-child(1):hover {
    border-color: rgba(0, 191, 255, 0.4);
    box-shadow: 0 12px 30px rgba(0, 191, 255, 0.15);
  }
  .menu-card:nth-child(1):hover .icon-wrap {
    border-color: rgba(0, 191, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.35);
  }

  /* WebGIS (2nd) */
  .menu-card:nth-child(2):hover {
    border-color: rgba(40, 167, 69, 0.4);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.15);
  }
  .menu-card:nth-child(2):hover .icon-wrap {
    border-color: rgba(40, 167, 69, 0.6);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.35);
  }

  /* OSS (3rd) */
  .menu-card:nth-child(3):hover {
    border-color: rgba(220, 53, 69, 0.4);
    box-shadow: 0 12px 30px rgba(220, 53, 69, 0.15);
  }
  .menu-card:nth-child(3):hover .icon-wrap {
    border-color: rgba(220, 53, 69, 0.6);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.35);
  }

  /* Simosi (4th) */
  .menu-card:nth-child(4):hover {
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 12px 30px rgba(255, 193, 7, 0.15);
  }
  .menu-card:nth-child(4):hover .icon-wrap {
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.35);
  }

  /* E-PTSP (5th) */
  .menu-card:nth-child(5):hover {
    border-color: rgba(23, 162, 184, 0.4);
    box-shadow: 0 12px 30px rgba(23, 162, 184, 0.15);
  }
  .menu-card:nth-child(5):hover .icon-wrap {
    border-color: rgba(23, 162, 184, 0.6);
    box-shadow: 0 0 20px rgba(23, 162, 184, 0.35);
  }

  /* Sipintar (6th) */
  .menu-card:nth-child(6):hover {
    border-color: rgba(253, 126, 20, 0.4);
    box-shadow: 0 12px 30px rgba(253, 126, 20, 0.15);
  }
  .menu-card:nth-child(6):hover .icon-wrap {
    border-color: rgba(253, 126, 20, 0.6);
    box-shadow: 0 0 20px rgba(253, 126, 20, 0.35);
  }

  /* Monitoring (7th) */
  .menu-card:nth-child(7):hover {
    border-color: rgba(111, 66, 193, 0.4);
    box-shadow: 0 12px 30px rgba(111, 66, 193, 0.15);
  }
  .menu-card:nth-child(7):hover .icon-wrap {
    border-color: rgba(111, 66, 193, 0.6);
    box-shadow: 0 0 20px rgba(111, 66, 193, 0.35);
  }

  /* Bantuan (8th) */
  .menu-card:nth-child(8):hover {
    border-color: rgba(108, 117, 125, 0.4);
    box-shadow: 0 12px 30px rgba(108, 117, 125, 0.15);
  }
  .menu-card:nth-child(8):hover .icon-wrap {
    border-color: rgba(108, 117, 125, 0.6);
    box-shadow: 0 0 20px rgba(108, 117, 125, 0.35);
  }

  .footer {
    margin: 0 auto;
    max-width: 1120px;
    padding: 12px 25px;
    background: rgba(20, 20, 20, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  }
}
