/* RESET RINGAN */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background-color: #000000;
  opacity: 0;
  animation: fadeInBackground 3s ease-in forwards;
}

@keyframes fadeInBackground {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  color: #111;

  /* Background default + fallback */
  background: #000 center / cover no-repeat fixed;
  background-image: url('../img/bg-landscape.jpg');

  /* tinggi viewport aman (diset via JS) */
  min-height: calc(var(--vh, 1vh) * 100);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #000 center / cover no-repeat fixed;
  background-image: url('../img/bg-landscape.jpg');
  opacity: 0;
  animation: fadeInBackground 3s ease-in forwards;
  z-index: -1;
}

/* background untuk orientasi portrait */
@media (orientation: portrait) {
  body {
    background-image: url('../img/bg-portrait.jpg');
  }

  body::before {
    background-image: url('../img/bg-portrait.jpg');
  }
}

h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.2rem, 5vw, 2.5rem);
  color: #fff;
  line-height: 60%;
}

h1 span {
  color: #dddddd;
  font-size: 40%;
}

/* =========================
   PAGE WRAPPER
   ========================= */
.page {
  min-height: calc(var(--vh, 1vh) * 100);
  display: grid;
  place-items: center;
  /* pusatkan container */
}

/* =========================
   CONTAINER (FULL GRID)
   ========================= */
.container {
  width: min(100% - 20px, 1000px);
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* header | konten fleksibel | footer */
  row-gap: clamp(12px, 2vw, 24px);
  min-height: 85vh;
  /* tinggi area kerja */
  padding: 0 10px;
  z-index: 5;
  /* background-color: aqua; */
}

/* =========================
   HEADER
   ========================= */
header.header {
  width: 100%;
  display: grid;
  justify-items: center;
  row-gap: 12px;
  text-align: center;
  margin: 0;
  padding: 0;
}

.logo-bi {
  max-width: clamp(100px, 35vw, 200px);
  height: auto;
  display: block;
  opacity: 0;
  /* Start hidden */
  animation: fadeInLogo 1.5s ease-out 1s forwards;
  /* Fade-in animation with delay */
}

.logo-event {
  
  max-width: min(90%, 600px);
  height: auto;
  display: block;
  opacity: 0;
  /* Start hidden */
  animation: fadeInLogo 1.5s ease-out 1s forwards;
  /* Fade-in animation with delay */
}
.logo-qr {
    width: auto;  /* Membatasi lebar gambar maksimal 100% dari kontainer */
    height: 50vh;     /* Menjaga rasio aspek gambar tetap sama */
    display: block;   /* Menghilangkan ruang kosong di bawah gambar */
    margin: 0 auto;   /* Menengahkan gambar secara horizontal */

      opacity: 0;
  /* Start hidden */
  animation: fadeInLogo 1.5s ease-out 1s forwards;
    
}

/* Logo Fade-In Animation */
@keyframes fadeInLogo {
  0% {
    opacity: 0;
    /* Start with hidden */
    transform: translateY(-50px);
    /* Start from above */
  }

  100% {
    opacity: 1;
    /* Fully visible */
    transform: translateY(0);
    /* Move to original position */
  }
}

/* =========================
   CONTENT
   ========================= */
.content {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-items: center;
  gap: 5px;
  text-align: center;
  /* background-color: rgb(255, 251, 0);  */
}



/* =========================
   FOOTER (DI DALAM CONTAINER)
   ========================= */
.footer {
  width: 100%;
  display: grid;
  justify-items: center;
  padding: 10px;
  /* background-color: rgb(255, 0, 0); */
}

.footer .logo-footer {
  width: min(90%, 800px);
  height: auto;
  display: block;
}

/* =========================
   RESPONSIVE TWEAKS
   ========================= */
@media (min-width: 1024px) {
  .container {
    row-gap: 24px;
  }
}



/* Animations */
@keyframes fadeInContent {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeInCategory {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeInQuestion {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}


/* Menambahkan animasi fade-in untuk seluruh halaman */
@keyframes fadeInCard {
  0% {
    opacity: 0;
    transform: translateY(20px);
    /* Memulai dengan posisi sedikit lebih rendah */
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    /* Kembali ke posisi semula */
  }
}

/* Mengatur container lomba-list agar menggunakan Flexbox atau Grid */
.lomba-list {
  display: inline-grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  /* Membuat grid dengan kolom fleksibel */
  gap: 20px;
  /* Jarak antar kartu */
  margin-top: 10px;
  padding: 10px;
  /* background-color: #2e1ab3; */
  /* Padding tambahan untuk menghindari tumpang tindih dengan tepi layar */
}

/* Styling untuk setiap card lomba */
.card {
  background-color: #fff;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s ease;
  max-width: 100%;
  /* Pastikan card tidak melampaui lebar grid */
  box-sizing: border-box;
  /* Pastikan padding tidak mempengaruhi ukuran */
  opacity: 0;
  /* Mulai dengan opacity 0 */
  transform: translateY(20px);
  /* Mulai dari bawah */
  animation: fadeInCard 1s ease-out forwards;
  /* Menambahkan animasi fade-in */
}

/* Efek hover pada card */
.card:hover {
  transform: translateY(-10px);
  /* Efek hover untuk meningkatkan interaksi */
}

/* Styling untuk judul lomba di dalam card */
.card h3 {
  font-size: clamp(1.3rem, 1.5vw, 2em);
  margin-bottom: 10px;
}

/* Styling untuk tombol di dalam card */
.card button {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  background-color: #98073f;
  color: white;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

/* Efek hover untuk tombol */
.card button:hover {
  background-color: #0a3287;
}

/* Responsif untuk perangkat kecil (Mobile) */
@media (max-width: 600px) {


  .card button {
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* Pastikan grid responsif dengan menyesuaikan kolom */
@media (min-width: 600px) {
  .lomba-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Lebar kolom lebih besar di perangkat yang lebih besar */
  }
}

@media (min-width: 1024px) {
  .lomba-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Ukuran lebih besar di layar desktop */
  }
}


.upload-section {
  margin-top: 20px;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-section h1 {
  color: #000;
  line-height: 1.2;
  font-size: clamp(1.3rem, 1.5vw, 2em);
}

.upload-section h2 {
  color: #000;
  line-height: 1.2;
  font-size: clamp(1.3rem, 1.5vw, 2em);
}

.upload-section input[type="file"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: white;
  cursor: pointer;
}

.upload-section .vote-btn {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #98073f;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.upload-section .vote-btn:hover {
  background-color: #0a3287;
}