/* ==========================================================================
   Ada çubuğu (sayfa içi gezinti kapsülü) — js/interactive-craft.js
   Kapalıyken: etkin bölüm + kaydırma yüzdesi + "3 / 7" sayacı.
   Açıkken: bölüm atlama düğmeleri ve beş kısa eylem.
   ========================================================================== */

.apple-dynamic-island {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 64;
  min-width: 268px;
  max-width: min(92vw, 520px);
  border-radius: 26px;
  background: rgba(18, 18, 22, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: saturate(190%) blur(24px);
  -webkit-backdrop-filter: saturate(190%) blur(24px);
  color: #f5f5f7;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26), 0 2px 8px rgba(0, 0, 0, 0.14);
  padding: 6px 14px;
  transition: background-color 0.38s var(--ease-out), color 0.38s var(--ease-out), border-color 0.38s var(--ease-out), box-shadow 0.38s var(--ease-out), transform 0.38s var(--ease-out);
  user-select: none;
}

.apple-dynamic-island:hover,
.apple-dynamic-island.expanded {
  border-color: rgba(41, 151, 255, 0.45);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(41, 151, 255, 0.18);
}

.di-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 999px;
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.di-left,
.di-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.di-left #di-section-label {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.di-pulse-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 10px #30d158;
}

.di-scroll-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #a1d2ff;
}

.di-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #30d158;
}

.di-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.38s var(--ease-out), opacity 0.25s ease, margin-top 0.28s ease, visibility 0s linear 0.38s;
}

.apple-dynamic-island.expanded .di-drawer {
  max-height: 360px;
  opacity: 1;
  visibility: visible;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transition-delay: 0s;
}

.di-group-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(245, 245, 247, 0.55);
}

.di-actions-grid {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.di-actions-grid + .di-group-label {
  margin-top: 10px;
}

.di-action-btn {
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.di-action-btn:hover {
  background: #0071e3;
  border-color: #2997ff;
  color: #ffffff;
}

.di-action-btn[aria-current="true"],
.di-action-btn[aria-pressed="true"] {
  background: rgba(41, 151, 255, 0.28);
  border-color: rgba(41, 151, 255, 0.7);
  color: #ffffff;
}

.di-action-btn[hidden] {
  display: none;
}

/* Klavye odağı: görünür halka */
.apple-dynamic-island button:focus-visible {
  outline: 2px solid #2997ff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .apple-dynamic-island,
  .di-drawer,
  .di-action-btn {
    transition: none;
  }
}

@media (max-width: 760px) {
  .apple-dynamic-island {
    display: none;
  }
}
