/* ============================================================
   LINH CHI  —  Apple App Store layout x sakura kawaii
   ============================================================ */

:root {
  --bg: #f6f3f3;
  --ink: #1d1d1f;          /* gần đen kiểu Apple */
  --ink-soft: #515154;
  --ink-faint: #86868b;
  --accent: #e8688a;       /* sakura rose */
  --accent-deep: #d24f70;
  --accent-soft: #ffe3ea;
  --card: #ffffff;
  --hairline: rgba(0, 0, 0, 0.08);
  --get-bg: #efedf0;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 26px rgba(120, 80, 95, 0.08);
  --shadow-2: 0 2px 5px rgba(0, 0, 0, 0.06), 0 20px 44px rgba(120, 80, 95, 0.16);
  --r-lg: 20px;
  --r-md: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 84% -6%, #ffe4ec 0%, transparent 56%),
    radial-gradient(760px 440px at 8% 4%, #fff0d8 0%, transparent 52%),
    linear-gradient(180deg, #fdf2f4 0%, var(--bg) 38%, var(--bg) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.025em; }
a { color: inherit; text-decoration: none; }
.ic { display: block; }

/* ---------- Cánh hoa anh đào (rất nhẹ) ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.petals span {
  position: absolute; top: -8%; width: 13px; height: 10px;
  background: radial-gradient(circle at 30% 30%, #ffd9e3, #f5acc3);
  border-radius: 12px 1px 12px 1px; opacity: 0.55;
  animation: fall linear infinite;
}
.petals span:nth-child(1)  { left: 7%;  animation-duration: 15s; animation-delay: 0s;   transform: scale(1); }
.petals span:nth-child(2)  { left: 17%; animation-duration: 19s; animation-delay: -4s;  transform: scale(.7); }
.petals span:nth-child(3)  { left: 28%; animation-duration: 17s; animation-delay: -9s;  transform: scale(.9); }
.petals span:nth-child(4)  { left: 39%; animation-duration: 21s; animation-delay: -6s;  transform: scale(.6); }
.petals span:nth-child(5)  { left: 50%; animation-duration: 16s; animation-delay: -12s; transform: scale(1.05); }
.petals span:nth-child(6)  { left: 61%; animation-duration: 20s; animation-delay: -3s;  transform: scale(.75); }
.petals span:nth-child(7)  { left: 71%; animation-duration: 18s; animation-delay: -10s; transform: scale(.95); }
.petals span:nth-child(8)  { left: 81%; animation-duration: 22s; animation-delay: -7s;  transform: scale(.6); }
.petals span:nth-child(9)  { left: 90%; animation-duration: 15.5s; animation-delay: -14s; transform: scale(.9); }
.petals span:nth-child(10) { left: 96%; animation-duration: 19.5s; animation-delay: -5s; transform: scale(.7); }
@keyframes fall {
  0%   { top: -8%;  opacity: 0; transform: translateX(0) rotate(0deg); }
  12%  { opacity: .6; }
  88%  { opacity: .6; }
  100% { top: 108%; opacity: 0; transform: translateX(36px) rotate(360deg); }
}

/* ---------- Layout ---------- */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 248px 1fr;
  max-width: 1180px; margin: 0 auto; min-height: 100vh;
  padding: 18px; gap: 22px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 18px; align-self: start; height: calc(100vh - 36px);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-logo {
  width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(140deg, #ffe6ee, #ffd0de);
  border: 1px solid rgba(236, 104, 138, .2); border-radius: 22%;
}
.brand-text strong { font-size: 17px; display: block; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.brand-text small { color: var(--accent-deep); font-weight: 600; font-size: 11px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(118, 118, 128, 0.09);
  border: 1px solid transparent; border-radius: 11px; padding: 8px 12px;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.search:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(236,104,138,.14); }
.search-icon { color: var(--ink-faint); flex-shrink: 0; }
.search input { border: none; background: none; outline: none; width: 100%; font: inherit; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--ink-faint); }

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; margin: 4px -4px 0; padding: 0 4px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft);
  text-align: left; padding: 8px 10px; border-radius: 9px; width: 100%;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(216,79,112,.3); }
.nav-item.active .nav-emoji { filter: drop-shadow(0 0 0 #fff); }
.nav-emoji { width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; }
.nav-emoji .ic {
  border-radius: 22%;
}
.nav-sub { font-size: 13px; padding: 7px 10px 7px 44px; color: var(--ink-faint); font-weight: 600; position: relative; }
.nav-sub::before {
  content: ""; position: absolute; left: 28px; top: 50%; width: 5px; height: 5px;
  transform: translateY(-50%); border-radius: 50%; background: var(--accent); opacity: .5;
}
.nav-sub:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.nav-sub.active { background: none; color: var(--accent-deep); box-shadow: none; }

.sidebar-foot { margin-top: auto; }
.kitty-frame {
  border-radius: var(--r-md); overflow: hidden; aspect-ratio: 5/4;
  box-shadow: var(--shadow-1); background: #ffe6ee; position: relative;
}
.kitty-frame::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.kitty-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; display: block; }
.kitty-caption { font-size: 11px; color: var(--ink-faint); font-weight: 600; margin-top: 7px; text-align: center; }

/* ---------- Content ---------- */
.content { min-width: 0; padding: 4px 6px 10px; }

/* Hero — thẻ kiểu "Today" */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(118deg, #ffdde7 0%, #ffeede 50%, #eaf6e0 100%);
  border-radius: 24px; padding: 38px 40px; margin-bottom: 34px;
  box-shadow: var(--shadow-1);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 196px;
}
.hero-eyebrow { font-weight: 700; letter-spacing: 1.4px; font-size: 12px; color: var(--accent-deep); margin-bottom: 8px; }
.hero h1 { font-size: 38px; line-height: 1.06; margin-bottom: 12px; color: #2a2024; }
.hero-sub { color: var(--ink-soft); max-width: 430px; font-weight: 500; font-size: 15px; line-height: 1.5; }

.hero-art { position: relative; width: 220px; height: 156px; flex-shrink: 0; align-self: stretch; }
.hero-hill {
  position: absolute; bottom: -60px; right: -26px; width: 240px; height: 240px;
  background: radial-gradient(circle at 50% 30%, #a8d98f, #5fa86a); border-radius: 46%;
}
.hero-art span { position: absolute; filter: drop-shadow(0 3px 5px rgba(0,0,0,.14)); }
.ha-sun { top: 0; right: 4px; animation: bob 4.5s ease-in-out infinite; }
.ha-cloud { top: 18px; left: 0; opacity: .92; animation: floatx 9s ease-in-out infinite; }
.ha-sakura { animation: spin 14s linear infinite; }
.ha-s1 { top: 6px; left: 70px; }
.ha-s2 { top: 56px; left: 30px; animation-duration: 18s; }
.ha-torii { bottom: 10px; right: 40px; }
.ha-cat { bottom: 14px; right: 128px; animation: bob 5s ease-in-out infinite .5s; }
@keyframes bob { 50% { transform: translateY(-7px); } }
@keyframes floatx { 50% { transform: translateX(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Kệ section (shelf) */
.shelf { margin-bottom: 36px; scroll-margin-top: 16px; }
.shelf-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 13px; margin-bottom: 16px; border-bottom: 1px solid var(--hairline);
}
.shelf-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; letter-spacing: .4px; font-size: 12px; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 4px;
}
.shelf-eyebrow .ic { width: 16px; height: 16px; }
.shelf-head h2 { font-size: 25px; line-height: 1.08; }
.shelf-desc { color: var(--ink-faint); font-weight: 500; font-size: 13.5px; margin-top: 3px; }
.shelf-count { color: var(--ink-faint); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* Lưới cell */
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0 28px; }

.cell {
  display: flex; align-items: center; gap: 14px; padding: 13px 8px;
  border-bottom: 1px solid var(--hairline); border-radius: 12px;
  transition: background .15s;
}
.cell:hover { background: rgba(0, 0, 0, 0.03); }

.cell-icon {
  width: 62px; height: 62px; flex-shrink: 0; border-radius: 22%;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}

.cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cell-title { font-weight: 600; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { font-size: 13px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cell-tag { font-size: 11px; color: var(--accent-deep); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }

.get-btn {
  flex-shrink: 0; background: var(--get-bg); color: var(--accent-deep);
  font-weight: 800; font-size: 13px; letter-spacing: .3px; text-transform: uppercase;
  padding: 7px 22px; border-radius: 999px;
  transition: background .15s, color .15s, transform .1s;
}
.cell:hover .get-btn { background: var(--accent); color: #fff; }
.cell:active .get-btn { transform: scale(.94); }

/* Placeholder cho chủ đề trống */
.placeholder {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  color: var(--ink-faint); font-weight: 600; font-size: 14px;
  border: 1.5px dashed rgba(236, 104, 138, 0.3); border-radius: var(--r-md);
  padding: 26px; background: rgba(255, 255, 255, 0.5);
}
.placeholder .ic { width: 26px; height: 26px; }

/* Empty (tìm kiếm không ra) */
.empty { text-align: center; color: var(--ink-soft); padding: 60px 0; font-weight: 600; }
.empty .big { display: inline-block; margin-bottom: 12px; }

.footer { text-align: center; color: var(--ink-faint); font-weight: 600; padding: 24px 0 14px; font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 12px; gap: 14px; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .brand { flex: 1 1 auto; }
  .search { flex: 1 1 200px; order: 3; }
  .nav { flex-direction: row; flex-wrap: wrap; order: 4; flex-basis: 100%; margin: 0; }
  .nav-item { width: auto; }
  .nav-sub { display: none; }
  .sidebar-foot { display: none; }
  .hero { flex-direction: column; align-items: flex-start; padding: 26px 22px; min-height: 0; }
  .hero h1 { font-size: 28px; }
  .hero-art { display: none; }
  .cells { grid-template-columns: 1fr; }
}
