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

/* Scroll Smooth */
html, body {
  scroll-behavior: smooth;
}

/* Body */
body {
  background: linear-gradient(to bottom, #0c0f1a, #141927);
  color: white;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
  scroll-behavior: smooth;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("https://cdn.jsdelivr.net/gh/JulianLaval/canvas-particles/particles.gif") center center / cover no-repeat;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
  animation: fadeBackground 8s infinite alternate;
}

@keyframes fadeBackground {
  from { opacity: 0.08; }
  to { opacity: 0.15; }
}

/* Loader */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0c0f1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 1.2s ease-in-out;
}

.loader {
  width: 60px;
  height: 60px;
  border: 6px solid #00bcd4;
  border-top: 6px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-wrapper p {
  margin-top: 15px;
  color: #00bcd4;
  font-weight: bold;
  animation: pulse 1.2s infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Header */
header {
  position: relative;
  top: 0;
  width: 100%;
  background: rgba(26, 31, 43, 0.9);
  padding: 20px 40px;
  z-index: 1000;
  text-align: center;
  border-bottom: 3px solid #00bcd4;
  transition: top 0.4s ease-in-out, background 0.3s ease-in-out;
  backdrop-filter: blur(10px);
}

header h1 {
  font-size: 2.5rem;
  color: #00bcd4;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #00bcd4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

header nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

header nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, transform 0.2s;
}

header nav a:hover {
  color: #00bcd4;
  transform: scale(1.1);
}

/* Hamburger menu */
.hamburger {
  display: none;
  color: white;
  font-size: 1.8rem;
  position: absolute;
  right: 25px;
  top: 22px;
  cursor: pointer;
  z-index: 1100;
}

/* Section */
section {
  padding: 100px 20px 40px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  transition: all 0.5s ease-in-out;
}

section h2 {
  font-size: 2.3rem;
  margin-bottom: 20px;
  color: #00bcd4;
  text-align: center;
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #00bcd4;
  border-radius: 3px;
}

/* Cards */
.divisi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.card {
  background: linear-gradient(135deg, #1c2331, #2a3242);
  padding: 25px;
  border-radius: 15px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.2);
  border: 1px solid rgba(0, 188, 212, 0.2);
}

.card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 0 30px rgba(0, 188, 212, 0.5);
}

/* Rules */
#rules ul {
  list-style: none;
  padding-left: 0;
}

#rules ul li {
  margin: 10px 0;
  padding-left: 15px;
  border-left: 3px solid #00bcd4;
  position: relative;
  padding-bottom: 5px;
  transition: transform 0.3s ease;
}

#rules ul li:hover {
  transform: translateX(5px);
}

#rules ul li::before {
  content: '✔';
  position: absolute;
  left: -20px;
  color: #00bcd4;
  font-weight: bold;
}

/* Form */
form {
  background: #1c2331;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 188, 212, 0.3);
  transition: all 0.3s ease;
}

form label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
  color: #00bcd4;
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 12px;
  margin-top: 5px;
  border: none;
  border-radius: 5px;
  background: #2a2f40;
  color: white;
  font-size: 1rem;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  background: #31384a;
  box-shadow: 0 0 0 2px #00bcd4;
}

form button {
  margin-top: 25px;
  padding: 14px;
  width: 100%;
  background: #00bcd4;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.4s ease, transform 0.2s ease;
}

form button:hover {
  background: #0190a3;
  transform: scale(1.02);
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 20px;
  background: #1a1f2b;
  color: #888;
  border-top: 3px solid #00bcd4;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* Popup Success */
.popup-success {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(8px);
  background-color: rgba(12, 15, 26, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 9999;
}

.popup-success.show {
  opacity: 1;
  visibility: visible;
}

.popup-success .popup-content {
  background: linear-gradient(145deg, #1f2b40, #2e3c55);
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 188, 212, 0.4);
  animation: fadeSlideUp 0.6s ease-out;
  transform: translateY(30px);
  color: white;
}

.popup-success.show .popup-content {
  transform: translateY(0);
}

.popup-success h3 {
  color: #00bcd4;
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.popup-success p {
  font-size: 1rem;
  margin: 8px 0;
}

.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.popup-buttons button {
  padding: 10px 25px;
  background-color: #00bcd4;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.popup-buttons button:hover {
  background-color: #0190a3;
  transform: scale(1.05);
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  header nav {
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 0;
    width: 100%;
    background: rgba(26, 31, 43, 0.95);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }

  header nav.active {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
    padding: 10px 0;
  }

  header nav a {
    padding: 12px 0;
    margin: 5px 0;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.8rem;
  }

  section h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 20px;
  }

  form {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  form input,
  form textarea,
  form select {
    font-size: 0.95rem;
  }

  form button {
    padding: 12px;
    font-size: 1rem;
  }
}
