/**
 * ========================================================
 * Homepage - Badges Modal Styles (Preview Mode)
 * ========================================================
 * Standalone badges modal for index.html
 * Uses same visual design as account-dashboard badges
 * No login required - all badges shown as locked preview
 * ========================================================
 */

/* ===== Modal Overlay ===== */
.badges-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.badges-modal.active {
  display: flex;
  opacity: 1;
}

/* ===== Modal Content Container ===== */
.badges-modal .modal-content {
  background: linear-gradient(165deg, #1c1c1c 0%, #232323 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

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

/* ===== Modal Header ===== */
.badges-modal .modal-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.05) 0%, transparent 100%);
}

.badges-modal .modal-content header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Playfair Display', serif;
}

.badges-modal .modal-content header .close-badges {
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.badges-modal .modal-content header .close-badges:hover {
  transform: rotate(90deg);
  background: rgba(255, 255, 255, 0.1);
  color: #ff4444;
}

/* ===== Scrollbar Styling ===== */
.badges-modal .modal-content::-webkit-scrollbar {
  width: 8px;
}

.badges-modal .modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.badges-modal .modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.badges-modal .modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== Horizontal Tabs ===== */
.badge-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.badge-tab {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-family: 'Playfair Display', serif;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
}

.badge-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.badge-tab.active {
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.15) 0%, rgba(158, 240, 249, 0.05) 100%);
  border-bottom: 3px solid rgba(158, 240, 249, 0.8);
  color: rgba(158, 240, 249, 1);
  border-radius: 6px 6px 0 0;
  text-shadow: 0 0 8px rgba(158, 240, 249, 0.5);
}

.badge-tab-count {
  display: block;
  font-size: 0.75em;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* ===== Badges Container ===== */
#badges-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
  width: 100%;
}

/* ===== Badge Card ===== */
.badge-item {
  background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.badge-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.badge-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.badge-item:hover::before {
  opacity: 1;
}

/* Tier colors */
.badge-item.tier-bronze {
  color: #CD7F32;
}

.badge-item.tier-silver {
  color: #C0C0C0;
}

.badge-item.tier-gold {
  color: #FFD700;
}

.badge-item.tier-platinum {
  color: #E5E4E2;
}

/* ===== Badge Icon ===== */
.badge-icon-container {
  width: 90px;
  height: 90px;
  margin: 0 auto 1rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.badge-icon {
  width: 75px;
  height: 75px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.badge-item:hover .badge-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

/* Locked badge styling */
.badge-item.locked .badge-icon {
  filter: grayscale(100%) opacity(0.3);
}

.badge-item.locked:hover .badge-icon {
  filter: grayscale(100%) opacity(0.5);
}

.badge-lock-overlay {
  position: absolute;
  bottom: -5px;
  right: -5px;
  font-size: 1.75rem;
  color: inherit; /* Inherit tier color from parent badge-item */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Earned badge styling (for logged-in users in the future) */
.badge-item.earned .badge-icon-container {
  background: radial-gradient(circle, rgba(158, 240, 249, 0.15), transparent);
  border-color: rgba(158, 240, 249, 0.5);
  box-shadow: 0 0 15px rgba(158, 240, 249, 0.2);
  animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(158, 240, 249, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(158, 240, 249, 0.4);
  }
}

.badge-item.earned .badge-icon {
  filter: drop-shadow(0 0 10px rgba(158, 240, 249, 0.5));
}

/* ===== Badge Info ===== */
.badge-info {
  padding-top: 0.5rem;
}

.badge-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  line-height: 1.3;
}

.badge-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.badge-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.badge-tier {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: currentColor;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-requirement {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  text-align: center;
  line-height: 1.3;
}

/* ===== Loading & Empty States ===== */
.badges-loading,
.badges-error,
.no-badges {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}

.badges-loading {
  font-style: italic;
}

.badges-error {
  color: #f44336;
}

.no-badges p {
  margin: 0;
  font-size: 1.1em;
  color: #888;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  #badges-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }

  .badges-modal .modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .badges-modal .modal-content header {
    padding: 1rem 1.5rem;
  }

  .badges-modal .modal-content header h2 {
    font-size: 1.5rem;
  }

  .badge-item {
    padding: 1rem;
  }

  .badge-icon-container {
    width: 70px;
    height: 70px;
  }

  .badge-icon {
    width: 60px;
    height: 60px;
  }

  .badge-name {
    font-size: 0.95rem;
  }

  .badge-desc {
    font-size: 0.8rem;
  }

  .badge-tabs {
    flex-wrap: wrap;
  }

  .badge-tab {
    font-size: 0.85rem;
    padding: 0.6rem 0.4rem;
  }
}

@media (max-width: 480px) {
  #badges-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .badge-icon-container {
    width: 60px;
    height: 60px;
  }

  .badge-icon {
    width: 50px;
    height: 50px;
  }
}
