body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    color: #333;
}

@font-face {
    font-family: 'Pokemon Solid';
    src: url('../assets/Pokemon Solid.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

header {
    background-color: #ffcc00;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    font-family: 'Pokemon Solid', sans-serif;
    font-size: 2.5em;
    color: #1a1a1a;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    position: relative;
}

#search-bar {
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    width: 80%;
    margin-bottom: 10px;
    text-align: center;
    overflow: hidden;
}

#search-button {
    padding: 10px 15px;
    background: #e63900;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

.search-suggestions {
    display: none;
    position: absolute;
    width: 80%;
    max-width: 500px;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    text-align: left;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.pokemon-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}

.loading-screen.active {
    display: flex;
}

.pokeball-spinner {
    animation: spinPokeball 1.5s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    font-family: 'Arial', sans-serif;
}

@keyframes spinPokeball {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.error-message {
    background-color: #ff6b6b;
    color: white;
    padding: 10px;
    text-align: center;
    margin: 10px auto;
    max-width: 80%;
    border-radius: 4px;
}

.load-more-container {
    text-align: center;
    margin: 20px 0;
}

#load-more {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#load-more:hover {
    background-color: #2980b9;
}

#load-more:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background-color: white;
    padding: min(5vw, 20px);
    padding-top: 5px;
    border-radius: 8px;
    width: min(95%, 500px);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.overlay-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.close-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
  width: 100%;
}

.close-btn {
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 5px;
  transition: transform 0.2s, color 0.2s;
  position: static;
}

.close-btn:hover {
  transform: scale(1.1);
  color: #e63900;
}
.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  width: 100%;
}

.overlay-title {
  margin: 0;
  text-align: center;
  flex-grow: 1;
  padding: 0 10px;
  font-size: 1.4rem;
}
#prev-pokemon, #next-pokemon {
  padding: 8px 15px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, transform 0.2s;
  font-weight: bold;
  flex-shrink: 0;
}
.overlay-nav {
  display: none;
}

#back-button {
    padding: 10px 20px;
    background-color: #e63900;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.2s;
    margin-top: 10px;
}

#back-button:hover {
    background-color: #c33100;
    transform: scale(1.05);
}

button:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed;
    transform: none !important;
}

#back-button::before {
    content: "←  ";
    font-weight: bold;
}

.overlay-nav:has(#prev-pokemon[style*="display: none"]) {
    justify-content: flex-end; 
}

.stats {
    margin-top: 15px;
}

.stat-row {
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-bar {
    width: 100%;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    margin: 5px 0; 
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background-color: #3498db;
    border-radius: 5px;
}

.details-section {
    margin-top: 20px;
}

.details-section h3 {
    margin-bottom: 10px;
}

.fire { background-color: #f08030; }
.water { background-color: #6890f0; }
.grass { background-color: #78c850; }
.electric { background-color: #f8d030; }
.ice { background-color: #98d8d8; }
.fighting { background-color: #c03028; }
.poison { background-color: #a040a0; }
.ground { background-color: #e0c068; }
.flying { background-color: #a890f0; }
.psychic { background-color: #f85888; }
.bug { background-color: #a8b820; }
.rock { background-color: #b8a038; }
.ghost { background-color: #705898; }
.dragon { background-color: #7038f8; }
.dark { background-color: #705848; }
.steel { background-color: #b8b8d0; }
.fairy { background-color: #ee99ac; }
.normal { background-color: #a8a878; }


@media (max-width: 470px) {

    .overlay-header {
        flex-direction: column;
        gap: 10px;
      }

}

@media (max-width: 768px) {
    .overlay-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .overlay-nav button {
        width: 100%;
    }
}

