/**
 * THE VAULT - Visual Design
 * Slots that fill. That's the whole game.
 */

/* ===== Vault Container ===== */
.vault-container {
  display: block !important;
  padding: 0 16px;
  padding-bottom: 120px;
  min-height: calc(100vh - 160px);
}

/* Override any conflicting card-space styles */
#card-space.vault-container {
  display: block !important;
  position: relative;
}

/* ===== Vault Header ===== */
.vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0, 255, 200, 0.1);
}

.vault-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(0, 255, 200, 0.5));
}

.vault-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fff;
}

.vault-count {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: #00ffc8;
  padding: 4px 12px;
  background: rgba(0, 255, 200, 0.1);
  border: 1px solid rgba(0, 255, 200, 0.2);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.vault-count-pulse {
  animation: count-pulse 0.3s ease;
}

@keyframes count-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); background: rgba(0, 255, 200, 0.2); }
}

.vault-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.vault-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px;
}

.vault-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.vault-tab:hover {
  color: #fff;
}

.vault-tab.is-active {
  background: rgba(0, 255, 200, 0.15);
  color: #00ffc8;
}

.vault-sort {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.vault-sort:hover {
  border-color: rgba(0, 255, 200, 0.3);
}

/* ===== Vault Grid ===== */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  padding: 16px 0;
}

@media (max-width: 1400px) {
  .vault-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1200px) {
  .vault-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 900px) {
  .vault-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .vault-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Vault Slot (Base) ===== */
.vault-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ===== Empty Slot ===== */
.vault-slot--empty {
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.08);
}

.vault-slot--empty:hover {
  border-color: rgba(0, 255, 200, 0.3);
  background: rgba(0, 255, 200, 0.03);
}

.vault-slot-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vault-slot-plus {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.vault-slot--empty:hover .vault-slot-plus {
  color: rgba(0, 255, 200, 0.4);
  transform: scale(1.2);
}

/* Empty slot breathing animation */
.vault-slot--empty {
  animation: slot-breathe 3s ease-in-out infinite;
}

@keyframes slot-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== Filled Slot ===== */
.vault-slot--filled {
  background: #0a0a0f;
  border: 1px solid rgba(0, 255, 200, 0.15);
  opacity: 0;
  transform: scale(0.95);
}

.vault-slot--filled.is-visible {
  opacity: 1;
  transform: scale(1);
}

.vault-slot--filled:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(0, 255, 200, 0.4);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 255, 200, 0.15);
  z-index: 10;
}

/* Cyan glow effect */
.vault-slot-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.1), rgba(0, 200, 255, 0.05));
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.vault-slot--filled:hover .vault-slot-glow {
  opacity: 1;
}

/* ===== Slot Artwork ===== */
.vault-slot-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.vault-slot-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vault-slot--filled:hover .vault-slot-art img {
  transform: scale(1.05);
}

/* Play overlay */
.vault-slot-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 2rem;
  color: #00ffc8;
}

.vault-slot--filled:hover .vault-slot-play {
  opacity: 1;
}

/* Favorite button */
.vault-slot-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  z-index: 5;
}

.vault-slot--filled:hover .vault-slot-fav {
  opacity: 1;
  transform: scale(1);
}

.vault-slot-fav:hover {
  background: rgba(0, 255, 200, 0.2);
  color: #00ffc8;
}

.vault-slot-fav.is-active {
  color: #ffd700;
}

/* ===== Slot Info ===== */
.vault-slot-info {
  padding: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.vault-slot-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.vault-slot-artist {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Slot Actions ===== */
.vault-slot-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 5;
}

.vault-slot--filled:hover .vault-slot-actions {
  opacity: 1;
  transform: translateY(0);
}

.vault-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vault-action-btn:hover {
  background: rgba(0, 255, 200, 0.2);
  border-color: rgba(0, 255, 200, 0.4);
}

.vault-action-btn[data-action="remove"]:hover {
  background: rgba(255, 100, 100, 0.2);
  border-color: rgba(255, 100, 100, 0.4);
  color: #ff6464;
}

/* ===== Removing Animation ===== */
.vault-slot--removing {
  animation: slot-remove 0.3s ease forwards;
}

@keyframes slot-remove {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* ===== Recently Added Sparkle ===== */
.vault-slot--recent::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  background: #00ffc8;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ffc8;
  animation: sparkle 2s ease-out forwards;
}

@keyframes sparkle {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0); }
}
