/* =====================================================================
   LiGaMu UX Redesign v1
   - Header dengan search prominent + dropdown Koleksi
   - Action Hub (Beranda)
   - Bottom Navigation (mobile only)
   - Chat widget conflict resolver
   - Style: konsisten dengan ligamu.css existing
   ===================================================================== */

/* =====================================================================
   1. HEADER REDESIGN
   ===================================================================== */
.site-header-inner {
  gap: 16px;
}
.brand-text { display: none; }
@media (min-width: 1080px) {
  .brand-text { display: block; }
}

/* Nav-link sedikit lebih kompak */
.main-nav { gap: 4px !important; }
.main-nav .nav-link {
  padding: 8px 10px !important;
  font-size: 0.875rem;
}

/* Dropdown "Koleksi" */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.875rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
  background: transparent;
  border: 0;
  font-family: inherit;
}
.nav-dropdown-toggle:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.nav-dropdown-toggle[aria-expanded="true"] {
  background: var(--brand-light);
  color: var(--brand);
}
.nav-dropdown-toggle i {
  font-size: 14px;
  transition: transform 0.2s;
}
.nav-dropdown-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 100;
  display: none;
  animation: ligamu-dropdown-in 0.15s ease-out;
}
@keyframes ligamu-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-menu.is-open { display: block; }

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.875rem;
  transition: background 0.1s;
}
.nav-dropdown-item:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.nav-dropdown-item i {
  font-size: 18px;
  color: var(--brand);
  flex-shrink: 0;
}
.nav-dropdown-item .ndi-body {
  flex: 1;
  min-width: 0;
}
.nav-dropdown-item .ndi-title {
  font-weight: 500;
  line-height: 1.2;
}
.nav-dropdown-item .ndi-sub {
  font-size: 0.6875rem;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* =====================================================================
   3. ACTION HUB (Beranda)
   ===================================================================== */
.action-hub-section {
  padding: 2rem 0 1.5rem;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--accent-gold-light) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.action-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.action-hub-greeting {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.action-hub-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
  color: var(--brand);
  margin: 0;
  letter-spacing: -0.3px;
}
.action-hub-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
  transition: all 0.15s;
}
.action-hub-cta:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.action-hub-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}
@media (max-width: 1024px) {
  .action-hub-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .action-hub-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 8px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.action-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.action-tile-green:hover { border-color: var(--brand); }
.action-tile-purple:hover { border-color: var(--accent-ai); }
.action-tile-gold:hover { border-color: var(--accent-gold); }

.action-tile-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}
.action-tile-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.action-tile-sub {
  font-size: 0.6875rem;
  color: var(--ink-mute);
  margin-top: 3px;
  display: none;
}
@media (min-width: 768px) {
  .action-tile-sub { display: block; }
  .action-tile-icon { font-size: 36px; }
  .action-tile { padding: 20px 12px 16px; }
}

/* =====================================================================
   4. BOTTOM NAVIGATION (mobile only)
   ===================================================================== */
.ligamu-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  justify-content: space-around;
  align-items: stretch;
  box-shadow: 0 -4px 16px rgba(27, 77, 62, 0.08);
}
@media (max-width: 768px) {
  .ligamu-bottom-nav { display: flex; }
  body { padding-bottom: 70px; }
}

.lbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink-mute);
  font-size: 0.625rem;
  font-weight: 500;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
  min-height: 48px;
}
.lbn-item i {
  font-size: 22px;
  line-height: 1;
}
.lbn-item:active {
  background: var(--brand-light);
}
.lbn-item.is-active {
  color: var(--brand);
}
.lbn-item.is-active i {
  transform: scale(1.05);
}

/* Slot AI istimewa (subtle purple tint) */
.lbn-ai i { color: var(--accent-ai); }
.lbn-ai.is-active { color: var(--accent-ai); }
.lbn-ai.is-active i { color: var(--accent-ai); }

/* =====================================================================
   5. CHAT WIDGET POSITIONING (avoid bottom nav overlap)
   ===================================================================== */
@media (max-width: 768px) {
  #ligaChatRoot {
    bottom: 80px !important;
  }
  .liga-panel {
    bottom: 140px !important;
    height: calc(100vh - 160px) !important;
  }
}

/* =====================================================================
   6. MOBILE NAV ADJUSTMENT (kalau hamburger menu kebuka)
   ===================================================================== */

@media (max-width: 768px) {

  .site-header-inner {
    flex-wrap: wrap;
  }
  /* Sembunyikan dropdown koleksi di mobile (sudah tercover di hamburger) */
  .nav-dropdown { display: none; }
}

/* =====================================================================
   7. ACCESSIBILITY
   ===================================================================== */

.lbn-item:focus-visible,
.action-tile:focus-visible,
.lsr-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .action-tile, .lbn-item, .nav-dropdown-menu {
    animation: none !important;
    transition: none !important;
  }
}
