/* Стили для системы бейджей */

/* Секция бейджей в index.html */
.badges-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.badges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.badges-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy, #0a1628);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badges-count {
  background: linear-gradient(135deg, var(--gold, #c9a227), #f59e0b);
  color: var(--navy, #0a1628);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.badge-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.badge-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.badge-item.earned {
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  border-color: var(--gold, #c9a227);
}

.badge-item.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.badge-icon,
.badge-emoji {
  font-size: 2.2rem;
  margin-bottom: 4px;
  display: block;
  line-height: 1;
}

.badge-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy, #0a1628);
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

.badge-item.locked .badge-name {
  color: #94a3b8;
}

.badge-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy, #0a1628);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 10;
  margin-bottom: 8px;
}

.badge-item:hover .badge-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Модальное окно бейджа */
.badge-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.badge-modal-content {
  background: white;
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.4s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(50px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.badge-modal-icon {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.badge-modal h3 {
  color: var(--navy, #0a1628);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.badge-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold, #c9a227);
  margin-bottom: 12px;
}

.badge-modal p {
  color: #64748b;
  margin-bottom: 24px;
  font-size: 1rem;
}

.badge-modal-btn {
  background: linear-gradient(135deg, var(--gold, #c9a227), #f59e0b);
  color: var(--navy, #0a1628);
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.badge-modal-btn:hover {
  transform: scale(1.05);
}

/* Прогресс-бар бейджей */
.badges-progress {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

.badges-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.badges-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold, #c9a227), #f59e0b);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Адаптивность */
@media (max-width: 640px) {
  .badges-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .badge-item {
    padding: 12px 6px;
    min-height: 100px;
  }
  
  .badge-icon,
  .badge-emoji {
    font-size: 1.8rem;
  }
  
  .badge-name {
    font-size: 0.7rem;
    line-height: 1.25;
  }
  
  .badge-modal-content {
    padding: 30px 20px;
  }
  
  .badge-modal-icon {
    font-size: 4rem;
  }
}
