/**
 * THE VAULT — Slots That Fill
 * Visual magic: Empty slots breathe. Filled slots glow.
 */

/* ===== Container ===== */
.vault-container {
  padding: 16px 24px 120px;
  max-width: 1200px;
  margin: 0 auto;
  background: #0a0a0f;  /* Solid background - no grid bleed */
  border-radius: 16px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);  /* Soft edge blend */
}

/* Move vault higher - kill dead space */
body.zone-collection .card-space {
  padding-top: 24px !important;
}

/* ===== Header ===== */
.vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 255, 200, 0.15);
}

.vault-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 12px rgba(0, 255, 200, 0.5));
}

.vault-text {
  font-family: 'Space Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 255, 200, 0.3);
}

.vault-count {
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  color: #00ffc8;
  opacity: 0.9;
}

/* ===== Filter Bar ===== */
.vault-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.vault-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 8px;
}

.vault-tab {
  padding: 10px 20px;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vault-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vault-tab.is-active {
  color: #0a0a0f;
  background: #00ffc8;
}

.vault-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  transition: all 0.2s ease;
}

.vault-tab.is-active .vault-tab-count {
  background: rgba(0, 0, 0, 0.2);
  color: #0a0a0f;
}

.vault-sort {
  padding: 10px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.vault-sort:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.vault-sort:focus {
  outline: none;
  border-color: #00ffc8;
  color: #fff;
}

/* ===== Slot Grid ===== */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  position: relative;  /* For particle overlay */
}

@media (max-width: 1100px) {
  .vault-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 900px) {
  .vault-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 700px) {
  .vault-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 500px) {
  .vault-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Base Slot ===== */
.vault-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ===== Empty Slot ===== */
.vault-slot--empty {
  border: 2px dashed rgba(0, 255, 200, 0.15);
  background: rgba(0, 255, 200, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: breathe 4s ease-in-out infinite;
  position: relative;
}

.vault-slot--empty::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(0, 255, 200, 0.08);
  border-radius: 8px;
  pointer-events: none;
}

.vault-slot--empty:hover {
  border-color: rgba(0, 255, 200, 0.5);
  background: rgba(0, 255, 200, 0.06);
  transform: scale(1.03);
  animation: none;
}

.slot-empty-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 300;
  color: rgba(0, 255, 200, 0.25);
  border: 2px solid rgba(0, 255, 200, 0.15);
  border-radius: 50%;
  transition: all 0.25s ease;
}

.vault-slot--empty:hover .slot-empty-icon {
  color: #00ffc8;
  border-color: #00ffc8;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.3);
}

@keyframes breathe {
  0%, 100% { 
    border-color: rgba(0, 255, 200, 0.12);
    background: rgba(0, 255, 200, 0.015);
  }
  50% { 
    border-color: rgba(0, 255, 200, 0.22);
    background: rgba(0, 255, 200, 0.035);
  }
}

/* ===== Filled Slot ===== */
.vault-slot--filled {
  background: #1a1a24;
  border: 2px solid rgba(0, 255, 200, 0.3);
  box-shadow: 
    0 0 20px rgba(0, 255, 200, 0.15),
    inset 0 0 30px rgba(0, 255, 200, 0.05);
  /* Override old vault.css that hides filled slots */
  opacity: 1 !important;
  transform: scale(1) !important;
}

.vault-slot--filled:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(0, 255, 200, 0.6);
  box-shadow: 
    0 8px 30px rgba(0, 255, 200, 0.25),
    inset 0 0 30px rgba(0, 255, 200, 0.1);
}

/* Glow effect behind filled slots */
.slot-glow {
  position: absolute;
  inset: -4px;
  background: radial-gradient(circle at center, rgba(0, 255, 200, 0.15) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.slot-art {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.3s ease;
}

.vault-slot--filled:hover .slot-art {
  transform: scale(1.05);
}

/* Overlay with buttons */
.slot-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.vault-slot--filled:hover .slot-overlay {
  opacity: 1;
}

.slot-play,
.slot-lab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-play {
  background: #00ffc8;
  color: #0a0a0f;
}

.slot-play:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.5);
}

.slot-lab {
  background: rgba(168, 85, 247, 0.8);
  color: #fff;
}

.slot-lab:hover {
  transform: scale(1.15);
  background: rgba(168, 85, 247, 1);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Title below art - always visible */
.slot-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
  transition: all 0.2s ease;
}

.vault-slot--filled:hover .slot-title {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
  color: #fff;
}

/* Focus state for keyboard nav */
.vault-slot:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 255, 200, 0.5);
}

.vault-slot--filled:focus {
  border-color: #00ffc8;
}

/* ===== Recent Add Sparkle ===== */
.vault-slot--recent {
  animation: slideIn 0.3s ease-out, sparkle 3s ease-out 0.3s;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes sparkle {
  0% {
    box-shadow: 
      0 0 30px rgba(0, 255, 200, 0.6),
      0 0 60px rgba(0, 255, 200, 0.3),
      inset 0 0 30px rgba(0, 255, 200, 0.2);
  }
  100% {
    box-shadow: 
      0 0 20px rgba(0, 255, 200, 0.15),
      inset 0 0 30px rgba(0, 255, 200, 0.05);
  }
}

/* ===== Zone Override ===== */
body.zone-collection .card-space.vault-mode {
  display: block !important;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

/* ===== Empty State ===== */
.vault-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.vault-empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  color: rgba(0, 255, 200, 0.4);
  animation: emptyFloat 3s ease-in-out infinite;
}

.vault-empty-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.vault-empty-title {
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.vault-empty-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}

.vault-empty-cta {
  padding: 12px 28px;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0a0a0f;
  background: #00ffc8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vault-empty-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 255, 200, 0.4);
}

/* ===== Context Menu ===== */
.vault-context-menu {
  background: #1a1a24;
  border: 1px solid rgba(0, 255, 200, 0.2);
  border-radius: 8px;
  padding: 4px;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: contextFadeIn 0.15s ease-out;
}

@keyframes contextFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.vault-context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.vault-context-menu button:hover {
  background: rgba(0, 255, 200, 0.15);
  color: #fff;
}

.vault-context-menu button[data-action="remove"]:hover {
  background: rgba(255, 80, 80, 0.15);
  color: #ff6666;
}

.vault-context-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 8px;
}

/* ===== Hide Chevrons from old styles ===== */
.vault-filters::before,
.vault-filters::after {
  display: none !important;
  content: none !important;
}

/* ============================================
   🎮 VIDEOGAME ATMOSPHERE
   Minimal. Magical. Like opening a real vault.
   ============================================ */

/* --- Vignette: You're peering into the vault --- */
.vault-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: 10;
}

/* --- Subtle inner glow: The vault has presence --- */
.vault-container {
  border: 1px solid rgba(0, 255, 200, 0.08);
  box-shadow: 
    0 0 60px rgba(0, 0, 0, 0.5),
    inset 0 0 80px rgba(0, 255, 200, 0.03),
    0 0 120px rgba(0, 255, 200, 0.05);
}

/* --- Ambient pulse: The vault breathes --- */
@keyframes vaultBreath {
  0%, 100% { 
    box-shadow: 
      0 0 60px rgba(0, 0, 0, 0.5),
      inset 0 0 80px rgba(0, 255, 200, 0.03),
      0 0 120px rgba(0, 255, 200, 0.05);
  }
  50% { 
    box-shadow: 
      0 0 60px rgba(0, 0, 0, 0.5),
      inset 0 0 100px rgba(0, 255, 200, 0.05),
      0 0 140px rgba(0, 255, 200, 0.08);
  }
}

.vault-container {
  animation: vaultBreath 8s ease-in-out infinite;
}

/* --- Floating particles: Treasure room dust --- */
.vault-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(0, 255, 200, 0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(0, 255, 200, 0.35) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 20%, rgba(0, 255, 200, 0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 50%, rgba(0, 255, 200, 0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 60%, rgba(0, 255, 200, 0.25) 0%, transparent 100%),
    radial-gradient(2px 2px at 70% 80%, rgba(0, 255, 200, 0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 30% 90%, rgba(0, 255, 200, 0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(0, 255, 200, 0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 50% 50%, rgba(0, 255, 200, 0.2) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(0, 255, 200, 0.25) 0%, transparent 100%);
  animation: particleDrift 25s linear infinite;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

@keyframes particleDrift {
  0% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-10px) translateX(5px); }
  50% { transform: translateY(-5px) translateX(-5px); }
  75% { transform: translateY(-15px) translateX(3px); }
  100% { transform: translateY(0) translateX(0); }
}

/* --- Filled slots GLOW: Your treasures are precious --- */
.vault-slot--filled {
  box-shadow: 
    0 0 20px rgba(0, 255, 200, 0.15),
    0 0 40px rgba(0, 255, 200, 0.05);
}

.vault-slot--filled:hover {
  box-shadow: 
    0 0 30px rgba(0, 255, 200, 0.25),
    0 0 60px rgba(0, 255, 200, 0.1);
}

/* --- Empty slots: Waiting achievements --- */
.vault-slot--empty {
  position: relative;
}

.vault-slot--empty::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(
    circle at center,
    rgba(0, 255, 200, 0.02) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vault-slot--empty:hover::after {
  opacity: 1;
}

/* --- First item badge glow: Celebrate the journey --- */
.vault-slot--first::before {
  content: '✦ First';
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  z-index: 5;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  50% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4); }
}
