:root {
  --primary-bg: #fafbfc;
  --menu-bg: #ffffff;
  --hover-bg: #f5f7fa;
  --popup-bg: #ffffff;
  --popup-border: #cbd5e1;
  --button-bg: #3b82f6;
  --button-hover-bg: #2563eb;
  --shadow-color-light: rgba(100, 100, 111, 0.1);
  --shadow-color-medium: rgba(100, 100, 111, 0.15);
  --shadow-color-strong: rgba(0, 0, 0, 0.12);
  --text-color-primary: #1f2937;
  --text-color-secondary: #475569;
}

/* Reset & base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  border: none;
  text-decoration: none;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background: var(--primary-bg);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  color: var(--text-color-primary);
  transition: left 0.3s ease;
  z-index: 1001;
  padding-top: 60px;
}
.sidebar.active {
  left: 0;
}
.sidebar-list {
  margin-top: 20px;
  list-style: none;
}
.sidebar-item {
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.sidebar-item i {
  padding: 0 5px;
}
.sidebar-item span a {
  color: var(--text-color-primary);
}
.sidebar-item:hover {
  background: linear-gradient(90deg, #1c4eb9, #13bbc7);
  border-radius: 5px;
  color: #fff;
}

/* Sidebar toggle */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 15px;
  background: linear-gradient(90deg, #1c4eb9, #13bbc7);
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 5px;
  z-index: 1100;
}
.sidebar-toggle:hover {
  background: linear-gradient(90deg, #13bbc7, #1c4eb9);
}

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}
.sidebar-overlay.active {
  display: block;
}

/* Main content */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  padding: 10px;
  background: url(../img/bg4.jpeg) center/cover no-repeat;
}
.logogambar img {
  margin-top: 1.9rem;
  width: 6rem;
}

/* Title */
.main-title {
  color: #fff;
  font-weight: 700;
  font-size: 2rem;
  margin: 20px auto 0.75rem;
  text-align: center;
  width: 710px;
  border-radius: 2rem;
  background: linear-gradient(90deg, #1c4eb9, #28a745);
  padding: 10px 20px;
}
.subtitle {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  max-width: 280px;
  margin: 0 auto 50px;
  border-radius: 1rem;
  background: linear-gradient(90deg, #1c4eb9, #28a745);
  padding: 6px 12px;
}

/* Portal */
.portal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  gap: 10px;
}

/* Logo rows */
.logo-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  padding: 6px 0;
  margin-bottom: 4px;
  transition: margin-bottom 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.logo-row.menu-open {
  margin-bottom: 12px;
}

/* Logo */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  margin: 0 5px;
}
.logo {
  cursor: pointer;
  padding: 10px;
  width: 70px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 6px var(--shadow-color-light);
  transition: all 0.3s ease;
}
.logo:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 24px var(--shadow-color-strong);
}
.logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.logo img:hover {
  box-shadow: 0 0 8px rgb(1, 224, 253);
  border-radius: 10px;
}
.logo-subtitle {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(to right, #00f260, #0575e6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Menu */
#menuBelowRow1,
#menuBelowRow2,
#menuBelowRow3 {
  display: flex;
  justify-content: center;
  margin-top: 2px;
  width: 100%;
}
.menu {
  list-style: none;
  margin: 0 auto;
  background: var(--menu-bg);
  box-shadow: 0 6px 18px var(--shadow-color-medium);
  display: flex;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUpIn 0.8s forwards;
  min-width: 400px;
}

/* Warna default link di semua menu popup */
.menu a {
  color: blue !important;
  text-decoration: none;
  font-weight: 500;
}

/* Kalau ada hover */
.menu a:hover {
  color: darkblue !important;
  text-decoration: underline;
}

.menu ul li,
.menu ul li a,
.menu .submenu li a {
  color: blue !important;
}


.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  width: 100%;
  border-radius: 10px;
}
.menu ul li {
  position: relative;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-color-secondary);
  font-weight: 600;
  user-select: none;
  transition: all 0.3s ease;
}
.menu ul li:hover {
  color: var(--text-color-primary);
  transform: translateY(-4px);
}

/* Submenu */
.submenu {
  display: flex !important;
  flex-direction: column;
  margin-top: 12px;
  border-radius: 10px;
  padding: 6px 0;
  max-height: 240px;
  overflow-y: auto;
  cursor: grab;
}
.menu ul li:not(:hover) > .submenu {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.3s, max-height 0.3s;
}
.menu ul li:hover > .submenu {
  opacity: 1;
  max-height: 600px;
  pointer-events: auto;
  transition: opacity 0.5s, max-height 0.5s;
}
.submenu li {
  font-weight: 500;
  color: var(--text-color-secondary);
  transition: all 0.3s ease;
}
.submenu li:hover {
  color: var(--text-color-primary);
  transform: translateX(6px);
}

/* Common vertical menus */
.menu[data-id="logo2"] ul,
.menu[data-id="logo3"] ul,
.menu[data-id="logo4"] ul,
.menu[data-id="logo6"] ul,
.menu[data-id="logo10"] ul,
.menu[data-id="logo11"] ul {
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.menu[data-id="logo2"] ul li,
.menu[data-id="logo3"] ul li,
.menu[data-id="logo4"] ul li,
.menu[data-id="logo6"] ul li,
.menu[data-id="logo10"] ul li,
.menu[data-id="logo11"] ul li {
  list-style: none;
}

.menu[data-id="logo2"] ul li a,
.menu[data-id="logo3"] ul li a,
.menu[data-id="logo4"] ul li a,
.menu[data-id="logo6"] ul li a,
.menu[data-id="logo10"] ul li a,
.menu[data-id="logo11"] ul li a {
  text-decoration: none;
  color: #333;
  background-color: #f0f0f0;
  padding: 8px 12px;
  border-radius: 5px;
  display: block;
  transition: background-color 0.3s;
}

.menu[data-id="logo2"] ul li a:hover,
.menu[data-id="logo3"] ul li a:hover,
.menu[data-id="logo4"] ul li a:hover,
.menu[data-id="logo6"] ul li a:hover,
.menu[data-id="logo10"] ul li a:hover,
.menu[data-id="logo11"] ul li a:hover {
  background-color: #ddd;
}


.menu[data-id="logo14"] ul {
  display: flex;
  flex-wrap: wrap;  /* Supaya bisa turun ke baris baru */
  justify-content: center; /* Rata tengah */
  gap: 10px; /* Jarak antar item */
  padding: 0;
  list-style: none;
}

.menu[data-id="logo14"] li {
  flex: 1 1 auto;
  max-width: 120px; /* Supaya gak kepanjangan */
  text-align: center;
}


/* Popup */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: var(--popup-bg);
  border: 2px solid var(--popup-border);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
  max-width: 380px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  animation: popupIn 0.75s forwards;
  font-weight: 600;
  color: var(--text-color-primary);
}
.popup .button {
  flex: 1 1 calc(50% - 20px);
  padding: 10px;
  background: var(--button-bg);
  color: #fff;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}
.popup .button:hover {
  background: var(--button-hover-bg);
  transform: translateY(-4px);
}
.popup-text {
  font-size: 20px;
  text-align: center;
  padding: 16px 10px;
  animation: fadeIn 0.75s;
}

/* Home button */
.btn-home {
  padding: 0.85rem 2.5rem;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 0.75rem;
  background: linear-gradient(90deg, #1c4eb9, #28a745);
  cursor: pointer;
  box-shadow: 0 6px 15px var(--shadow-color-medium);
  margin: 50px auto;
  display: block;
  transition: all 0.3s ease;
}
.btn-home:hover {
  background: linear-gradient(90deg, #28a745, #1c4eb9);
  box-shadow: 0 8px 20px rgba(2, 36, 36, 0.7);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(90deg, #ffc107, #28a745, #1c4eb9);
  font-size: 0.875rem;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.3);
}
.footer-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.footer p {
  margin: 5px 0 15px;
  font-size: 16px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}
.footer-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
}
.footer-links a img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  transition: transform 0.3s;
}
.footer-links a:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #00bfff;
  transform: scale(1.05);
}
.footer-links a:hover img {
  transform: scale(1.1) rotate(5deg);
}

/* Animations */
@keyframes popupIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.87);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .main-title {
    width: 90%;
    font-size: 1.5rem;
    padding: 8px 16px;
  }
  .logo-row {
    gap: 8px;
    padding: 8px;
  }
  .logo {
    width: 54px;
    height: 66px;
    padding: 8px;
  }
  #menuBelowRow1,
  #menuBelowRow2,
  #menuBelowRow3 {
    width: 400px;
  }
  .menu {
    width: 100vw;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    min-width: 0;
  }
  .menu ul {
    flex-direction: column;
    width: 100%;
  }
  .menu ul li {
    width: 100%;
  }
  .menu ul li .submenu {
    width: 100%;
    margin-top: 12px;
  }
  .footer-links {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    width: 80vw;
    max-width: 300px;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }
  .sidebar.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
}
@media (max-width: 480px) {
  .logo {
    width: 44px;
    height: 54px;
    padding: 5px;
  }
  .menu {
    font-size: 15px;
  }
}


 /* ====== MENU BOX ====== */
.menu-box {
 
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: absolute;
  z-index: 2000;


  outline: 2px solid blue; /* debug, nanti bisa hapus */
}



/* Segitiga kecil (arrow) */
.menu-box::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 9px solid #cbd5e1; /* warna border */
  z-index: 999;
}

.menu-box::before {
  content: "";  
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #fff; /* sama dengan background box */
  z-index: 1000;
}

/* ====== LIST UTAMA ====== */
.menu-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-box li {
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.menu-box li:hover {
  background: #f1f5f9;
}

/* ====== SUBMENU ====== */
.menu-box .submenu {
  display: none;
  margin-top: 5px;
  margin-left: 15px;
  padding-left: 10px;
  border-left: 2px solid #e2e8f0;
}

.menu-box li:hover > .submenu {
  display: block;
}

/* ====== LINK STYLING ====== */
.menu-box a {
  text-decoration: none;
  color: #1e293b; /* abu gelap */
  display: block;
}

.menu-box a:hover {
  color: #0369a1; /* biru saat hover */
}


/* Biar judul fleksibel */
.main-title {
  width: 100%;
  max-width: 710px;
}

/* Portal icon row biar gak overflow */
.logo-row {
  flex-wrap: wrap;
}

/* Menu fleksibel */
.menu {
  width: 100%;
  max-width: 400px;
  min-width: unset;
}

/* Popup biar aman di HP */
.popup {
  width: 90%;
  max-width: 380px;
}

/* Responsif ekstra untuk layar sangat kecil */
@media (max-width: 360px) {
  .logo-row {
    flex-wrap: wrap;          /* Supaya baris bisa turun */
    justify-content: center;  /* Rata tengah */
    gap: 10px;
  }

  @media (max-width: 360px) {
  .logo-container {
    flex: 1 1 60px;
    max-width: 80px;
  }
}

  .logo-container {
     flex: 1 1 80px;        /* fleksibel, minimal 80px */
      max-width: 100px;      /* jangan lebih lebar */
      margin: 5px;
      text-align: center;
  }

  .logo {
    width: 50px;
    height: 60px;
    padding: 6px;
    outline: 2px solid red; /* untuk lihat batas logo */
  }

  .main-title {
    font-size: 1.2rem;
    padding: 6px 10px;
  }

  .btn-home {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
  }
}

/* Default gradiasi */
.text-gradient,
.icon-gradient {
  background: linear-gradient(to right, #003f7f, #00aaff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; 
  color: transparent;
  transition: all 0.3s ease;
}

/* Hover jadi putih */
.text-gradient:hover,
 .-gradient:hover{
  background: none;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: #fff;
  color: #fff;
}

/* ======== STYLE FORM DALAM POPUP ======== */
#popupOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background: #fff;
  padding: 25px 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeIn 0.3s ease;
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 15px;
  font-size: 22px;
  color: #555;
  cursor: pointer;
  transition: 0.2s;
}
.popup-close:hover {
  color: #e74c3c;
}

/* ===== FORM ===== */
.popup-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  color: #2c3e50;
  text-align: center;
}

.popup-content form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.popup-content label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
}

.popup-content input[type="text"],
.popup-content input[type="file"],
.popup-content textarea,
.popup-content select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  transition: border 0.2s, box-shadow 0.2s;
}

.popup-content input[type="text"]:focus,
.popup-content input[type="file"]:focus,
.popup-content textarea:focus,
.popup-content select:focus {
  border-color: #3498db;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.4);
  outline: none;
}

.popup-content textarea {
  resize: vertical;
  min-height: 80px;
}

.popup-content button[type="submit"] {
  background: #3498db;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}
.popup-content button[type="submit"]:hover {
  background: #2980b9;
}

/* Scroll untuk popup jika konten panjang */
.popup-content::-webkit-scrollbar {
  width: 8px;
}
.popup-content::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 6px;
}
.popup-content::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* Animasi popup */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

