/* ============================================================
   P5 KEBEKERJAAN – SMK MIC  |  Global Stylesheet
   ============================================================ */

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

:root {
  --gold:        #f5c842;
  --gold-light:  #ffe898;
  --gold-dark:   #c9a415;
  --navy:        #0b0b1a;
  --navy-2:      #0f0f2a;
  --navy-3:      #13132e;
  --surface:     #16163a;
  --surface-2:   #1c1c45;
  --border:      rgba(245, 200, 66, 0.18);
  --text:        #e8e8f5;
  --text-muted:  #8888bb;
  --accent:      #7c5cfc;
  --accent2:     #fc5c9c;
  --radius:      18px;
  --shadow:      0 8px 40px rgba(0,0,0,0.45);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── PARTICLES ── */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: float-up linear infinite;
}
@keyframes float-up {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1.2); }
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(124,92,252,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(245,200,66,0.18) 0%, transparent 55%),
    linear-gradient(160deg, #0b0b1a 0%, #12124a 50%, #0b0b1a 100%);
  text-align: center;
  padding: 80px 24px 120px;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      60deg,
      transparent,
      transparent 60px,
      rgba(245,200,66,0.03) 60px,
      rgba(245,200,66,0.03) 61px
    ),
    repeating-linear-gradient(
      -60deg,
      transparent,
      transparent 60px,
      rgba(124,92,252,0.03) 60px,
      rgba(124,92,252,0.03) 61px
    );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.school-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,200,66,0.12);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 18px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}
.badge-icon { font-size: 1rem; }

.hero-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  opacity: 0.85;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 20px;
}

.gold-text {
  color: var(--gold);
  text-shadow: 0 0 40px rgba(245,200,66,0.4);
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
  font-style: italic;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 14px 36px;
  backdrop-filter: blur(12px);
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-num  { font-size: 1.35rem; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-label{ font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.stat-divider {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.hero-wave {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  line-height: 0;
}
.hero-wave svg { width: 100%; height: 80px; display: block; }

/* ── MAIN ── */
.main {
  position: relative;
  z-index: 1;
  padding: 64px 24px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header { text-align: center; margin-bottom: 52px; }
.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── GRID ── */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ── CARD ── */
.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(.22,.68,0,1.2), box-shadow 0.35s ease, border-color 0.3s;
  opacity: 0;
  transform: translateY(30px);
}
.card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(.22,.68,0,1.1),
              box-shadow 0.35s ease, border-color 0.3s;
}
.card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,200,66,0.35);
  border-color: rgba(245,200,66,0.45);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Card Number Badge */
.card-number {
  position: absolute;
  top: 14px; left: 14px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #1a1000;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 3;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* Poster Wrapper */
.card-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--navy-3);
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(.22,.68,0,1.1);
}
.card:hover .card-poster { transform: scale(1.06); }

/* Hover Overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 7, 20, 0.85) 0%,
    rgba(124, 92, 252, 0.3) 50%,
    transparent 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.card:hover .card-overlay { opacity: 1; }

/* ── LIKE BUTTON ── */
.like-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 10, 30, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.like-btn:hover {
  background: rgba(255, 60, 100, 0.22);
  border-color: rgba(255, 80, 120, 0.55);
  transform: scale(1.06);
}
.like-btn:active { transform: scale(0.92); }

/* Heart icon */
.like-heart {
  font-size: 1.05rem;
  line-height: 1;
  color: rgba(255,255,255,0.75);
  transition: color 0.25s, transform 0.25s;
  display: inline-block;
}

/* Liked state */
.like-btn.liked {
  background: rgba(220, 30, 70, 0.28);
  border-color: rgba(255, 80, 120, 0.7);
}
.like-btn.liked .like-heart {
  color: #ff4d6d;
  text-shadow: 0 0 10px rgba(255, 77, 109, 0.7);
}

/* Pop animation when toggling */
.like-btn.pop .like-heart {
  animation: heart-pop 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes heart-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.55) rotate(-12deg); }
  55%  { transform: scale(0.9)  rotate(6deg); }
  75%  { transform: scale(1.2)  rotate(-4deg); }
  100% { transform: scale(1)    rotate(0deg); }
}

/* Like count badge */
.like-count {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.9);
  min-width: 14px;
  text-align: center;
  transition: color 0.25s;
}
.like-btn.liked .like-count { color: #ff8fa3; }

/* Floating heart particle */
.heart-float {
  position: absolute;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 20;
  animation: float-heart 0.85s ease-out forwards;
  user-select: none;
}
@keyframes float-heart {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 0.8; transform: translateY(-38px) scale(1.3); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.7); }
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateY(12px);
  transition: transform 0.35s ease;
}
.card:hover .overlay-content { transform: translateY(0); }

.overlay-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.8));
}
.overlay-text {
  background: var(--gold);
  color: #1a1000;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 30px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 18px rgba(245,200,66,0.4);
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  transition: background 0.3s;
}
.card:hover .card-footer { background: #1e1e50; }

.card-emoji { font-size: 1.5rem; flex-shrink: 0; }

.card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-name {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.card-url {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-arrow {
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.card:hover .card-arrow { transform: translateX(4px); }

/* ── FOOTER ── */
.footer {
  position: relative;
  z-index: 1;
  background: var(--navy-2);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-emoji { font-size: 2rem; }
.footer-school { font-weight: 700; font-size: 0.95rem; color: var(--gold-light); }
.footer-tagline { font-size: 0.75rem; color: var(--text-muted); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; }

/* ══════════════════════════════════════════════
   LEADERBOARD
══════════════════════════════════════════════ */
.leaderboard {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(245,200,66,0.07), rgba(124,92,252,0.07));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  min-height: 58px;
}
.lb-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.lb-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}
.lb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 5px 12px 5px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  transition: background 0.2s;
  cursor: default;
}
.lb-item:hover { background: rgba(245,200,66,0.1); }
.lb-rank { font-size: 1rem; }
.lb-item-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-item-count { color: #ff8fa3; font-size: 0.7rem; }
.lb-empty { color: var(--text-muted); font-size: 0.8rem; font-weight: 400; background: none; border: none; }

/* ══════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════ */
.search-wrap {
  margin-bottom: 28px;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0 16px;
  transition: border-color 0.25s, box-shadow 0.25s;
  max-width: 480px;
  margin: 0 auto;
}
.search-box:focus-within {
  border-color: rgba(245,200,66,0.55);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.1);
}
.search-icon { font-size: 1rem; flex-shrink: 0; opacity: 0.6; }
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  padding: 12px 10px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  display: none;
  line-height: 1;
  transition: color 0.2s;
}
.search-clear:hover { color: var(--gold); }
.search-clear.visible { display: block; }
.search-result {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 18px;
}

/* Card hidden by search */
.card.hidden-search {
  display: none;
}

/* ══════════════════════════════════════════════
   LIGHTBOX MODAL
══════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 18, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lb-modal {
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  transform: scale(0.88) translateY(20px);
  transition: transform 0.35s cubic-bezier(.22,.68,0,1.15);
}
.lightbox.open .lb-modal {
  transform: scale(1) translateY(0);
}
.lb-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 5;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.lb-close:hover { background: rgba(255,60,80,0.5); transform: scale(1.1); }
.lb-img-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--navy-3);
  flex-shrink: 0;
  max-height: 68vh;
}
.lb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.lb-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.lb-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.lb-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #1a1000;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 30px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(245,200,66,0.35);
}
.lb-visit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(245,200,66,0.5);
}

/* ══════════════════════════════════════════════
   BACK TO TOP BUTTON
══════════════════════════════════════════════ */
.back-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 500;
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--accent), var(--gold-dark));
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(16px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.back-top:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
}
.back-top:active { transform: scale(0.94); }



/* Tablet */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Large Mobile */
@media (max-width: 768px) {
  .hero { padding: 60px 16px 100px; min-height: 420px; }
  .hero-stats { gap: 16px; padding: 12px 22px; }
  .stat-num  { font-size: 1.3rem; }
  .main { padding: 36px 12px 60px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .br-desktop { display: none; }
}

/* Small Mobile ≤ 480px → tetap 2 kolom, card footer lebih ringkas */
@media (max-width: 480px) {
  .hero { padding: 50px 14px 90px; min-height: 380px; }
  .hero-stats { gap: 12px; padding: 10px 18px; }
  .stat-num   { font-size: 1.1rem; }
  .stat-label { font-size: 0.6rem; }
  .section-title { font-size: 1.5rem; }
  .section-desc  { font-size: 0.82rem; }
  .main { padding: 28px 10px 48px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Card footer ringkas di HP kecil */
  .card-footer { padding: 8px 10px; gap: 6px; }
  .card-emoji  { font-size: 1.1rem; }
  .card-name   { font-size: 0.75rem; }
  .card-url    { font-size: 0.58rem; }
  .card-arrow  { font-size: 0.85rem; }

  /* Nomor badge lebih kecil */
  .card-number { font-size: 0.6rem; padding: 3px 7px; top: 8px; left: 8px; }

  /* Like button di mobile */
  .like-btn { bottom: 8px; right: 8px; padding: 5px 9px 5px 7px; gap: 4px; }
  .like-heart { font-size: 0.9rem; }
  .like-count { font-size: 0.65rem; }

  /* Overlay selalu sedikit kelihatan di touch device (no hover) */
  .card-overlay {
    background: linear-gradient(
      to top,
      rgba(7, 7, 20, 0.7) 0%,
      transparent 50%
    );
    opacity: 1;
    align-items: flex-end;
    padding-bottom: 8px;
  }
  .overlay-content { transform: translateY(0); flex-direction: row; gap: 6px; }
  .overlay-icon  { font-size: 1rem; }
  .overlay-text  { font-size: 0.6rem; padding: 4px 10px; }
}

/* Very small (≤ 360px) */
@media (max-width: 360px) {
  .grid { gap: 8px; }
  .card-footer { padding: 6px 8px; }
  .card-name   { font-size: 0.7rem; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }
