body, header, nav, main, footer, h1, div, img {
	margin: 0;
	padding: 0;
	border: 0;
}
body {
  padding-bottom: 160px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  background-color: #cab810fb;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 0%;
  
}
/* Hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding-right: 20px;
}

/* Logo section */
.logo {
  height: 90px;           
  width: auto;
  cursor: pointer;
  padding: 10px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding-right: 40px;
}

.nav-links li a {
  text-decoration: none;
  color: #333333;
  font-weight: 600;
  transition: color 0.3s ease;
  font-size: 30;
}

.nav-links li a:hover {
  color: #0073e6; 
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}


/*Footer*/
.footer {
  background-color: #013366; 
  color: #ffcb05;
  padding-top: 2px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.15);
  position: fixed;
  bottom: 0;
  width: 100%;
  height: min-content;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo img {
  height: 70px;
  width: auto;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.footer-links li a {
  color: #ffcb05;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.footer-links li a:hover {
  color: #ffffff;
}

.footer-socials a {
  height: 50px;
  width: 50px;
  margin: 0 0.3rem;
  transition: opacity 0.3s ease;
  
}

.footer-socials a img:hover {
  opacity: 0.8;
}

.footer-bottom {
  font-size: 0.85rem;
  color: #e0e0e0;
}


/*pokedex*/
.pokemon-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem;
  margin: 0.75rem;
  max-width: 320px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: inline-block;
  vertical-align: top;
  width: 280px;
  border-radius: 12px;
}

.pokemon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.pokemon-name {
  margin: 0;
}

.pokemon-main-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.pokemon-image {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.pokemon-details.hidden {
  display: none;
}

.toggle-details {
  margin-top: 0.5rem;
  cursor: pointer;
}

/* Center the search bar */
.search-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 20px auto;
  width: 100%;
  max-width: 500px;
  padding-top: 20px;
}

#searchInput {
  width: 100%;
  padding: 10px 40px 10px 15px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 65%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}

.clear-btn:hover {
  color: #333;
}

/* Center Pokémon cards */
.pokemon-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* ⬅️ this is the key line */
  gap: 20px;
  max-width:1900px;
  margin: 0 auto;
}

/* Type-based colors */
.type-normal  { background: #A8A77A; }
.type-fire    { background: #EE8130; }
.type-water   { background: #6390F0; }
.type-electric{ background: #F7D02C; }
.type-grass   { background: #7AC74C; }
.type-ice     { background: #96D9D6; }
.type-fighting{ background: #C22E28; }
.type-poison  { background: #A33EA1; }
.type-ground  { background: #E2BF65; }
.type-flying  { background: #A98FF3; }
.type-psychic { background: #F95587; }
.type-bug     { background: #A6B91A; }
.type-rock    { background: #B6A136; }
.type-ghost   { background: #735797; }
.type-dragon  { background: #6F35FC; }
.type-dark    { background: #705746; }
.type-steel   { background: #B7B7CE; }
.type-fairy   { background: #D685AD; }

/* Make the text readable on bright backgrounds */
.pokemon-card {
  color: white;
  border: none;
}
.pokemon-card,
.pokemon-card * {
  color: #000 !important;
}

.load-more-btn {
  display: block;
  margin: 1rem auto 2rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #ffcb05;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 60px;
}

.load-more-btn:hover {
  background: #ffd738;
}


.back-to-top {
  position: fixed;
  top: 65px;                   /* top of the screen */
  left: 50%;                   /* center horizontally */
  transform: translateX(-50%); /* perfect centering */
  
  background-color: #ffcb05;
  color: #013366;
  border: none;
  border-radius: 50%;
  
  width: 55px;
  height: 55px;
  font-size: 26px;
  font-weight: bold;
  
  cursor: pointer;
  display: none;               /* shown by JS */
  align-items: center;
  justify-content: center;
  
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  z-index: 9999;
}

/* Battle page layout */
.battle-container {
  padding-bottom: 160px; /* space above footer */
}

.battle-setup {
  margin-top: 1rem;
  text-align: center;
}

.battle-inputs {
  display: flex;
  justify-content: center;
  
  flex-wrap: wrap;
  margin-top: 1rem;
}

.battle-input-group {
  display: flex;
  flex-direction: column;
  
}

.battle-input-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.battle-input-group input {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* Battle field */

.battle-field {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.pokemon-side {
  min-width: 260px;
  max-width: 320px;
  text-align: center;
}

.battle-card {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 1rem;
}

.battle-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.battle-name {
  font-weight: 700;
}

.battle-hp-text {
  font-weight: 600;
}

.battle-hp-bar {
  width: 100%;
  height: 14px;
  background: #f1f1f1;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.battle-hp-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.hp-high {
  background-color: #4caf50;
}

.hp-mid {
  background-color: #ffc107;
}

.hp-low {
  background-color: #f44336;
}

.battle-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

/* Moves */
.battle-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

/* Battle log */
.battle-log-wrapper {
  margin-top: 2rem;
}

.battle-log {
  max-height: 200px;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  font-size: 0.9rem;
}

/* Win/Lose overlay */
.battle-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.battle-result-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.battle-result-overlay.hidden {
  display: none;
}

.battle-result-content {
  background: #ffcb05;
  color: #013366;
  padding: 2rem 3rem;
  border-radius: 16px;
  text-align: center;
  animation: battleResultPop 0.4s ease;
}

@keyframes battleResultPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

/* Search Dropdown */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

/* Live search dropdown */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  z-index: 2000;
  display: none;  /* JS shows it */
}

.search-dropdown div {
  padding: 8px 12px;
  cursor: pointer;
}

.search-dropdown div:hover {
  background: #f2f2f2;
}

.player-search, 
.enemy-search {
  width: 100%;
  max-width: 260px;
  margin: 0 auto 10px auto;
  text-align: left;

}



/* Desktop layout: player left, enemy right */
.battle-field {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-wrap: nowrap;
  margin-top: 2rem;
  gap: 2rem;
}



.back-to-top:hover {
  background-color: #ffd738;
}

/* Contact Page */
.contact-section {
  max-width: 420px;
  margin: 2rem auto 5rem;
  padding: 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  text-align: center;
  height: min-content;
}

.contact-section h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #333;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.contact-form label {
  font-weight: 600;
  color: #333;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #ffcb05;
  box-shadow: 0 0 2px #ffcb05;
}

.contact-btn {
  background: #ffcb05;
  color: #013366;
  border: none;
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s;
}

.contact-btn:hover {
  background: #ffd738;
}



#successMessage {
  margin-top: 1rem;
  padding: 1rem;
  background: #d4edda;
  color: #155724;
  border-radius: 10px;
  font-weight: bold;
  display: none;
  text-align: center;
}

.success-show {
  display: block;
}

.success-hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}





/*Mobile layout*/

@media (max-width: 1024px) {

  /* General page layout */
  body {
    text-align: center;
    padding-bottom: 140px; /* extra room so content isn't hidden by footer if it stays fixed */
  }

  main.container {
    margin: 1rem auto;
    padding: 0 1rem;
  }

  h1 {
    text-align: center;
    margin-top: 1rem;
  }

  /* Navbar stacks + centers */
  .navbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
  }

  .logo {
    height: 70px;
    padding: 5px;
  }
  /* Show hamburger button on mobile/tablet */
  .nav-toggle {
    display: block;
    color: #333333;
  }
  /* Nav links are hidden by default on mobile/tablet */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 0 1rem;
    background-color: #cab810fb;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links li a {
    font-size: 18px;
  }

  /* Search bar stays centered and fits screen */
  .search-wrapper {
    width: 90%;
    max-width: 400px;
    margin: 1rem auto;
  }

  #searchInput {
    font-size: 14px;
  }

  /* Pokémon cards: one per row, centered */
  .pokemon-wrapper {
    justify-content: center;
    max-width: 100%;
    padding: 0 1rem 2rem;
  }

  .pokemon-card {
    display: block;
    margin: 0.75rem auto;
    width: 100%;
    max-width: 320px;
  }

  /* Footer stacks and centers nicely */
  .footer {
    position: fixed;      /* remove fixed on mobile so it doesn't cover content */
    padding: 1.5rem 1rem;
    padding-bottom: 0;
  }

  .footer-content {
    flex-direction: row !important;
    align-items: center;
    gap: 1rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
  }

  .footer-links li {
    display: inline; /* ensures side-by-side */
  }
  .back-to-top {
    top: 65px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }

  .battle-field {
    flex-direction: column;
    align-items: center;
  }

  .battle-inputs {
    flex-direction: column;
    align-items: center;
  }
  .battle-field {
    flex-direction: column;
    align-items: center;
  }

  .player-search, .enemy-search {
    max-width: 350px;
  }
  .contact-section {
      margin-top: 1rem;
      padding: 1.25rem;
    }
  
}