/* ==========================================================================
   KOMPONEN: Header — topbar bermotif hanko, sticky, blur kaca
   ========================================================================== */
.c-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(25, 27, 34, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.c-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.c-header .brand:hover {
  text-decoration: none;
}

.c-header .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 32% 30%, var(--shu-ghost), transparent 72%);
  filter: drop-shadow(0 0 7px rgba(200, 69, 46, 0.35));
  flex-shrink: 0;
}

/* ---- Logo sakura berputar ---- */
.c-header .sakura-logo {
  width: 30px;
  height: 30px;
  transform-origin: 50% 50%;
  will-change: transform;
  animation:
    sakura-spin-intro 1.9s cubic-bezier(0.19, 1, 0.32, 1) 1 both,
    sakura-spin-idle 11s linear infinite;
  animation-delay: 0s, 1.9s;
}

.c-header .brand:hover .sakura-logo {
  animation-duration: 1.9s, 3.2s;
}

@keyframes sakura-spin-intro {
  0% {
    transform: rotate(0deg) scale(0.55);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: rotate(1080deg) scale(1);
    opacity: 1;
  }
}

@keyframes sakura-spin-idle {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .c-header .sakura-logo {
    animation: none;
  }
}
.c-header .brand-text {
  line-height: 1.15;
}
.c-header .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.c-header .brand-sub {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-top: 1px;
}

.c-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Pencarian global (kana/kanji/kosakata/tata bahasa) */
.c-header .header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 360px;
  min-width: 0;
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  transition: border-color var(--dur-fast) var(--ease);
}
.c-header .header-search:focus-within {
  border-color: var(--indigo-light);
  box-shadow: var(--shadow-glow-indigo);
}
.c-header .gs-icon {
  color: var(--text-faint);
  font-size: 13px;
  flex-shrink: 0;
}
.c-header .gs-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
}
.c-header .gs-input::placeholder {
  color: var(--text-ghost);
}
.c-header .gs-input:focus {
  outline: none;
}

.c-header .gs-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.4));
  z-index: calc(var(--z-header) + 1);
  padding: 6px;
}
.c-header .gs-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.c-header .gs-result:hover,
.c-header .gs-result:focus-visible {
  background: var(--indigo-ghost);
  text-decoration: none;
}
.c-header .gs-result-icon {
  font-size: 18px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.c-header .gs-result-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.c-header .gs-result-title {
  font-size: 13.5px;
  font-weight: 600;
}
.c-header .gs-result-subtitle {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-header .gs-result-meta {
  font-size: 10px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  white-space: nowrap;
}
.c-header .gs-empty {
  padding: 10px;
  font-size: 12.5px;
}

@media (max-width: 860px) {
  .c-header .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
}

/* Lencana XP */
.c-header .xp-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gold-dim);
  background: var(--gold-ghost);
}
.c-header .xp-level {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}
.c-header .xp-bar-wrap {
  width: 56px;
  height: 4px;
  background: var(--ink-4);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.c-header .xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-full);
}

/* Lencana streak bergaya hanko */
.c-header .hanko-streak {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.c-header .hanko {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--shu);
  color: var(--washi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  transform: rotate(-6deg);
  box-shadow: 0 0 0 2px rgba(200, 69, 46, 0.25);
}
.c-header .streak-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.c-header .streak-label {
  font-size: 9.5px;
  color: var(--text-faint);
}

/* Tombol ikon (toggle tema, notifikasi, dsb) */
.c-header .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition:
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.c-header .icon-btn:hover {
  border-color: var(--indigo-light);
  color: var(--washi);
  background: var(--indigo-ghost);
}

/* Avatar profil kecil di header */
.c-header .avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-light);
  transition: border-color var(--dur-fast) var(--ease);
}
.c-header .avatar-btn:hover {
  border-color: var(--indigo-light);
}
.c-header .avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
