/*-- Google fonts --*/
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/*-- Global --*/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
}

body {
  background-image: url('../images/pokeball.jpg');
  background-size: 300px;
  color: #333;
  line-height: 1.5;
  padding: 20px;
  max-width: 1100px;
  margin: auto;
}

.app-logo {
  height: 150px;
}

/*-- Search Bar and Buttons --*/
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.search-container input {
  padding: 10px;
  font-size: 16px;
  width: 350px;
  max-width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.search-container button {
  font-weight: bold;
  padding: 12px 18px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease-in-out;
  flex-shrink: 0;
}

#searchBtn {
  background: #ffcb05;
  color: #2a75bb;
}

#searchBtn:hover {
  background: #e6b800;
}

#randomBtn {
  background: #2a75bb;
  color: #ffcb05;
}

#randomBtn:hover {
  background: #1f5fa0;
}

.search-buttons {
  display: flex;
  gap: 10px;
}

/*-- Pokémon Container --*/
.pokemon-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/*-- Top Section (Image + Basic Info) --*/
.top-section {
  display: flex;
  gap: 20px;
  align-items: center;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.sprite-container {
  flex: 0 0 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sprite-container img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.basic-info {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

/*-- Abilities Section --*/

#pokemonAbilities {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 8px;
}

ul {
  list-style: none;
}

/*-- White Card Sections --*/
.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/*-- Stats Section --*/
.stats h3 {
  margin-bottom: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;

}

.stat-name {
  width: 90px;
  font-weight: bold;

}

.stat-bar {
  flex: 1;
  max-width: 90%;
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  margin: 0 10px;

}

.stat-val {
  width: 40px;
  text-align: right;
  font-weight: bold;
}

.stat-fill {
  height: 100%;
  transition: width 0.4s ease-in-out;
}

/*-- Stat bar colours --*/
.stat-fill.red {
  background: #e74c3c; /*-- bad --*/
}
.stat-fill.yellow {
  background: #f1c40f; /*-- adequate --*/
}
.stat-fill.lightgreen {
  background: #2ecc71; /*-- good --*/
}
.stat-fill.darkgreen {
  background: #1e8449; /*-- great --*/
}

/* Search History */
.history-container {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.history-container button {
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.history-container button:hover {
  background: #f0f0f0;
}

.weakness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.weakness-item {
  padding: 6px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.9em;
  color: white;
}
.weak-immune { background-color: red; }
.weak-resist { background-color: #ff8c00; color: black; }
.weak-neutral { background-color: #333; }
.weak-strong { background-color: green; }

/*-- Media Query --*/
@media (max-width: 500px) {
  .top-section {
    flex-direction: column;
    text-align: center;
  }

  .sprite-container {
    flex: none;
  }

  .app-logo {
    height: 120px;
  }
}
