@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: #0d1117;
  color: #f0f6fc;
  min-height: 100vh;
}

/* NAVBAR */
nav {
  background-color: #161b22;
  border-bottom: 2px solid #facc15;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav button {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1f2937;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

nav button:hover {
  transform: scale(1.05);
}

/* LAYOUT */
.layout {
  display: flex;
  flex-direction: row;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  gap: 20px;
}

main {
  flex: 4;
  min-width: 0;
}

.sidebar {
  flex: 1.2;
  max-width: 300px;
  background-color: #161b22;
  padding: 20px;
  border-left: 2px solid #facc15;
  border-radius: 12px;
}

.sidebar h2 {
  color: #facc15;
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}

/* TITULOS */
header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 28px;
  color: #facc15;
}

.subtitulo {
  font-size: 16px;
  color: #ccc;
  margin-top: 8px;
}

/* CARDS */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  justify-content: center;
}

.card {
  background-color: #161b22;
  border: 1.5px solid #30363d;
  border-radius: 12px;
  max-width: 200px;
  width: 100%;
  padding: 12px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background-color: #0d1117;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.card h3 {
  color: #facc15;
  font-size: 16px;
  margin-bottom: 6px;
}

.card p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.4;
}

/* ETIQUETA NUEVA */
.etiqueta-nueva {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #00c853, #66bb6a);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 600;
  z-index: 10;
}

/* ETIQUETA DESTACADA */
.etiqueta-destacada {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #FFD700;
  color: #121212;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

/* CARTA DESTACADA */
.destacadas .card {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  border: 2px solid #FFD700 !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6) !important;
  transform: scale(1.05);
  position: relative;
  background: linear-gradient(to bottom, #1f1f1f, #2a2a2a);
  animation: pulse 3s infinite ease-in-out;
  display: block; /* ✅ evita que se estire verticalmente como en flex */
  margin-bottom: 16px; /* ✅ da espacio con el botón */
  padding-bottom: 20px; /* ✅ más espacio dentro de la tarjeta */
}

.destacadas .card:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* TIPOS DE CARTAS */
.card.tipo-pokemon {
  border-color: #facc15;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.card.tipo-trainer {
  border-color: #4cc9f0;
  box-shadow: 0 0 8px rgba(76, 201, 240, 0.4);
}

.card.tipo-energia {
  border-color: #f72585;
  box-shadow: 0 0 8px rgba(247, 37, 133, 0.4);
}

/* BOTONES */
.destacada-btn,
button[type="submit"] {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1f2937;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: block;
  margin: 0 auto;
  max-width: 220px;
}
.destacadas {
  display: flex;
  justify-content: center;
}
.destacada-btn:hover,
button[type="submit"]:hover {
  background-color: #e6c200;
  transform: scale(1.03);
}

/* BUSCADOR */
#search-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  margin-bottom: 20px;
  border: none;
  border-radius: 6px;
  background-color: #2a2a2a;
  color: white;
}

/* TOTAL COLECCIÓN */
.total-coleccion {
  width: 100%;
  margin-top: 20px;
  font-size: 16px;
  text-align: center;
  color: #facc15;
}

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

@keyframes pulse {
  0%   { transform: scale(1.05); }
  50%  { transform: scale(1.07); }
  100% { transform: scale(1.05); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 10px;
  }

  nav button {
    width: 100%;
    font-size: 16px;
  }

  header h1 {
    font-size: 22px;
  }

  .layout {
    flex-direction: column;
    padding: 10px;
  }

  .card {
    max-width: 100%;
    margin: 0 auto;
  }

  .sidebar {
    border-left: none;
    border-top: 2px solid #facc15;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    max-width: 100%;
  }

  .destacada-btn {
    font-size: 16px;
    padding: 10px;
  }

  #search-input {
    font-size: 16px;
  }
}
