/* ── Modern Floating Pill Dock Navigation (Pinterest-Inspired) ── */

.floating-dock-wrapper {
  position: fixed;
  bottom: 22px;
  bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000; /* Above scanlines and background layers */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
  user-select: none;
  animation: floatingDockIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform;
}

@keyframes floatingDockIn {
  0% {
    transform: translate3d(-50%, 40px, 0) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translate3d(-50%, 0, 0) scale(1);
    opacity: 1;
  }
}

/* ── Main Dark Capsule (True Frosted Glass) ── */
.dock-pill-capsule {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(16, 14, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  padding: 4px;
  box-shadow: 
    0 24px 50px rgba(0, 0, 0, 0.8),
    0 6px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.5);
  height: 54px;
  box-sizing: border-box;
  overflow: hidden;
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  gap: 4px;
}

/* ── Tab Buttons (Self-Contained Expanding Frosted Glass Bubbles) ── */
.dock-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 13px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #9d9da6;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: 
    background-color 0.28s cubic-bezier(0.2, 0.9, 0.2, 1),
    border-color 0.28s cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.2, 0.9, 0.2, 1),
    color 0.22s ease,
    padding 0.28s cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.dock-tab-btn:hover {
  color: #e2e2e8;
}

.dock-tab-btn:active {
  transform: scale(0.95);
}

/* Active State: The button itself is the bubble, ensuring perfect alignment */
.dock-tab-btn.active {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 0 18px 0 14px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dock-tab-btn .dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.dock-tab-btn .dock-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Label Animation: smooth expansion, zero misalignment */
.dock-tab-btn .dock-label {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1;
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  pointer-events: none;
  will-change: max-width, opacity, margin-left;
  transition: 
    max-width 0.28s cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 0.22s ease,
    margin-left 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.dock-tab-btn.active .dock-label {
  max-width: 80px;
  opacity: 1;
  margin-left: 8px;
}

/* ── Detached Golden Amber Action Button (Tactile Specular Glass Jewel) ── */
.dock-action-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f9c262 0%, #f4ae3f 100%);
  color: #121214;
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  box-shadow: 
    0 18px 36px rgba(0, 0, 0, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.45),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 0.22s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.dock-action-fab svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: #141318;
}

.dock-action-fab:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 
    0 22px 42px rgba(0, 0, 0, 0.75),
    0 6px 14px rgba(0, 0, 0, 0.5),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 0.65);
}

.dock-action-fab:active {
  transform: scale(0.92);
}

/* ── Connect & Socials Quick Drawer (Sheet) ── */
.contact-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000; /* Stits on top of floating dock (10000) and all overlays */
  background: rgba(4, 3, 8, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.contact-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.contact-drawer-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(18, 15, 28, 0.98);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  padding: 16px 22px calc(52px + env(safe-area-inset-bottom, 24px));
  box-shadow: 0 -22px 60px rgba(0, 0, 0, 0.9);
  transform: translate3d(0, 105%, 0);
  transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  box-sizing: border-box;
  max-height: 85vh;
  overflow-y: auto;
}

.contact-drawer-overlay.open .contact-drawer-sheet {
  transform: translate3d(0, 0, 0);
}

/* Tuck floating dock away when drawer is open so it never blocks drawer buttons */
body.drawer-open .floating-dock-wrapper {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 35px, 0) scale(0.94);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.drawer-drag-pill {
  width: 42px;
  height: 4.5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  margin: 2px auto 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.drawer-drag-pill:hover {
  background: rgba(255, 255, 255, 0.4);
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.drawer-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.drawer-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(247, 186, 83, 0.5);
}

.drawer-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.drawer-title-group {
  flex: 1;
  min-width: 0;
}

.drawer-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-title-group p {
  font-size: 13px;
  color: #F7BA53;
  margin: 2px 0 0;
  font-family: 'Fira Code', monospace;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.drawer-links-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.2, 0.85, 0.2, 1);
  cursor: pointer;
}

.drawer-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1.5px);
}

.drawer-action-btn:active {
  transform: scale(0.98);
}

.drawer-action-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.drawer-action-btn.btn-insta {
  border-color: rgba(255, 117, 160, 0.25);
  background: linear-gradient(135deg, rgba(255, 117, 160, 0.08), rgba(181, 136, 247, 0.04));
}

.drawer-action-btn.btn-insta:hover {
  border-color: rgba(255, 117, 160, 0.45);
  background: linear-gradient(135deg, rgba(255, 117, 160, 0.14), rgba(181, 136, 247, 0.08));
}

.drawer-action-btn.btn-insta svg {
  color: #ff75a0;
}

.drawer-btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.drawer-btn-text .primary-text {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
}

.drawer-btn-text .secondary-text {
  font-size: 12px;
  color: #a1a1aa;
}

.drawer-arrow {
  color: #a1a1aa;
  font-size: 16px;
  font-weight: 700;
}

.drawer-email-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.drawer-email-row .drawer-action-btn {
  flex: 1;
}

.drawer-action-btn.btn-mail svg {
  color: #7ad1ff;
}

.drawer-copy-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: #dcdce2;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 68px;
}

.drawer-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.drawer-copy-btn:active {
  transform: scale(0.95);
}

.drawer-secondary-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.drawer-nav-jump,
.drawer-admin-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.drawer-nav-jump {
  background: rgba(247, 186, 83, 0.12);
  border: 1px solid rgba(247, 186, 83, 0.28);
  color: #F7BA53;
}

.drawer-nav-jump:hover {
  background: rgba(247, 186, 83, 0.2);
}

.drawer-admin-trigger {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
}

.drawer-admin-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* ── Bottom Ambient Scrim to prevent raw text collision behind dock ── */
.dock-bottom-scrim {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 125px;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(8, 6, 14, 0.96) 0%,
    rgba(8, 6, 14, 0.72) 45%,
    rgba(8, 6, 14, 0.25) 75%,
    transparent 100%
  );
  z-index: 1150;
}

/* ── Mobile Layout Fine-Tuning ── */
@media (max-width: 480px) {
  .floating-dock-wrapper {
    bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    gap: 11px;
  }
  .dock-pill-capsule {
    height: 54px;
    padding: 4px;
  }
  .dock-sliding-pill {
    top: 4px;
    bottom: 4px;
  }
  .dock-tab-btn {
    height: 46px;
    padding: 0 14px;
  }
  .dock-action-fab {
    width: 54px;
    height: 54px;
  }
  .dock-tab-btn.active .dock-label {
    max-width: 78px;
    font-size: 14px;
    margin-left: 8px;
  }
}
