/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  background: #f4f8fb;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center; /* Center children horizontally */
  overflow-x: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* space-between to keep dropdown left and title center */
  gap: 1rem;
  padding: 1rem 1.5rem;
  background-color: #0070f3;
  color: white;
  position: relative;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
  flex: 1;
  order: 2; /* So that heading is center in flex container */
}

.dropdown {
  position: relative; /* relative for dropdown */
  order: 1; /* dropdown on left */
}

.dropbtn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  width: 160px;
  padding: 0.5rem 0;
}

.dropdown-content.show,
.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: 10px 15px;
  text-align: left;
  color: #333;
  transition: background 0.3s;
}

.dropdown-content a:hover {
  background: #f0f0f0;
}

main {
  flex: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center; /* center horizontally */
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}

#search {
  padding: 10px 16px;
  font-size: 1rem;
  width: 100%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#plugin-list {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  justify-items: center; /* center grid items */
  box-sizing: border-box;
}

.plugin-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeSlideUp 0.5s forwards;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
}

.plugin-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.plugin-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 112, 243, 0.2);
}

.plugin-title {
  font-size: 1.2rem;
  color: #0070f3;
  margin-bottom: 0.4rem;
  text-align: center;
}

.plugin-desc {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  text-align: center;
}

.plugin-meta {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: #555;
  text-align: center;
}

.plugin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0.8rem;
  justify-content: center;
}

.copy-btn, .support-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.copy-btn {
  background-color: #0070f3;
  color: white;
}

.support-btn {
  background-color: #e6f3ff;
  color: #0070f3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  background-color: #005ec4;
}

.support-btn:hover {
  background-color: #cce6ff;
}

footer {
  background: #f9f9f9;
  text-align: center;
  padding: 1.2rem 1.5rem;
  font-size: 0.95rem;
  color: #333;
  border-top: 1px solid #ddd;
  margin-top: auto;
  line-height: 1.5;
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}

footer a {
  color: #0070f3;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

footer i {
  margin-right: 6px;
  color: #0070f3;
}

/* Animation */
@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  body, html {
    padding-left: 0;
    padding-right: 0;
  }

  main {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  #plugin-list {
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 100%;
    justify-items: center; /* center children in grid */
  }

  .plugin-card {
    margin-left: auto;
    margin-right: auto;
  }
}
