/* ========== Global Reset ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", Arial, sans-serif;
}

body {
  background-color: #f9fafb;
  color: #222;
  line-height: 1.6;
}

/* ========== Header ========== */
header {
  background: #111827;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

nav {
  margin-top: 10px;
}

nav a {
  color: #9ca3af;
  margin: 0 10px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #fff;
}

/* ========== HERO SECTION ========== */
.hero {
  max-width: 1100px;
  margin: 30px auto;
  padding: 50px 25px;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: white;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.stats-box {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 25px;
}

.stat {
  background: rgba(255,255,255,0.15);
  padding: 18px 25px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

/* ========== Intro Section ========== */
.intro {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  margin: 20px auto;
  max-width: 900px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.intro h2 {
  font-size: 1.8rem;
  color: #111827;
  margin-bottom: 10px;
}

.intro p {
  color: #4b5563;
  font-size: 1rem;
}

/* ========== Search / Sort ========== */
#searchInput {
  padding: 12px;
  margin: 12px 0;
  width: 60%;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

#sortSelect {
  padding: 12px;
  margin-left: 10px;
  border-radius: 8px;
}

/* ========== Icons ========== */
.tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: block;
  margin: 0 auto 10px auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Large icons in featured section */
.featured-card .tool-icon {
  width: 45px;
  height: 45px;
  margin-bottom: 12px;
}

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  color: white;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.NEW {
  background: #22c55e;
}

.badge.TRENDING {
  background: #f59e0b;
}

.badge.VERIFIED {
  background: #2563eb;
}

/* ========== Cards ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto 50px auto;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card h3 {
  color: #1f2937;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.card p {
  color: #4b5563;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.category-tag {
  font-size: 13px;
  color: #666;
  font-style: italic;
  margin-bottom: 10px;
}

/* Visit Tool Button */
.card a {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.card a:hover {
  background: #1e40af;
}

/* ========== Featured Tools Section ========== */
.featured-section {
  max-width: 1100px;
  margin: 40px auto;
  padding: 20px;
}

.featured-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.featured-card {
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: 0.3s ease;
  text-align: center;
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.14);
}

.featured-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

/* ========== Pagination ========== */
.pagination button {
  margin: 5px;
  padding: 8px 14px;
  border: none;
  background: #333;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

.pagination button:hover {
  background: #555;
}

/* ========== Footer ========== */
footer {
  background: #111827;
  color: #9ca3af;
  text-align: center;
  padding: 25px 10px;
  font-size: 0.9rem;
  margin-top: 40px;
}

/* ========== Dark Mode ========== */
body.dark {
  background: #111;
  color: white;
}

body.dark .card {
  background: #1a1a1a;
  color: white;
}

body.dark .featured-card {
  background: #1a1a1a;
  color: white;
}

body.dark .badge.VERIFIED {
  background: #3b82f6;
}

body.dark .badge.TRENDING {
  background: #d97706;
}

body.dark .badge.NEW {
  background: #16a34a;
}

#darkToggle {
  padding: 10px 18px;
  background: #222;
  color: white;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#darkToggle:hover {
  background: #444;
}

/* ========== Responsive Layout ========== */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.4rem;
  }

  .intro {
    padding: 25px 15px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card {
    margin: 0 auto;
    max-width: 400px;
  }
}
