/* Badges Page Styles */
:root {
  --primary: #FF6B35;
  --primary-light: #FF9E71;
  --primary-dark: #E04B1C;
  --background: #FFF9F5;
  --surface: #FFFFFF;
  --text-primary: #2D3748;
  --text-secondary: #4A5568;
  --text-tertiary: #718096;
  --success: #48BB78;
  --warning: #F6AD55;
  --error: #F56565;
  --info: #4299E1;
  
  /* Badge Rarity Colors */
  --common: #9CA3AF;
  --uncommon: #10B981;
  --rare: #3B82F6;
  --epic: #8B5CF6;
  --legendary: #F59E0B;
  
  /* Shadows and Effects */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 107, 53, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header */
header {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-link,
.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.back-link {
  color: var(--text-secondary);
}

.back-link:hover {
  color: var(--primary);
  background: rgba(255, 107, 53, 0.1);
  transform: translateX(-5px);
}

.filter-btn {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

/* Main Content */
.badges-page {
  padding: 2rem 0 4rem;
  min-height: calc(100vh - 80px);
}

/* Page Header */
.page-header {
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-title i {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

.page-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.5;
}

.progress-summary {
  display: flex;
  gap: 1rem;
}

.summary-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 140px;
  transition: var(--transition);
}

.summary-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.summary-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
}

.summary-icon.earned {
  background: linear-gradient(135deg, var(--success) 0%, #38A169 100%);
}

.summary-icon.total {
  background: linear-gradient(135deg, var(--info) 0%, #2B6CB0 100%);
}

.summary-icon.points {
  background: linear-gradient(135deg, var(--legendary) 0%, #D69E2E 100%);
}

.summary-content {
  display: flex;
  flex-direction: column;
}

.summary-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Overall Progress */
.overall-progress {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-text {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-percentage {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.progress-bar {
  height: 12px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 6px;
  transition: width 1s ease;
  width: 0%;
}

/* Filter Panel */
.filter-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.filter-panel.active {
  max-height: 500px;
}

.filter-content {
  padding: 2rem;
}

.filter-group {
  margin-bottom: 2rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--text-tertiary);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.9rem;
}

.filter-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

.filter-option.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* Rarity Filter Colors */
.rarity-filters .filter-option.common { border-color: var(--common); color: var(--common); }
.rarity-filters .filter-option.uncommon { border-color: var(--uncommon); color: var(--uncommon); }
.rarity-filters .filter-option.rare { border-color: var(--rare); color: var(--rare); }
.rarity-filters .filter-option.epic { border-color: var(--epic); color: var(--epic); }
.rarity-filters .filter-option.legendary { border-color: var(--legendary); color: var(--legendary); }

.rarity-filters .filter-option.common.active { background: var(--common); }
.rarity-filters .filter-option.uncommon.active { background: var(--uncommon); }
.rarity-filters .filter-option.rare.active { background: var(--rare); }
.rarity-filters .filter-option.epic.active { background: var(--epic); }
.rarity-filters .filter-option.legendary.active { background: var(--legendary); }

/* Search Section */
.search-section {
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--text-tertiary);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background: var(--surface);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1.1rem;
}

.clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.clear-search:hover {
  color: var(--error);
}

/* Categories Navigation */
.categories-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.categories-nav::-webkit-scrollbar {
  height: 6px;
}

.categories-nav::-webkit-scrollbar-track {
  background: transparent;
}

.categories-nav::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.category-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  min-width: 100px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.category-tab:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.category-tab.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.category-tab i {
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.category-tab.active i {
  color: white;
}

.category-tab span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.category-tab.active span {
  color: white;
}

.category-count {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  min-width: 24px;
}

.category-tab.active .category-count {
  background: rgba(255, 255, 255, 0.2);
}

/* Badges Section */
.badges-section {
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--primary);
}

.section-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-count {
  color: var(--text-secondary);
  font-weight: 500;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--text-tertiary);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.sort-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Loading and Empty States */
.badges-loading {
  text-align: center;
  padding: 3rem 0;
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.badge-skeleton {
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-lg);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: rgba(156, 163, 175, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 2rem;
  color: var(--text-tertiary);
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.empty-state p {
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Badge Card */
.badge-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
}

.badge-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.badge-card.earned {
  border-color: var(--success);
}

.badge-card.earned::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--success) 0%, #38A169 100%);
}

.badge-card.secret {
  opacity: 0.6;
  position: relative;
}

.badge-card.secret::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
}

.badge-header {
  padding: 1.5rem 1.5rem 1rem;
  text-align: center;
  position: relative;
}

.badge-rarity-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.badge-rarity-indicator.common { background: var(--common); }
.badge-rarity-indicator.uncommon { background: var(--uncommon); }
.badge-rarity-indicator.rare { background: var(--rare); }
.badge-rarity-indicator.epic { background: var(--epic); }
.badge-rarity-indicator.legendary { background: var(--legendary); }

.badge-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  transition: var(--transition);
}

.badge-card:hover .badge-icon {
  transform: scale(1.1);
}

.badge-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.badge-rarity {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.badge-rarity.common { background: rgba(156, 163, 175, 0.2); color: var(--common); }
.badge-rarity.uncommon { background: rgba(16, 185, 129, 0.2); color: var(--uncommon); }
.badge-rarity.rare { background: rgba(59, 130, 246, 0.2); color: var(--rare); }
.badge-rarity.epic { background: rgba(139, 92, 246, 0.2); color: var(--epic); }
.badge-rarity.legendary { background: rgba(245, 158, 11, 0.2); color: var(--legendary); }

.badge-body {
  padding: 0 1.5rem 1.5rem;
}

.badge-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.badge-progress-container {
  margin-bottom: 1rem;
}

.badge-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.badge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.badge-progress-text {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-align: center;
}

.badge-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-points {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--legendary);
  font-size: 0.9rem;
}

.badge-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.badge-status.earned {
  background: rgba(72, 187, 120, 0.2);
  color: var(--success);
}

.badge-status.available {
  background: rgba(66, 153, 225, 0.2);
  color: var(--info);
}

.badge-status.locked {
  background: rgba(156, 163, 175, 0.2);
  color: var(--text-tertiary);
}

/* Recent Badges Section */
.recent-section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.recent-badges {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.recent-badges::-webkit-scrollbar {
  height: 6px;
}

.recent-badges::-webkit-scrollbar-track {
  background: transparent;
}

.recent-badges::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.recent-badge {
  min-width: 200px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid var(--success);
}

.recent-badge:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.recent-badge .badge-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.recent-badge .badge-name {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.recent-badge .earned-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--background);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-icon-large {
  font-size: 3rem;
}

.modal-title h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--background);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.modal-close:hover {
  background: var(--error);
  color: white;
}

.modal-body {
  padding: 1rem 2rem 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

.badge-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge-rarity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
}

.rarity-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.rarity-value {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.badge-description {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
}

.badge-requirements h4,
.badge-progress h4 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

#requirementsList {
  list-style: none;
  padding: 0;
}

#requirementsList li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

#requirementsList li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.badge-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
}

.stat-item i {
  color: var(--primary);
  font-size: 1.2rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
}

.modal-footer {
  padding: 1rem 2rem 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid var(--background);
}

/* Sort Modal */
.sort-modal {
  max-width: 400px;
}

.sort-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sort-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--background);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.sort-option:hover {
  border-color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

.sort-option.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.sort-option i {
  color: var(--primary);
  font-size: 1.2rem;
  width: 20px;
}

.sort-option.active i {
  color: white;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-tertiary);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--success);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 350px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.error {
  background: var(--error);
}

.toast.warning {
  background: var(--warning);
}

.toast.info {
  background: var(--info);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
    gap: 2rem;
  }
  
  .progress-summary {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .categories-nav {
    justify-content: center;
  }
  
  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .badges-page {
    padding: 1.5rem 0 3rem;
  }
  
  .page-title {
    font-size: 2.5rem;
  }
  
  .nav-actions {
    gap: 0.5rem;
  }
  
  .nav-actions .back-link span,
  .nav-actions .filter-btn span {
    display: none;
  }
  
  .filter-content {
    padding: 1.5rem;
  }
  
  .filter-options {
    justify-content: center;
  }
  
  .categories-nav {
    gap: 0.25rem;
  }
  
  .category-tab {
    min-width: 80px;
    padding: 0.75rem 1rem;
  }
  
  .category-tab span {
    font-size: 0.8rem;
  }
  
  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }
  
  .section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.5rem;
  }
  
  .modal-footer {
    flex-direction: column-reverse;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
    top: 10px;
  }
  
  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 2rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .progress-summary {
    grid-template-columns: 1fr;
  }
  
  .summary-card {
    min-width: auto;
  }
  
  .badges-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-options {
    flex-direction: column;
  }
  
  .filter-option {
    justify-content: center;
    text-align: center;
  }
  
  .categories-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  .category-tab {
    flex-direction: row;
    justify-content: space-between;
    min-width: auto;
  }
  
  .badge-stats {
    grid-template-columns: 1fr;
  }
}
