
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
body {
 background: #d0eaf5;
background: linear-gradient(90deg,rgba(208, 234, 245, 1) 0%, rgba(131, 182, 222, 1) 50%, rgba(102, 179, 237, 1) 99%);
  color: #333;
}
.container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #fff;
  padding: 20px;
  border-right: 1px solid #ddd;
}
.sidebar .logo img {
  width: 100%;
  margin-bottom: 20px;
}
.sidebar .search {
  width: 100%;
  padding: 8px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #ccc;
}
.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 20px;
  display: flex;
  flex-direction: column;
}
.sidebar nav ul li a {
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none; 
  color: #333; 
}
.sidebar nav ul li a:hover {
   background: #f0f0f0;
   color: #2a75bb;       
   transform: scale(1.1); 
}

/* Main */
.main {
  flex: 1;
  padding: 20px;
}
.main h1 {
  margin-bottom: 10px;
}
.main input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 300px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;

}

.card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  aspect-ratio: 5 / 7;
  min-width: 180px;
  max-width: 280px;
  border: 6px solid #0d1b4c; 
  background: radial-gradient(circle at top left, var(--color-light), var(--color-dark));
  border-radius: 12px;
  box-shadow: 
    0 6px 12px rgba(0,0,0,0.4), 
    inset 0 4px 6px rgba(255,255,255,0.5);
  color: #222;
  font-weight: bold;
  font-size: 18px;
  margin: 0;
  transition: transform 0.2s, box-shadow 0.3s;
  text-align: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
  border: 4px solid white;
  box-shadow: 0 0 0 6px white inset;

}

.card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    transparent 60%
  );
  transform: rotate(-25deg);
  animation: shine 4s infinite;
  pointer-events: none;
}

/* Animation colleccion */
@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(-25deg);
  }
  50% {
    transform: translateX(0%) rotate(-25deg);
  }
  100% {
    transform: translateX(100%) rotate(-25deg);
  }
}
.card:hover {
  transform: scale(1.05);
  box-shadow: 
    0 10px 18px rgba(0,0,0,0.6),
    inset 0 4px 8px rgba(255,255,255,0.7);
}

.card p {
  margin-top: 10px;
  font-size: 16px;
}

.card.normal   { --color-light: #dcdca6; --color-dark: #a8a878; }
.card.fighting { --color-light: #e57373; --color-dark: #c22e28; }
.card.flying   { --color-light: #c6b7f5; --color-dark: #705898; }
.card.poison   { --color-light: #d67ee0; --color-dark: #a33ea1; }
.card.ground   { --color-light: #f0d890; --color-dark: #926e29; }
.card.rock     { --color-light: #d9c97c; --color-dark: #786824; }
.card.bug      { --color-light: #d8e070; --color-dark: #6d7815; }
.card.ghost    { --color-light: #a292bc; --color-dark: #493963; }
.card.steel    { --color-light: #d8d8e7; --color-dark: #71717a; }
.card.fire     { --color-light: #f5ac78; --color-dark: #e24242; }
.card.water    { --color-light: #9db7f5; --color-dark: #445e9c; }
.card.grass    { --color-light: #b0e57c; --color-dark: #4e8234; }
.card.electric { --color-light: #fdf17c; --color-dark: #a1871f; }
.card.psychic  { --color-light: #fba6c0; --color-dark: #a13959; }
.card.ice      { --color-light: #c2f0f0; --color-dark: #639494; }
.card.dragon   { --color-light: #9b6cf9; --color-dark: #4924a1; }
.card.dark     { --color-light: #a39085; --color-dark: #49392f; }
.card.fairy    { --color-light: #f4b6d9; --color-dark: #a13978; }
.card.shadow   { --color-light: #7a78a8; --color-dark: #2c2c44; }
.card.unknown  { --color-light: #9ac7c7; --color-dark: #446666; }

#pokemon-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.pokemon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4; 
  min-width: 160px;
  max-width: 220px;
  border-radius: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.pokemon-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 10px;
}
.pokemon-card:hover {
  transform: scale(1.05);
}

.buttons-container {
  display: flex;
  justify-content: flex-end; 
  gap: 15px;
  margin-top: 20px;
  margin-right: 20px;
}

.action-btn {
  background: linear-gradient(135deg, #ff5757, #ff914d);
  color: white;
  font-weight: bold;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s, background 0.3s;
  margin-top: 20px; 
  display: block;
}

.action-btn:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #ff914d, #ff5757);
  
}


.detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  padding: 20px;
  align-items: stretch;
}

.detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content:space-between; 
  min-width: 200px;
  border: 6px solid #0d1b4c; 
  background: radial-gradient(circle at top left, var(--color-light, #f8f8f8), var(--color-dark, #ccc));
  border-radius: 12px;
  box-shadow: 
    0 6px 12px rgba(0,0,0,0.4), 
    inset 0 4px 6px rgba(255,255,255,0.5);
  color: #222;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  padding: 15px;
  position: relative;
  overflow: hidden; 
}


.detail-card:hover {
  transform: scale(1.05);
}

.detail-card img {
  width: 120px;
  display: block;
  margin: 0 auto 10px auto;
}


.evolution-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.evolution-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.evolution-children {
  display: flex;
  gap: 30px;
  margin-top: 15px;
}

.evolution-node {
  text-align: center;
}

.evolution-node img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.type-icon {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px auto; 
}


.stat-bar {
  margin: 8px 0;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
}

.stat-name {
  display: block;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.bar-container {
  width: 150px;
  height: 15px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #4caf50;
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: white;
  font-size: 12px;
  padding-right: 5px;
  transition: width 1.5s ease-in-out;
  width: 0; /*Inicialize in 0*/
}

.bar-value {
  position: absolute;
  right: 5px;
  font-size: 12px;
  color: black;
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
