/* Exceptional Card Styling - Bottom Label with Hover Shadow */

.card.exceptional {
  position: relative;
  overflow: visible;
  transition: all 0.3s ease;
}

/* Remove all golden overlays and borders */
.card.exceptional::before {
  display: none;
}

/* Golden blurred shadow on hover */
.card.exceptional:hover {
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4),
              0 4px 16px rgba(255, 165, 0, 0.3),
              0 2px 8px rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
}

/* Dedicated row so badge sits centered without overlapping stats */
.card.exceptional .exceptional-badge-row {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* Exceptional badge renders centered within its own row */
.card.exceptional .exceptional-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 215, 0, 0.3);
  white-space: nowrap;
}

/* Enhanced badge on card hover */
.card.exceptional:hover .exceptional-badge {
  background: linear-gradient(135deg, #FFD700 0%, #FFCC00 50%, #FFA500 100%);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6),
              0 2px 8px rgba(255, 165, 0, 0.4);
  transform: scale(1.05);
}

/* Smooth transitions */
.card.exceptional .exceptional-badge {
  transition: all 0.3s ease;
}

/* Highlight exceptional XP cost */
.card.exceptional .stats span:first-child {
  color: #FFD700;
  font-weight: 600;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .card.exceptional,
  .card.exceptional .exceptional-badge {
    transition: none;
  }
  
  .card.exceptional:hover {
    transform: none;
  }
  
  .card.exceptional:hover .exceptional-badge {
    transform: none;
  }
}

/* ===== PRINT-TO-PLAY BADGE (Like Exceptional, but Red) ===== */

/* Dedicated row so badge sits centered without overlapping stats */
.print-to-play-badge-row {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* Print-to-play badge renders centered within its own row - matches Exceptional style */
.print-to-play-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(211, 47, 47, 0.3);
  white-space: nowrap;
  transition: all 0.3s ease;
}

/* Enhanced badge on card hover - red glow */
.card:hover .print-to-play-badge {
  background: linear-gradient(135deg, #d32f2f 0%, #f44336 50%, #c62828 100%);
  box-shadow: 0 4px 16px rgba(211, 47, 47, 0.6),
              0 2px 8px rgba(198, 40, 40, 0.4);
  transform: scale(1.05);
}

/* Reduced motion support for print-to-play */
@media (prefers-reduced-motion: reduce) {
  .print-to-play-badge {
    transition: none;
  }
  
  .card:hover .print-to-play-badge {
    transform: none;
  }
}

/* ===== NEW BADGE (cards added within last 180 days) ===== */
/* Same row-pill layout as Exceptional / Print-to-Play, green styling. */

.new-badge-row {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(34, 197, 94, 0.35);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.card:hover .new-badge {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 50%, #16a34a 100%);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.6),
              0 2px 8px rgba(22, 163, 74, 0.4);
  transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .new-badge {
    transition: none;
  }
  .card:hover .new-badge {
    transform: none;
  }
}

/* New filter chip — neutral gray when OFF, green only when ACTIVE */
#newChips .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.65);
}

#newChips .chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.85);
}

#newChips .chip.active {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.6);
  color: #4ade80;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

/* ===== SUPERUSER CARD EDIT BUTTON ===== */

/* Edit button - positioned above favorite button */
.edit-card-btn {
  position: absolute;
  bottom: 48px;
  right: 8px;
  background: rgba(28, 28, 30, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
  line-height: 1;
}

.card:hover .edit-card-btn {
  opacity: 1;
  pointer-events: auto;
}

.edit-card-btn:hover {
  transform: scale(1.15);
  background: rgba(106, 183, 255, 0.7);
  border-color: rgba(106, 183, 255, 0.4);
}

/* ===== SUPERUSER CARD DELETE BUTTON ===== */

/* Delete button - positioned above edit button */
.delete-card-btn {
  position: absolute;
  bottom: 88px;
  right: 8px;
  background: rgba(220, 53, 69, 0.7);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(220, 53, 69, 0.4);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
  line-height: 1;
  color: #fff;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.card:hover .delete-card-btn {
  opacity: 1;
  pointer-events: auto;
}

.delete-card-btn:hover {
  transform: scale(1.15);
  background: rgba(200, 35, 51, 1);
  border-color: rgba(200, 35, 51, 0.6);
}

.delete-card-btn:active {
  transform: scale(0.95);
}

/* Mobile - always show superuser buttons */
@media (max-width: 768px) {
  .delete-card-btn,
  .edit-card-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== CARD EDIT MODAL ===== */
/* Version: 2.0 - Updated layout with image to the right */

.card-edit-modal {
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 24px;
  width: auto;
  max-height: 85vh;
  overflow-y: auto;
  color: #fff;
  margin: auto;
}

.card-edit-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.card-edit-container {
  min-width: 500px;
}

.card-edit-image {
  width: 300px;
  max-width: 300px;
}

.card-edit-image img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: block;
}

.card-edit-form {
  width: 100%;
}

.card-edit-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Form grid layout */
.edit-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.edit-form-row .edit-form-group {
  flex: 1;
  min-width: 100px;
}

.edit-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-form-group label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* Form field styling */
.card-edit-modal .field {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card-edit-modal .field:focus {
  outline: none;
  border-color: #6ab7ff;
  background: rgba(255, 255, 255, 0.12);
}

.card-edit-modal .field::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.card-edit-modal select.field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.card-edit-modal textarea.field {
  resize: vertical;
  min-height: 80px;
}

/* Checkbox styling */
.edit-form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
  cursor: pointer;
}

.edit-form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  padding-top: 20px;
}

/* Feedback messages */
.edit-feedback {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

.edit-feedback:empty {
  display: none;
}

.edit-feedback.success {
  background: rgba(76, 175, 80, 0.2);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.edit-feedback.error {
  background: rgba(244, 67, 54, 0.2);
  color: #e57373;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Action buttons */
.edit-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-form-actions .button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-form-actions .button.primary {
  background: linear-gradient(135deg, #6ab7ff 0%, #5a9fd8 100%);
  color: #000;
  border: none;
}

.edit-form-actions .button.primary:hover {
  background: linear-gradient(135deg, #7dc4ff 0%, #6ab7ff 100%);
  transform: translateY(-1px);
}

.edit-form-actions .button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .card-edit-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .card-edit-container {
    min-width: 0;
  }
  
  .card-edit-image {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .card-edit-modal {
    padding: 16px;
  }
  
  .card-edit-image {
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  .card-edit-modal {
    padding: 12px;
  }
  
  .card-edit-container {
    min-width: 0;
  }
  
  .edit-form-row {
    flex-direction: column;
  }
  
  .edit-form-actions {
    flex-direction: column-reverse;
  }
  
  .edit-form-actions .button {
    width: 100%;
    text-align: center;
  }
  
  .card-edit-image {
    max-width: 200px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .edit-card-btn,
  .delete-card-btn,
  .card-edit-modal .field,
  .edit-form-actions .button {
    transition: none;
  }
  
  .edit-card-btn:hover,
  .delete-card-btn:hover {
    transform: none;
  }
}