/* --------------------------------------------------
   Base Styles
-------------------------------------------------- */
body {
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(to bottom, #e0f7ff, #fff);
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal scroll */
  box-sizing: border-box;
}

/* Headings */
h1 {
  color: #333;
  font-size: 36px;
  margin: 0;
  text-align: center;
}

h2 {
  color: #333;
  font-size: 27px;
  margin: 0;
  text-align: center;
}

/* --------------------------------------------------
   Buttons
-------------------------------------------------- */
button {
  background-color: #0074d9;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Navigation Buttons */
#buttons {
  text-align: center;
  margin-top: 20px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#button-container > div {
  display: flex;
  gap: 10px;
}

/* Collection Button */
.collection-btn {
  background-color: #fc0;
  border: none;
  color: #333;
  font-size: 16px;
  padding: 10px 25px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.collection-btn:hover {
  background-color: #fd3;
}

/* Type Buttons (used in game) */
.type-btn {
  padding: 14px 30px;
  font-size: 18px;
  border: 5px solid transparent;
  border-radius: 12px;
  font-weight: bold;
  transition: 0.2s ease;
  cursor: pointer;
  color: white;
  width: 200px;
  min-height: 50px;
  background-color: #d3d3d3;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.type-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Highlight for selected answer */
.selected {
  border-color: yellow;
  box-shadow: 0 0 12px yellow;
}

/* --------------------------------------------------
   Header
-------------------------------------------------- */
.header {
  background-color: #fc0;
  text-align: center;
  padding: 20px;
  border-bottom: 4px solid #0074d9;
}

.logo {
  width: 220px;
}

/* --------------------------------------------------
   Home Page
-------------------------------------------------- */
.home-page {
  width: 250px;
  background: white;
  border: 3px solid #0074d9;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 6px 12px rgb(0 0 0 /10%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-page:hover {
  transform: scale(1.05);
  background-color: rgb(0 0 0 / 10%);
}

.home-page img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

.home-page-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 30px;
  padding: 40px 20px;
  margin: 0 auto;
  max-width: 1100px;
}

/* --------------------------------------------------
   Game Layout
-------------------------------------------------- */
.game-layout {
  display: flex;
  justify-content: space-between;
  padding: 40px;
}

/* Left Panel */
.left-panel {
  width: 35%;
  text-align: center;
}

.left-panel h2 {
  color: #0074d9;
  margin-bottom: 30px;
}

.type-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

/* Right Panel */
.right-panel {
  width: 55%;
  text-align: center;
}

/* --------------------------------------------------
   Pokémon Image
-------------------------------------------------- */
.pokemon-img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  border: 4px solid #fc0;
  border-radius: 16px;
  background-color: #fff;
  padding: 20px;
  margin-bottom: 20px;
}

/* --------------------------------------------------
   Result Message
-------------------------------------------------- */
#result-msg {
  margin-top: 15px;
  font-weight: bold;
  font-size: 16px;
}

/* Success and error colors for result messages */
#result-msg.success {
  color: green;
}

#result-msg.error {
  color: red;
}

/* --------------------------------------------------
   Collection Grid & Cards
-------------------------------------------------- */

#button-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  margin-top: 20px;
  max-width: 1100px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.collection-button-group {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Added select feature when hovering over card */
.pokemon-card {
  width: 200px;
  height: 290px;
  background: white;
  border: 3px solid #0074d9;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 6px 12px rgb(0 0 0 /10%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pokemon-card:hover {
  transform: scale(1.05);
  background-color: rgb(0 0 0 / 15%);
}

/* Makes sure Pokemon image is centered in the card */
.pokemon-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.pokemon-card h3 {
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 20px;
}

/* Remove underline from pokemon name links */
.pokemon-card-link {
  text-decoration: none !important;
}

.pokemon-card-link h3 {
  text-decoration: none !important;
  color: #03cc; /* or your preferred color */
}

.pokemon-card-link:visited h3 {
  color: #03cc;
}

/* --------------------------------------------------
   Flashcards layout (check this later forgot what this is referring to)
-------------------------------------------------- */
.flashcards-page #card-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin: 30px auto;
  max-width: 900px;
}

/* --------------------------------------------------
   Displays a Max of 5 Cards Per Row
   Responsive Units
-------------------------------------------------- */

.collection-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* Ensure min width fits your card */
  gap: 10px; /* More spacing between cards */
  padding: 40px 20px; /* More outer padding */
  margin: 0 auto;
  max-width: 1000px; /* Wider max width */
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  justify-items: center;
}

.collection-grid a {
  color: black;
  text-decoration: none;
}

/* Collection grid works on mobile devices */
@media (width <= 1024px) {
  .collection-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (width <= 640px) {
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.nickname {
  font-style: italic;
  color: #666;
  font-size: 0.9em;
   margin: 2px 0 4px;
}

/* Favorite-icon in collection page */
.favorite-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  filter: drop-shadow(0 0 2px black); /* shadow on favorite mark */
}

.favorite-icon img.heart-img {
  width: 40px;
  height: 40px;
  display: block;
}

.loading {
  font-size: 1.5rem;
  text-align: center;
  padding: 2rem;
  display: none; /* hidden by default */
}


/* --------------------------------------------------
   Feedback Page
-------------------------------------------------- */

/* center the form on the page */
.feedback-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh; /* makes it nicely centered vertically */
  padding: 20px;
}

/* style the form itself as a column */
.feedback-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; /* space between inputs */
  background: white;
  border: 3px solid #0074d9;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 6px 12px rgb(0 0 0 / 10%);
  width: 100%;
  max-width: 400px; /* limits form width on big screens */
}

.feedback-form input,
.feedback-form textarea,
.feedback-form select,
.feedback-form button {
  width: 100%;
  max-width: 350px; /* keeps input widths consistent */
  padding: 8px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* style the button for better appearance */
.feedback-form button {
  background-color: #0074d9;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.feedback-form button:hover {
  background-color: #005fa3;
}

/* container for the feedback link button at bottom of home page */
.feedback-link-container {
  text-align: center;
  margin-top: 40px;
}

/* styling for the feedback link button itself */
.feedback-link-btn {
  background-color: #0074d9;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.feedback-link-btn:hover {
  background-color: #005fa3;
  transform: scale(1.05);
}

/* --------------------------------------------------
   Edit Page
-------------------------------------------------- */
.edit-mode {
  background: linear-gradient(to bottom, #e0ffe0, #fff);
}

.edit-mode .header {
  background-color: #8c8;
  border-bottom: 4px solid #393;
}

.edit-mode h1 {
  color: #2d6b2d;
}

/* stylelint-disable-next-line no-descending-specificity */
.edit-mode button {
  background-color: #4caf50;
}

/* stylelint-disable-next-line no-descending-specificity */
.edit-mode button:hover { 
  background-color: #45a049;
}

.description {
  font-family: "Times New Roman", Times, serif;
  font-size: large;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.edit-mode .pokemon-card {
  width: 300px;
  height: auto;
  margin: 30px auto;
  padding: 20px;
  background: white;
  border: 3px solid #6b6;
  border-radius: 14px;
  box-shadow: 0 6px 12px rgb(0 128 0 / 15%);
  text-align: center;
}

/* stylelint-disable-next-line no-descending-specificity */
.edit-mode .pokemon-card:hover { /* Disables hover on edit page */
  transform: none;
  background-color: white; /* or whatever the default is */
}

.edit-mode .pokemon-card img {
  width: 250px;
  height: 250px;
  object-fit: contain;
}

.edit-mode .pokemon-card h3 {
  font-size: 24px;
  margin-top: 10px;
}
  
 /* other features not familiar with */
.type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: bold;
  margin: 4px 0;
  line-height: 1.2;
  text-transform: capitalize;
  box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
}

.collection-message {
  grid-column: 1 / -1; /* spans all columns in the grid */
  text-align: center;
  color: #c00;
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 40px;
  padding: 20px;
  line-height: 1.6;
}

.collection-message a {
  color: #0074d9;
  text-decoration: underline;
  font-weight: normal;
}

.inline-heart {
  width: 35px;
  height: 35px;
  vertical-align: bottom;
  margin: 0;
}
