/* ═══════════════════════════════════════════
   COMMON.CSS  —  Lavender Dream Theme
   ═══════════════════════════════════════════ */

:root {
  --c-primary:        #9B70D0;
  --c-primary-dark:   #7350A8;
  --c-accent:         #C070E0;
  --c-pink:           #E090C8;
  --c-blue:           #90A8E8;
  --c-grad-start:     #C280EC;
  --c-grad-end:       #8A58C8;
  --c-bg-solid:       #EDE6F5;
  --c-text:           #3D2860;
  --c-text-mid:       #6A4A90;
  --c-text-light:     #9878B8;
  --c-card:           rgba(255,255,255,0.82);
  --c-card-border:    rgba(180,140,220,0.25);
  --c-nav:            rgba(218,195,248,0.92);
  --c-cats:           rgba(240,232,255,0.90);
  --shadow-sm:        0 2px 12px rgba(140,90,210,0.12);
  --shadow-md:        0 4px 24px rgba(120,70,190,0.18);
  --shadow-lg:        0 8px 32px rgba(100,50,170,0.22);
  --radius-sm:        10px;
  --radius-md:        14px;
  --radius-lg:        20px;
  --radius-xl:        28px;
  --nav-h:            54px;
  --cats-h:           50px;
}

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

html {
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background: url('../img/bg.webp') center center / cover fixed;
  background-color: var(--c-bg-solid);
  color: var(--c-text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; }
a { text-decoration: none; }
[v-cloak] { display: none !important; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: rgba(160,110,220,0.35); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(50,20,80,0.38);
  z-index: 199;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

.sidebar {
  position: fixed;
  top: 0; left: -270px;
  width: 252px; height: 100vh;
  background: rgba(244,236,255,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 200;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 28px rgba(90,50,150,0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(200,160,240,0.25);
}
.sidebar.open { left: 0; }

.sidebar-top {
  height: 68px;
  background: linear-gradient(135deg, var(--c-grad-start), var(--c-grad-end));
  display: flex; align-items: center;
  padding: 0 20px;
  font-size: 1.15rem; font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 20px;
}

.sidebar-item {
  display: flex; align-items: center;
  padding: 12px 20px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--c-text-mid);
  cursor: pointer;
  border-radius: 0 50px 50px 0;
  margin-right: 14px;
  transition: background 0.18s, color 0.18s;
  user-select: none;
}
.sidebar-item:hover {
  background: rgba(180,120,240,0.12);
  color: var(--c-accent);
}
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(194,128,236,0.2), rgba(138,88,200,0.14));
  color: var(--c-primary-dark);
  font-weight: 700;
}
.sidebar-item span { display: flex; align-items: center; gap: 8px; }

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--c-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 100;
  border-bottom: 1px solid rgba(200,160,240,0.35);
  box-shadow: 0 2px 16px rgba(130,70,200,0.13);
}

.navbar-inner {
  max-width: 640px;
  margin: 0 auto;
  height: 100%;
  display: flex; align-items: center;
  padding: 0 10px;
  gap: 8px;
}

.navbar-left {
  display: flex; align-items: center;
  flex-shrink: 0;
  gap: 4px;
}

/* Hamburger */
.hamburger {
  width: 40px; height: 40px;
  border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; padding: 6px;
  border-radius: 10px;
  transition: background 0.18s;
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(255,255,255,0.45); }
.hamburger:active { background: rgba(180,120,240,0.2); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--c-text);
  border-radius: 2px; transition: all 0.22s;
}

/* Back arrow in navbar (info page) */
.navbar-left button.hamburger svg path { fill: var(--c-text); }

/* Brand */
.brand { display: flex; align-items: center; }
.navbar-brand-name {
  font-size: 1.05rem; font-weight: 800;
  color: var(--c-text);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.navbar-center {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
}

.nav-page-title {
  font-size: 0.95rem; font-weight: 700;
  color: var(--c-text);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  max-width: 200px;
}

/* ── Search Bar ── */
.searchbar {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.78);
  border: 1.5px solid rgba(180,130,220,0.32);
  border-radius: 50px;
  overflow: hidden;
  width: 100%;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.searchbar:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(155,112,208,0.16);
  background: rgba(255,255,255,0.95);
}
.searchbar-input {
  flex: 1; min-width: 0;
  border: none; background: none; outline: none;
  padding: 8px 12px;
  font-size: 0.83rem;
  color: var(--c-text);
}
.searchbar-input::placeholder { color: var(--c-text-light); }
.searchbar-btn {
  border: none; background: none; cursor: pointer;
  padding: 8px 12px;
  color: var(--c-text-mid);
  display: flex; align-items: center;
  transition: color 0.18s;
  flex-shrink: 0;
}
.searchbar-btn:hover { color: var(--c-accent); }

/* ══════════════════════════════════════════
   CATEGORY CHIPS BAR
══════════════════════════════════════════ */
.cats-bar {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  height: var(--cats-h);
  z-index: 90;
  background: var(--c-cats);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(190,145,230,0.22);
}

.cats-scroll {
  height: 100%;
  display: flex; align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding: 0 12px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  white-space: nowrap;
}
.cats-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  height: 32px;
  border: 1.5px solid rgba(175,125,220,0.30);
  background: rgba(255,255,255,0.72);
  color: var(--c-text-mid);
  border-radius: 50px;
  padding: 0 13px;
  font-size: 0.78rem; font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex; align-items: center; gap: 3px;
}
.cat-chip:hover {
  background: rgba(200,155,245,0.22);
  border-color: var(--c-primary);
  color: var(--c-primary-dark);
}
.cat-chip.active {
  background: linear-gradient(135deg, var(--c-grad-start), var(--c-grad-end));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(150,80,220,0.32);
}

/* ══════════════════════════════════════════
   SHARED SECTION HEADER
══════════════════════════════════════════ */
.sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 10px;
}
.sec-title {
  font-size: 0.98rem; font-weight: 700; color: var(--c-text);
}
.sec-more {
  border: none; background: none; cursor: pointer;
  font-size: 0.78rem; font-weight: 600; color: var(--c-primary);
  padding: 4px 8px; border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
.sec-more:hover { background: rgba(155,112,208,0.12); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  margin-top: 24px;
  padding: 18px 16px 24px;
  text-align: center;
  background: rgba(240,232,255,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(190,145,230,0.22);
}
.footer-brand {
  font-size: 0.9rem; font-weight: 700;
  color: var(--c-text-mid);
  margin-bottom: 8px;
}
.footer-links {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--c-text-light);
}
.footer-links a {
  color: var(--c-text-mid);
  transition: color 0.18s;
}
.footer-links a:hover { color: var(--c-accent); }
.footer-copy {
  font-size: 0.7rem; color: var(--c-text-light);
  margin-top: 8px;
}

/* ══════════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════════ */
.loading {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 9px;
  background: rgba(237,230,245,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
}
.sk-child {
  width: 13px; height: 13px;
  border-radius: 50%;
  animation: sk-bounce 1.4s infinite ease-in-out both;
}
.sk-bounce1 { background: var(--c-grad-start); animation-delay: -0.32s; }
.sk-bounce2 { background: var(--c-primary);    animation-delay: -0.16s; }
@keyframes sk-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40%            { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════
   BACK TO TOP
══════════════════════════════════════════ */
.back-top {
  position: fixed;
  bottom: 22px; right: 14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-grad-start), var(--c-grad-end));
  color: #fff; border: none; cursor: pointer;
  font-size: 1.1rem; font-weight: 700;
  box-shadow: 0 4px 18px rgba(130,70,200,0.38);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 80;
}
.back-top:hover  { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(130,70,200,0.48); }
.back-top:active { transform: scale(0.93); }

/* ══════════════════════════════════════════
   RESPONSIVE — max 640px content width
══════════════════════════════════════════ */
@media (min-width: 641px) {
  .navbar-inner { padding: 0 20px; }
}
