/* =====================================================================
   Website Pendaftaran Lomba — Responsive / Mobile Stylesheet
   Mencakup semua halaman: landing, auth, peserta, admin
   Target: Android & layar kecil (<= 768px, <= 480px, <= 360px)
   ===================================================================== */

/* ─────────────────────────────────────────────
   GLOBAL — prevent horizontal overflow
   ───────────────────────────────────────────── */
html, body {
  overflow-x: clip;
}

/* Touch-friendly tap targets — hanya block/flex elemen, bukan inline */
@media (max-width: 768px) {
  button, [role="button"] {
    min-height: 40px;
  }
  .tabs a,
  .admin-tab-link,
  .btn-pagination {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────
   SHARED — Navbar peserta (.navbar di style.css)
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-inner {
    padding: 0.65rem 1rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .brand {
    font-size: 0.95rem;
    gap: 0.4rem;
  }
  .brand .logo {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .nav-links {
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  .nav-links a {
    font-size: 0.82rem;
  }
  .btn-kecil {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
  }

  /* Tabs peserta — horizontal scroll tanpa scrollbar terlihat */
  .tabs {
    gap: 0.35rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Container */
  .container {
    padding: 1rem 0.85rem;
  }
  .page-head h1 {
    font-size: 1.25rem;
  }
  .page-head p {
    font-size: 0.88rem;
  }

  /* Card */
  .card {
    padding: 1.1rem;
  }

  /* Tabel peserta — horizontal scroll */
  .tabel-wrap {
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tabel {
    font-size: 0.8rem;
    min-width: 420px;
  }
  .tabel th,
  .tabel td {
    padding: 0.55rem 0.6rem;
  }

  /* Grid statistik peserta */
  .grid-statistik {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stat .angka {
    font-size: 1.65rem;
  }

  /* Grid lomba peserta */
  .grid-lomba {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Sapaan navbar peserta (teks nama user) */
  #sapaan {
    display: none;
  }

  /* Topbar — wrap ke kolom */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  /* Kartu lomba mobile */
  .kartu-lomba {
    padding: 1rem;
  }
  .kartu-lomba h3 {
    font-size: 0.95rem;
  }
  .kartu-lomba .deskripsi {
    font-size: 0.84rem;
  }
  .kartu-lomba .meta {
    font-size: 0.82rem;
  }

  /* aksi-form wrap di mobile */
  .aksi-form {
    flex-direction: column;
  }
  .aksi-form button {
    width: 100%;
  }

  /* Auth cards */
  .auth-wrap {
    padding: 1rem 0.75rem;
  }
  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: 14px;
  }
  .auth-card h1 {
    font-size: 1.45rem;
  }

  /* Buttons */
  button, .btn {
    font-size: 0.9rem;
  }
  .btn-blok {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .tabs a {
    font-size: 0.74rem;
    padding: 0.35rem 0.6rem;
  }
  .tabel {
    font-size: 0.72rem;
  }
  .tabel th,
  .tabel td {
    padding: 0.45rem 0.5rem;
  }
  .auth-card {
    padding: 1.4rem 1rem;
  }
  .auth-card h1 {
    font-size: 1.3rem;
  }
}


/* ─────────────────────────────────────────────
   ADMIN PANEL RESPONSIVE STYLES
   Telah disatukan di /assets/css/admin.css agar tidak terjadi konflik/tumpang tindih.
   ───────────────────────────────────────────── */


/* ─────────────────────────────────────────────
   HOME PAGE (index.html) — extra Android fixes
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  body.home-page {
    padding-top: 58px !important;
  }
  body.home-page .home-navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(26, 46, 74, 0.10) !important;
  }
  .home-navbar .navbar-content {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    gap: 8px !important;
  }
  .logo-img {
    width: 42px !important;
    height: 42px !important;
  }
  .brand-title {
    font-size: 1.1rem !important;
    color: var(--navy-800) !important;
  }
  .brand-subtitle {
    font-size: 0.68rem !important;
  }
  @media (max-width: 480px) {
    .brand-subtitle {
      display: none !important;
    }
  }
  /* Overlay Latar Belakang Redup & Blur — warna brand navy */
  .menu-overlay {
    position: fixed;
    top: 58px;
    left: 0;
    width: 100%;
    height: calc(100vh - 58px);
    background-color: rgba(13, 27, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 98;
  }
  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Hamburger Menu Toggle Button (SVG) — warna brand navy */
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
    outline: none;
    color: var(--navy-800);
    transition: var(--transition);
  }
  .menu-toggle .hamburger-svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .menu-toggle .line-1,
  .menu-toggle .line-2,
  .menu-toggle .line-3 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
  }

  /* Animasi Transisi Hamburger ke 'X' (SVG) */
  .menu-toggle.active .hamburger-svg {
    transform: rotate(90deg);
  }
  .menu-toggle.active .line-1 {
    transform: translateY(6px) rotate(45deg);
  }
  .menu-toggle.active .line-2 {
    opacity: 0;
    transform: scale(0);
  }
  .menu-toggle.active .line-3 {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Nav Menu sebagai Drawer Mobile */
  .nav-menu {
    display: flex !important;
    position: fixed;
    top: 58px;
    right: -100%;
    width: 260px;
    height: calc(100vh - 58px);
    background-color: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 24px;
    box-shadow: -10px 15px 30px rgba(26, 46, 74, 0.12);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
  }
  .nav-menu.active {
    right: 0;
  }
  .nav-menu li {
    width: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Menu Header inside drawer */
  .nav-menu .menu-header {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy-800);
    letter-spacing: 0.12em;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--navy-100);
  }

  .nav-menu a {
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 12px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--transition);
  }
  .nav-menu a::after {
    display: none !important;
  }
  .nav-menu a:hover,
  .nav-menu a.active {
    color: var(--navy-800) !important;
    padding-left: 6px;
  }
  .nav-menu li:last-child a {
    border-bottom: none;
  }

  /* Animasi staggered slide-in ketika menu aktif */
  .nav-menu.active li {
    opacity: 1;
    transform: translateX(0);
  }
  .nav-menu.active li:nth-child(1) { transition-delay: 0.08s; }
  .nav-menu.active li:nth-child(2) { transition-delay: 0.14s; }
  .nav-menu.active li:nth-child(3) { transition-delay: 0.20s; }
  .nav-menu.active li:nth-child(4) { transition-delay: 0.26s; }
  .nav-menu.active li:nth-child(5) { transition-delay: 0.32s; }
  .nav-menu.active li:nth-child(6) { transition-delay: 0.38s; }
  .nav-menu.active li:nth-child(7) { transition-delay: 0.44s; }

  #nav-utama {
    margin-left: auto;
    margin-right: 8px;
  }
  #nav-utama .btn-primary-custom {
    font-size: 0.8rem !important;
    padding: 8px 14px !important;
    gap: 5px !important;
  }
  #nav-utama .btn-primary-custom svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* STEP 1: Hero — bersihkan artefak visual blur/ghosting */
  .hero-math-overlay,
  .hero-grid-lines,
  .math-el,
  .math-el-1,
  .math-el-2,
  .math-el-3,
  .math-el-4,
  .math-el-5 {
    display: none !important;
  }

  /* Foto latar hero — satu layer bersih */
  .hero-bg-building {
    background-position: center center !important;
    opacity: 1 !important;
    filter: brightness(0.88) !important;
  }

  /* Overlay hero — satu gradient navy bersih ke bawah, tanpa layer duplikat */
  .hero-overlay {
    background:
      linear-gradient(
        to bottom,
        rgba(26, 6, 6, 0.72) 0%,
        rgba(45, 11, 11, 0.84) 60%,
        rgba(88, 18, 18, 0.92) 100%
      ) !important;
  }

  /* STEP 2: Hero — hirarki & spacing */
  .hero-section {
    min-height: auto;
    padding: 40px 0 45px !important;
  }
  .hero-grid {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  .hero-text-content {
    gap: 16px;
    max-width: 100%;
  }
  .hero-mascot-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: -40px;
  }
  .hero-mascot-image {
    height: 180px;
    width: auto;
    max-width: 170px;
  }


  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em !important;
  }
  .creative-title {
    font-size: 0.88rem;
    line-height: 1.5;
  }
  .creative-tagline {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* CTA Button — full-width, min-height 48px, thumb-reach zone */
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    margin-top: 4px;
  }
  .hero-buttons .btn-primary-custom {
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 13px 20px !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
  }


  /* Features bar */
  .floating-features-bar {
    margin-top: -20px;
    padding: 18px 16px;
    border-radius: 16px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Tentang section */
  .tentang-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .tentang-info-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .tentang-benefits-list {
    padding: 20px 16px !important;
  }
  .tentang-benefits-title {
    font-size: 1rem !important;
  }
  .benefit-row {
    gap: 12px !important;
  }
  .benefit-icon-wrapper {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 10px !important;
  }
  .benefit-icon-wrapper svg {
    width: 18px !important;
    height: 18px !important;
  }
  .benefit-text h4 {
    font-size: 0.9rem !important;
  }
  .benefit-text p {
    font-size: 0.8rem !important;
  }

  /* STEP 4: Kategori cards — shadow, border-radius 16px, padding min 20px, tap-feedback */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .category-card {
    padding: 20px 16px !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(26, 46, 74, 0.09), 0 1px 4px rgba(26, 46, 74, 0.05) !important;
    border: 1px solid var(--navy-100) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
  }
  /* Tap-feedback saat jari menyentuh card di layar sentuh */
  .category-card:active {
    transform: scale(0.97) !important;
    box-shadow: 0 2px 8px rgba(26, 46, 74, 0.10) !important;
    background-color: var(--navy-50) !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease !important;
  }
  /* Accent stripe top — border-radius konsisten dengan card */
  .card-sd::before,
  .card-smp::before,
  .card-sma::before,
  .card-pt::before {
    border-radius: 16px 16px 0 0 !important;
  }
  .card-image-box {
    height: 90px;
    margin-bottom: 14px;
  }
  .card-illustration {
    max-height: 80px;
  }
  .card-badge {
    margin-bottom: 14px;
  }
  .card-name {
    font-size: 1rem;
  }
  .card-description {
    font-size: 0.78rem;
    margin-bottom: 10px;
  }
  /* Box "MATERI PERLOMBAAN" — warna brand navy tint pucat (bukan biru muda asing) */
  .card-materials {
    font-size: 0.73rem;
    background: var(--navy-50) !important;
    border: 1px solid var(--navy-100) !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: 8px !important;
    color: var(--navy-700) !important;
    padding: 8px 12px !important;
    margin-top: 10px;
  }
  .card-materials strong {
    color: var(--orange-600) !important;
  }

  /* Timeline */
  .timeline-step {
    flex-direction: row;
    gap: 14px;
    text-align: left;
  }
  .timeline-node {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }
  .timeline-title {
    font-size: 0.95rem;
  }
  .timeline-date {
    font-size: 0.8rem;
  }

  /* Biaya grid */
  .biaya-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .biaya-card {
    padding: 18px 16px;
  }
  .price-value {
    font-size: 1.5rem;
  }

  /* Lomba cards */
  .lomba-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .lomba-card {
    padding: 1rem;
  }

  /* Contact grid */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .contact-card {
    padding: 14px;
  }
  .contact-card-full {
    grid-column: span 1 !important;
  }
  .contact-list-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .contact-member {
    flex-direction: column;
    gap: 2px;
  }
  .member-name {
    font-size: 0.88rem;
  }
  .member-phone {
    font-size: 0.8rem;
  }
  .contact-action-btn {
    font-size: 0.8rem;
    padding: 6px 14px;
  }

  /* Section headings */
  .section-title {
    font-size: 1.5rem;
  }
  .section-desc {
    font-size: 0.88rem;
  }
  .section-head {
    margin-bottom: 24px !important;
  }

  /* Section padding */
  .kategori-section,
  .timeline-section,
  .biaya-section,
  .contact-section,
  .lomba-section {
    padding: 40px 0;
  }

  /* Footer */
  .footer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer-social-side {
    align-items: flex-start !important;
  }
  .footer-brand-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .brand-subtitle {
    display: none !important;
  }
  .hero-title {
    font-size: 1.6rem !important;
    line-height: 1.38 !important;
  }
  .categories-grid {
    grid-template-columns: 1fr !important;
  }
  .tentang-info-grid {
    grid-template-columns: 1fr !important;
  }
  /* CTA hero tetap nyaman di layar sedang */
  .hero-buttons .btn-primary-custom {
    min-height: 48px !important;
    font-size: 0.92rem !important;
  }
}

@media (max-width: 400px) {
  .hero-title {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
  }
  .categories-grid {
    grid-template-columns: 1fr !important;
  }
  /* Padding card tetap min 20px di layar sangat kecil */
  .category-card {
    padding: 20px 14px !important;
  }
}

/* STEP 5: Scroll-Reveal Animation — fade + slide-up untuk card kategori
   .reveal-ready  : state awal (invisible), set via JS
   .revealed      : state akhir (visible), trigger via IntersectionObserver
   Hanya aktif di mobile (max-width 640px), JS mengecek window.innerWidth */
@media (max-width: 640px) {
  .reveal-ready {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .reveal-ready.revealed {
    opacity: 1;
    transform: translateY(0);
  }
  /* Stagger delay antar card berdasarkan urutan anak */
  .reveal-ready:nth-child(1) { transition-delay: 0.00s; }
  .reveal-ready:nth-child(2) { transition-delay: 0.07s; }
  .reveal-ready:nth-child(3) { transition-delay: 0.14s; }
  .reveal-ready:nth-child(4) { transition-delay: 0.21s; }
}
