/* ==========================================================================
   E-BOOK ZONE INDIA — FLOATING CYBER-DOCK, LEFT-SWIPE PRO-VAULT & ZEN UI
   File: /assets/css/glass-dock.css (Phase 1 — File 6/30)
   Covers: Floating Glassmorphism Cyber-Dock, Magnetic Hover Physics,
           Left-Swipe Pro-Vault Drawer, Touch Edge Sensor, WebLLM Progress,
           and Distraction-Free (Swipe-to-Hide) Zen Mode Transitions
   ========================================================================== */

/* ==========================================================================
   1. FLOATING GLASSMORPHISM CYBER-DOCK (#cyber-glass-dock)
   ========================================================================== */
.cyber-floating-dock {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 13, 28, 0.78);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(0, 243, 255, 0.32);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.82),
    0 0 28px rgba(0, 243, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, border-color 0.25s ease;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  scrollbar-width: none;
}

.cyber-floating-dock::-webkit-scrollbar {
  display: none;
}

.cyber-floating-dock:hover {
  border-color: rgba(0, 243, 255, 0.55);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.88),
    0 0 36px rgba(0, 243, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Individual Dock Buttons */
.dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-width: 66px;
  height: 56px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary, #b4c6e0);
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  flex-shrink: 0;
}

.dock-icon {
  font-size: 1.22rem;
  line-height: 1;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Magnetic Hover Lift */
.dock-item:hover {
  transform: translateY(-5px) scale(1.05);
  background: rgba(0, 243, 255, 0.1);
  border-color: rgba(0, 243, 255, 0.3);
  color: var(--text-primary, #f2f7ff);
}

.dock-item:hover .dock-icon {
  transform: scale(1.14);
}

/* Active Route Glow & Neon Dot */
.dock-item.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.18) 0%, rgba(176, 38, 255, 0.18) 100%);
  border-color: rgba(0, 243, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(0, 243, 255, 0.22);
}

.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--neon-cyan, #00f3ff);
  box-shadow: 0 0 10px var(--neon-cyan, #00f3ff);
}

/* Special J.A.R.V.I.S Neural Orb Dock Button */
.dock-item-jarvis {
  background: radial-gradient(circle at 50% 30%, rgba(0, 243, 255, 0.24), rgba(176, 38, 255, 0.28));
  border: 1px solid rgba(0, 243, 255, 0.48);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(176, 38, 255, 0.28);
}

.dock-item-jarvis:hover {
  box-shadow: 0 0 28px rgba(0, 243, 255, 0.5), 0 0 40px rgba(176, 38, 255, 0.4);
}

/* ==========================================================================
   2. LEFT-EDGE SWIPE SENSOR & PRO-VAULT DRAWER (#pro-vault-drawer)
   ========================================================================== */
#left-edge-swipe-zone {
  position: fixed;
  top: var(--header-height, 70px);
  left: 0;
  bottom: 0;
  width: 18px;
  z-index: 1250;
  background: transparent;
  transition: background 0.2s ease, width 0.2s ease;
}

#left-edge-swipe-zone:hover {
  width: 24px;
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.18), transparent);
}

.glass-vault-drawer {
  position: fixed;
  top: 4px;
  left: 0;
  bottom: 0;
  width: min(390px, 90vw);
  z-index: 1400;
  background: rgba(7, 11, 24, 0.92);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border-right: 1px solid rgba(0, 243, 255, 0.35);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 243, 255, 0.12);
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  overflow-y: auto;
  transform: translateX(-104%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-vault-drawer.open,
.glass-vault-drawer[aria-hidden='false'] {
  transform: translateX(0);
}

.vault-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.18);
}

.vault-badge {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--neon-cyan, #00f3ff);
  background: rgba(0, 243, 255, 0.12);
  border: 1px solid rgba(0, 243, 255, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.2rem;
}

.vault-heading {
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #f2f7ff);
}

/* Vault Sections */
.vault-section {
  background: rgba(12, 19, 38, 0.68);
  border: 1px solid rgba(0, 243, 255, 0.16);
  border-radius: var(--radius-md, 14px);
  padding: 1rem;
}

.vault-section-title {
  font-family: var(--font-heading, sans-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--neon-cyan, #00f3ff);
  margin-bottom: 0.65rem;
  letter-spacing: 0.02em;
}

.vault-helper-text {
  font-size: 0.78rem;
  color: var(--text-muted, #7589a6);
  line-height: 1.5;
  margin-bottom: 0.65rem;
}

/* User Profile & Biometric Card */
.vault-profile-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.09) 0%, rgba(176, 38, 255, 0.12) 100%);
}

.profile-avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.25);
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-cyan, #00f3ff);
  background: #060a17;
  display: block;
  color: transparent;
}

.profile-meta {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.biometric-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(5, 9, 20, 0.92);
  border: 1px solid var(--neon-emerald, #00ff9d);
  color: var(--neon-emerald, #00ff9d);
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-meta h3 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary, #f2f7ff);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-meta p {
  font-size: 0.75rem;
  color: var(--text-secondary, #b4c6e0);
  margin: 0.25rem 0 0.55rem;
}

.profile-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Neural Progress Stats 4-Box Grid */
.neural-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.stat-box {
  background: rgba(5, 8, 18, 0.82);
  border: 1px solid rgba(0, 243, 255, 0.14);
  border-radius: var(--radius-sm, 8px);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat-box:hover {
  border-color: rgba(0, 243, 255, 0.42);
  transform: translateY(-1px);
}

.stat-value {
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted, #7589a6);
}

/* Scholar Medals & Ribbons Showcase inside Pro-Vault */
.vault-medals-showcase {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 243, 255, 0.14);
}

.vault-medals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.vault-medals-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--text-secondary, #b4c6e0);
}

.vault-medals-title strong {
  color: var(--neon-gold, #ffc857);
}

.vault-medals-link-btn {
  background: transparent;
  border: none;
  color: var(--neon-cyan, #00f3ff);
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
}

.vault-medals-link-btn:hover {
  text-decoration: underline;
}

.vault-medals-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.vault-medal-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  background: rgba(5, 9, 22, 0.85);
  border: 1px solid rgba(255, 200, 87, 0.32);
  font-size: 0.72rem;
  color: var(--text-primary, #f2f7ff);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
}

.vault-medal-pill:hover {
  transform: translateY(-1px);
  border-color: var(--neon-gold, #ffc857);
  box-shadow: 0 0 12px rgba(255, 200, 87, 0.2);
}

.vault-medal-pill.locked {
  opacity: 0.58;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.15);
}

.vault-medal-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.vault-medal-info {
  min-width: 0;
  flex: 1;
}

.vault-medal-name {
  display: block;
  font-weight: 700;
  font-size: 0.71rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-medal-tier {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 0.61rem;
  color: var(--neon-gold, #ffc857);
}

.vault-medal-pill.locked .vault-medal-tier {
  color: var(--text-muted, #7589a6);
}

/* Vault Item Lists (Offline Books & Bookmarks) */
.storage-quota-tag,
.badge-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 255, 157, 0.12);
  border: 1px solid rgba(0, 255, 157, 0.35);
  color: var(--neon-emerald, #00ff9d);
}

.vault-item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 175px;
  overflow-y: auto;
}

.vault-item-list li {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm, 8px);
  background: rgba(5, 8, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.vault-empty-state {
  color: var(--text-muted, #7589a6);
  font-style: italic;
}

/* WebLLM Local 2GB Model Opt-In Box */
.webllm-vault-box {
  border-color: rgba(176, 38, 255, 0.35);
  background: linear-gradient(135deg, rgba(176, 38, 255, 0.08), rgba(5, 8, 20, 0.85));
}

.webllm-progress-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.webllm-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple, #b026ff), var(--neon-cyan, #00f3ff));
  transition: width 0.25s ease;
}

.vault-footer-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* ==========================================================================
   3. DISTRACTION-FREE ZEN MODE (Swipe-to-Hide UI)
      Triggered via html[data-distraction-free="true"]
   ========================================================================== */
html[data-distraction-free='true'] #cyber-top-header {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}

html[data-distraction-free='true'] #cyber-glass-dock {
  transform: translate(-50%, 150%);
  opacity: 0;
  pointer-events: none;
}

html[data-distraction-free='true'] body.cyber-body {
  padding-top: 12px;
  padding-bottom: 16px;
}

.distraction-exit-btn {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2100;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  background: rgba(8, 13, 28, 0.88);
  border: 1px solid var(--neon-cyan, #00f3ff);
  color: var(--neon-cyan, #00f3ff);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Mobile Dock Refinements — Fits all 7 items cleanly on 350px-430px phones */
@media (max-width: 640px) {
  .cyber-floating-dock {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    justify-content: space-between;
    padding: 0.3rem 0.35rem;
    gap: 0.12rem;
    border-radius: 20px;
  }

  .dock-item {
    flex: 1 1 0;
    min-width: 0;
    height: 48px;
    padding: 0.2rem 0.1rem;
    border-radius: 12px;
  }

  .dock-icon {
    font-size: 1.02rem;
  }

  .dock-label {
    font-size: 0.54rem;
    letter-spacing: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}