/* ======================================================
   CUTIE MENU ✨ — Sidebar + Content, Full-Height
   ====================================================== */

:root {
  --pink:      #FF7B9C;
  --pink-dk:   #FF4D7A;
  --pink-lt:   #FFB6C1;
  --tx:        #3E2535;
  --tx-dim:    #7A5A6A;
  --tx-fade:   #A08090;
  --tx-title:  #6B3A5A;
  --bg:        linear-gradient(160deg, #FDE8F0 0%, #FBCAD9 30%, #F9A8C4 60%, #FBCAD9 85%, #FDE8F0 100%);
  --glass:     rgba(255,255,255,0.72);
  --border:    rgba(255,150,180,0.28);
  --radius:    16px;
  --shadow:    0 2px 16px rgba(255,100,140,0.09);
  --shadow-hi: 0 6px 28px rgba(255,100,140,0.16);
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 260px;
  --hdr-h:     60px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; height: 100%; }
body {
  font-family: 'Nunito','Quicksand',sans-serif;
  background: var(--bg); background-attachment: fixed;
  height: 100%; min-height: 100vh; color: var(--tx);
  display: flex; flex-direction: column;
}

/* ---- Sparkles ---- */
.sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.s-dot {
  position: absolute; font-size: 13px; user-select: none;
  animation: f 7s ease-in-out infinite; will-change: transform,opacity;
}
@keyframes f {
  0%,100%{transform:translateY(0) rotate(0deg);opacity:.25}
  30%{opacity:.55}
  50%{transform:translateY(-35px) rotate(200deg);opacity:.35}
  70%{opacity:.55}
}

/* ========== HEADER ========== */
.hdr {
  position: sticky; top: 0; z-index: 30; flex-shrink: 0;
  background: rgba(255,220,235,.65); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border); padding: 0 24px;
  height: var(--hdr-h); display: flex; align-items: center;
}
.hdr-inner {
  width: 100%; max-width: 100%;
  display: flex; align-items: center; gap: 14px;
}
.hdr-brand  { display: flex; align-items: center; gap: 10px; }
.hdr-mascot { width: 40px; height: 52px; flex-shrink: 0; animation: b 3.5s ease-in-out infinite; }
.hdr-title  {
  font-family: 'Pacifico',cursive; font-size: clamp(1.2rem,2.2vw,1.5rem);
  color: var(--tx-title); letter-spacing: 1px; white-space: nowrap;
}
.hdr-title .spin { display: inline-block; animation: sp 3s linear infinite; }
.hdr-sub {
  font-weight: 600; font-size: .8rem; color: var(--tx-dim);
  margin-left: auto; white-space: nowrap;
}
@keyframes b  { 0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)} }
@keyframes sp { 50%{transform:rotate(180deg) scale(1.2)}100%{transform:rotate(360deg) scale(1)} }

/* hamburger (mobile only) */
.hdr-menu {
  display: none; flex-shrink: 0;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
  flex-direction: column; gap: 4px; z-index: 60;
}
.hdr-menu span { display: block; width: 18px; height: 2px; background: var(--tx-title); border-radius: 2px; transition: .25s; }
.hdr-menu.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr-menu.open span:nth-child(2) { opacity: 0; }
.hdr-menu.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ========== BODY (sidebar + content) ========== */
.body {
  flex: 1; display: flex; min-height: 0;
  /* fills remaining height below header */
  height: calc(100vh - var(--hdr-h));
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--glass); backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  padding: 16px 20px 12px; font-family: 'Pacifico',cursive;
  font-size: 1.05rem; color: var(--tx-title); flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255,210,225,.25);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-search {
  position: relative; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-input {
  width: 100%; padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(6px);
  font-family: 'Nunito',sans-serif; font-size: .82rem; font-weight: 600;
  color: var(--tx); outline: none; transition: border .2s;
}
.search-input::placeholder { color: var(--tx-fade); font-weight: 500; }
.search-input:focus { border-color: var(--pink); }
.search-icon {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: .72rem; color: var(--tx-fade); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  padding: 2px 4px;
}
.search-icon.visible { opacity: 1; pointer-events: auto; }
.search-icon:hover { color: var(--pink); }

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 4px 0;
  scrollbar-width: thin; scrollbar-color: var(--pink-lt) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--pink-lt); border-radius: 4px; }

/* -- nav item -- */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 18px; border: none; background: transparent;
  font-family: 'Nunito',sans-serif; font-size: .88rem; font-weight: 700;
  color: var(--tx-dim); text-align: left; cursor: pointer; transition: .18s ease;
  animation: navIn .3s var(--ease) both;
}
.nav-item::before { content: '♡'; color: var(--pink); font-size: .82rem; flex-shrink: 0; }
.nav-item:hover  { background: rgba(255,180,195,.2); color: var(--tx-title); }
.nav-item.active { background: linear-gradient(90deg, rgba(255,123,156,.22), rgba(255,180,195,.06)); color: var(--tx-title); box-shadow: inset 3px 0 0 var(--pink); }
.nav-item.active::before { content: '❤️'; }

/* staggered nav entrance */
.nav-item:nth-child(1) { animation-delay: .03s }
.nav-item:nth-child(2) { animation-delay: .06s }
.nav-item:nth-child(3) { animation-delay: .09s }
.nav-item:nth-child(4) { animation-delay: .12s }
.nav-item:nth-child(5) { animation-delay: .15s }
.nav-item:nth-child(6) { animation-delay: .18s }
.nav-item:nth-child(7) { animation-delay: .21s }
.nav-item:nth-child(8) { animation-delay: .24s }
.nav-item:nth-child(n+9) { animation-delay: .27s }
@keyframes navIn { from{opacity:0;transform:translateX(-16px)}to{opacity:1;transform:translateX(0)} }

/* -- skeleton nav -- */
.skel-nav {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
}
.skel-nav .skel-bullet { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; }
.skel-nav .skel-text   { flex: 1; height: 12px; border-radius: 6px; }
.skel-bar {
  background: linear-gradient(90deg, rgba(255,180,200,.25) 25%, rgba(255,210,225,.5) 50%, rgba(255,180,200,.25) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer { 0%{background-position:200% 0}100%{background-position:-200% 0} }

/* ========== CONTENT ========== */
.content {
  flex: 1; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--pink-lt) transparent;
}
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb { background: var(--pink-lt); border-radius: 5px; }

.detail {
  height: 100%; display: flex;
}

/* Empty state */
.detail-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 10px;
  animation: fIn .5s ease;
}
.detail-empty .empty-icon { font-size: 3.5rem; animation: b 2.2s ease-in-out infinite; }
.detail-empty h2 { font-family: 'Pacifico',cursive; font-size: 1.7rem; color: var(--tx-title); }
.detail-empty p  { font-size: .95rem; color: var(--tx-dim); font-weight: 600; max-width: 300px; line-height: 1.6; }

/* Detail card */
.detail-card {
  flex: 1; display: flex; flex-direction: column;
  background: var(--glass); backdrop-filter: blur(12px);
  border-radius: var(--radius); margin: 20px;
  padding: 28px 30px 22px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: fIn .35s var(--ease); min-height: 0;
}
.detail-title {
  font-size: 1.15rem; font-weight: 800; color: var(--tx);
  padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 1.5px dashed rgba(255,150,180,.35);
  display: flex; align-items: center; gap: 8px;
}
.detail-title::before { content: '🎀'; font-size: 1rem; }
.detail-body {
  flex: 1; font-family: 'Quicksand',sans-serif; font-size: .92rem;
  line-height: 1.8; color: var(--tx-dim); min-height: 0;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  background: rgba(255,235,242,.35); border-radius: 12px;
  padding: 16px 18px; border: 1px solid rgba(255,150,180,.15);
  margin-bottom: 16px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--pink-lt) transparent;
}
.detail-body::-webkit-scrollbar { width: 5px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--pink-lt); border-radius: 5px; }

/* Copy btn */
.copy-btn {
  align-self: flex-end; padding: 9px 22px; font-size: .82rem;
  background: linear-gradient(135deg, var(--pink-lt), var(--pink));
  color: #fff; border: none; border-radius: 50px;
  font-family: 'Nunito',sans-serif; font-weight: 700; cursor: pointer;
  transition: all .2s ease; box-shadow: 0 2px 10px rgba(255,123,156,.2);
  display: flex; align-items: center; gap: 5px;
}
.copy-btn::before { content: '📋'; font-size: .82rem; }
.copy-btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow-hi); filter: brightness(1.08); }
.copy-btn:active { transform: scale(.97); }
.copy-btn.copied { background: linear-gradient(135deg, #7BC89C, #5EB87A); }
.copy-btn.copied::before { content: '✅'; }

/* ========== ERROR ========== */
.state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 10px;
  padding: 60px 20px; animation: fIn .4s ease; height: 100%;
}
.state-emoji { font-size: 4rem; animation: sw 2s ease-in-out infinite; }
.state h2    { font-family: 'Pacifico',cursive; font-size: 1.8rem; color: #C05070; }
.state p     { font-size: .95rem; color: var(--tx-fade); max-width: 380px; line-height: 1.6; }
.btn-retry {
  margin-top: 6px; padding: 11px 28px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dk));
  color: #fff; border: none; border-radius: 50px;
  font-family: 'Nunito',sans-serif; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: .25s; box-shadow: 0 3px 14px rgba(255,77,122,.25);
}
.btn-retry:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,77,122,.35); }
.btn-retry:active { transform: scale(.97); }
@keyframes sw { 0%,100%{transform:rotate(0)}25%{transform:rotate(-8deg)}75%{transform:rotate(8deg)} }

/* ========== MOBILE ========== */
.m-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.25);
  z-index: 50; animation: fIn .15s ease;
}
/* mobile sidebar — slides over */
.hdr-menu { display: none; }

@media (max-width: 800px) {
  .hdr-menu { display: flex; }
  .hdr-sub  { display: none; }
  .hdr      { padding: 0 14px; }
  .hdr-mascot { width: 32px; height: 42px; }

  .body { height: calc(100vh - var(--hdr-h)); position: relative; }

  /* hide desktop sidebar */
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: min(78vw, 280px); height: 100vh; z-index: 55;
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
  .m-overlay    { display: block; }

  .detail-card { margin: 12px; padding: 18px 16px 14px; border-radius: 12px; }
  .detail-body { font-size: .85rem; }
  .detail-empty h2 { font-size: 1.4rem; }
  .detail-empty p  { font-size: .88rem; }
}

@media (max-width: 480px) {
  .detail-card   { padding: 14px 12px 12px; margin: 8px; }
  .detail-title  { font-size: 1rem; }
  .detail-body   { font-size: .82rem; padding: 12px; }
  .copy-btn      { padding: 8px 16px; font-size: .76rem; }
  .toast         { font-size: .8rem; padding: 10px 18px; bottom: 20px; }
}

/* ========== TOAST ========== */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: linear-gradient(135deg, #7BC89C, #5EB87A);
  color: #fff; padding: 12px 26px; border-radius: 50px;
  font-family: 'Nunito',sans-serif; font-size: .9rem; font-weight: 700;
  box-shadow: 0 4px 20px rgba(94,184,122,.3); z-index: 100;
  opacity: 0; pointer-events: none; transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== UTIL ========== */
.hidden { display: none !important; }
@keyframes fIn { from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)} }
button:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
