/* =========================
   BUTTONS & VISUAL PICKER - PROFESSIONAL POLISH
========================= */

/* ────────────────────────────────────────────────
   BUTTON CONSISTENCY
──────────────────────────────────────────────── */

button, .action-btn {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Button row spacing */
.action-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  justify-content: space-between;
}

@media (max-width: 768px){

  .action-row{
    display: flex;
    flex-direction: row;     /* force horizontal */
    flex-wrap: wrap;         /* allow wrapping */
    gap: 6px;
    margin-top: 10px;
  }

  .action-btn{
    flex: 1 1 calc(50% - 6px);   /* 2 buttons per row */
    min-height: 40px;
    padding: 8px 6px;
    font-size: .8rem;
  }

}


/* Primary button enhanced */
.action-btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 
    0 4px 16px rgba(59, 130, 246, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.action-btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.action-btn.primary:hover::before {
  left: 100%;
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 
    0 8px 24px rgba(59, 130, 246, 0.5),
    0 0 40px rgba(59, 130, 246, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

/* Secondary button enhanced */
.action-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateY(-2px);
}

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

/* Disabled state */
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
  transform: none !important;
}

/* ────────────────────────────────────────────────
   VISUAL CARD PICKER ENHANCEMENT
──────────────────────────────────────────────── */

#visualPickerSection {
  background: var(--bg-elevated);
}

#deckGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
  padding: 20px;
}

/* Enhanced card hover in picker */
#deckGrid .card-slot {
  width: 64px;
  height: 92px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
}

#deckGrid .card-slot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  opacity: 0;
  transition: opacity 0.2s;
  z-index: -1;
}

#deckGrid .card-slot:hover {
  transform: translateY(-8px) scale(1.08);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(59, 130, 246, 0.5);
}

#deckGrid .card-slot:hover::after {
  opacity: 0.2;
}

#deckGrid .card-slot:active {
  transform: translateY(-4px) scale(1.04);
  transition-duration: 0.1s;
}

/* Disabled/used cards */
#deckGrid .card-slot.used {
  opacity: 0.25;
  cursor: not-allowed;
  filter: grayscale(1);
  pointer-events: none;
}

#deckGrid .card-slot.used:hover {
  transform: none;
  box-shadow: none;
}

/* Visual picker button */
#togglePicker,
#closePicker {
  width: 100%;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  min-height: 52px;
  font-size: 1.05rem;
}

#togglePicker:hover,
#closePicker:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* ────────────────────────────────────────────────
   FOCUS INDICATORS (Accessibility)
──────────────────────────────────────────────── */

*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.card-slot:focus-visible {
  outline-color: var(--accent-light);
  box-shadow: 
    0 0 0 3px var(--accent-glow),
    0 8px 24px rgba(59, 130, 246, 0.3);
}

button:focus-visible {
  outline-offset: 4px;
}

/* ────────────────────────────────────────────────
   TOOLTIPS ENHANCEMENT
──────────────────────────────────────────────── */

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: help;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  vertical-align: middle;
}

.tooltip:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

/* Enhanced tooltip popup */
.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  white-space: nowrap;
  color: var(--text-primary);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(59, 130, 246, 0.2);
  z-index: 100;
  animation: tooltipFadeIn 0.2s ease-out;
  pointer-events: none;
  font-weight: 500;
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(10, 10, 10, 0.98);
  animation: tooltipFadeIn 0.2s ease-out;
  z-index: 100;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ────────────────────────────────────────────────
   MODAL ENHANCEMENT
──────────────────────────────────────────────── */

.modal {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: rgba(15, 22, 36, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ────────────────────────────────────────────────
   ENHANCED NUTS BADGE
──────────────────────────────────────────────── */

.nuts-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin-left: 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nuts-badge::before {
  content: '👑';
  font-size: 1.2em;
}

.nuts-badge.locked {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #000;
  box-shadow: 
    0 4px 16px rgba(34, 197, 94, 0.4),
    0 0 0 2px rgba(34, 197, 94, 0.3);
  animation: badgePulse 2s ease-in-out infinite;
}

.nuts-badge.current {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  color: #000;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.4);
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 
      0 4px 16px rgba(34, 197, 94, 0.4),
      0 0 0 2px rgba(34, 197, 94, 0.3);
  }
  50% {
    box-shadow: 
      0 6px 24px rgba(34, 197, 94, 0.6),
      0 0 0 4px rgba(34, 197, 94, 0.5);
  }
}