/* ======================
   LAYOUT RESPONSIVO
   ====================== */

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

body {
	font-family: "Oxanium", cursive;
	background-color: #000000;
	color: #ffffff;
}

body::before{
    content: "";
    background-image: url(../assets/bg-desktop.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: -1;
    opacity: 0.2;
}

.character-grid {
  display: grid;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.character-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
}

.character-card.selected {
  border: 3px solid #007bff;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
}

/* Mobile first: 375px */
.character-grid {
  grid-template-columns: 1fr;
}

/* Tablet: 768px */
@media (min-width: 768px) {
  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 1040px */
@media (min-width: 1040px) {
  .character-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ======================
   CHARACTER BUTTON (semântico)
   ====================== */

.character-button {
  all: unset; /* Reset completo */
  display: block;
  width: 100%;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

/* Foco visível apenas para teclado */
.character-button:focus-visible {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

/* Estilo quando selecionado e com foco */
.character-button[aria-selected="true"]:focus-visible {
  outline: 3px solid #0056b3;
  outline-offset: 2px;
}

/* ======================
   IMAGEM
   ====================== */

.character-button img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

/* ======================
   INFO DO PERSONAGEM
   ====================== */

   /* ==============================================
   NOVOS ESTILOS PARA OS DADOS DO CARD
   ============================================== */

.character-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Nome */
.character-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* Nome real */
.real-name {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* Poder */
.power {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
  font-weight: 500;
}

/* Nível (estrelas) */
.level {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: #555;
}

/* Equipe com cores */
.team {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  display: inline-block;
  align-self: flex-start;
}

/* Cores por equipe */
.team-x-men {
  background: #0055ff20;
  color: #0055ff;
  border: 1px solid #0055ff40;
}

.team-irmandade {
  background: #ff004420;
  color: #ff0044;
  border: 1px solid #ff004440;
}

.team-novos-mutantes {
  background: #00aa5520;
  color: #00aa55;
  border: 1px solid #00aa5540;
}

.team-x-force {
  background: #ff660020;
  color: #ff6600;
  border: 1px solid #ff660040;
}

/* Status */
.status {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Primeira aparição */
.first-appearance {
  margin: 0;
  font-size: 0.75rem;
  color: #888;
}

/* Biografia */
.bio {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limita a 3 linhas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Botão "Ver mais" */
.details-button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: #f0f4ff;
  border: 1px solid #0055ff40;
  border-radius: 6px;
  color: #0055ff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}

.details-button:hover {
  background: #0055ff20;
}

.details-button:focus-visible {
  outline: 2px solid #0055ff;
  outline-offset: 2px;
}

/* ==============================================
   MODAL DE DETALHES
   ============================================== */

.character-details-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;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.details-content {
  background: #ffffff;
  color: #000000;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close-details {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.close-details:hover {
  background: #f0f0f0;
}

.close-details:focus-visible {
  outline: 2px solid #0055ff;
  outline-offset: 2px;
}

.details-content img {
  border-radius: 8px;
  margin: 0.5rem 0;
}

.details-content p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.details-content strong {
  color: #1a1a1a;
}

/* ==============================================
   RESPONSIVIDADE
   ============================================== */

/* Tablet */
@media (min-width: 768px) {
  .character-info {
    padding: 1.25rem;
  }
  
  .character-name {
    font-size: 1.3rem;
  }
  
  .bio {
    font-size: 0.9rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .character-info {
    padding: 1.5rem;
  }
  
  .character-name {
    font-size: 1.4rem;
  }
}

/* Mobile pequeno */
@media (max-width: 480px) {
  .character-info {
    padding: 0.75rem;
    gap: 0.3rem;
  }
  
  .character-name {
    font-size: 1rem;
  }
  
  .power {
    font-size: 0.8rem;
  }
  
  .bio {
    font-size: 0.75rem;
  }
  
  .details-content {
    padding: 1.5rem;
    margin: 0.5rem;
  }
}

/* .character-info {
  padding: 2rem;  
}

.character-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: #1a1a1a;
}

.character-info .real-name {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #666;
}

.character-info .power {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
} */

/* ======================
   ESTADOS
   ====================== */

/* Quando selecionado, destaca o nome */
.character-card.selected .character-info h3 {
  color: #007bff;
}

/* Feedback visual para hover (mouse) */
.character-button:hover .character-info h3 {
  text-decoration: underline;
}

/* ======================
   ANIMAÇÃO DE SELEÇÃO
   ====================== */

.character-card {
  transition: border 0.2s, box-shadow 0.2s, transform 0.2s;
}

.character-card.selected {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ==============================================
   STATS SECTION
   ============================================== */

.stats-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 1.5rem 1rem;
  margin: 1rem 0 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.3s, transform 0.3s;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  transition: transform 0.3s;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
}

/* Estilo para o número animado */
.stat-number.animate {
  animation: numberPop 0.3s ease;
}

@keyframes numberPop {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==============================================
   TEAMS LIST (tags das equipes)
   ============================================== */

.teams-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 1200px;
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.team-tag {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--team-color, #666);
  opacity: 0.9;
  transition: opacity 0.3s, transform 0.3s;
  cursor: default;
}

.team-tag:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Cores específicas para cada equipe (já definidas no JavaScript) */
.team-tag[data-team="X-Men"] {
  background: #0055ff;
}

.team-tag[data-team="Irmandade"] {
  background: #ff0044;
}

.team-tag[data-team="Novos Mutantes"] {
  background: #00aa55;
}

.team-tag[data-team="X-Force"] {
  background: #ff6600;
}

/* ==============================================
   HEADER E FOOTER
   ============================================== */

.app-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 2rem 1rem;
  text-align: center;
  border-bottom: 4px solid #0055ff;
}

.header-content h1 {
  margin: 0;
  font-size: 2rem;
  color: #ffffff;
  font-weight: 700;
}

.subtitle {
  color: rgba(255, 255, 255, 0.7);
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

kbd {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-footer {
  background: #1a1a2e;
  padding: 1.5rem 1rem;
  text-align: center;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  margin: 0.25rem 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer-credit {
  font-size: 0.8rem !important;
  opacity: 0.5;
}

/* ==============================================
   RESPONSIVIDADE DAS STATS
   ============================================== */

/* Tablet */
@media (min-width: 768px) {
  .stats-container {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-item {
    padding: 1rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .stats-section {
    padding: 2rem;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
}

/* Mobile pequeno */
@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .stat-item {
    padding: 0.5rem;
  }
  
  .stat-icon {
    font-size: 1.2rem;
  }
  
  .stat-number {
    font-size: 1.3rem;
  }
}