:root {
  --bg-light: #f4f6f9;
  --bg-dark: #121212;
  --text-light: #333;
  --text-dark: #f1f1f1;
  --card-bg-light: #fff;
  --card-bg-dark: #1e1e1e;
  --primary: #0066cc;
  --primary-dark: #004d99;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background: var(--bg-dark);
  color: var(--text-dark);
}

header {
  background-color: #003366;
  color: white;
  padding: 20px 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
}

.logo {
  height: 50px;
  position: absolute;
  left: 20px;
  top: 15px;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.toggle-mode {
  position: absolute;
  right: 20px;
  top: 20px;
  background: #ffffff22;
  border: none;
  color: white;
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.search-container {
  text-align: center;
  margin: 20px;
}

.search-container input {
  padding: 10px;
  width: 300px;
  max-width: 90%;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  background: white;
}

body.dark-mode .search-container input {
  background: #2a2a2a;
  color: white;
  border: 1px solid #555;
}

main {
  padding: 20px;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.card {
  background: var(--card-bg-light);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  flex-basis: 280px;
  flex-grow: 1;
  max-width: 300px;
  text-align: center;
  transition: transform 0.2s, background 0.3s;
}

body.dark-mode .card {
  background: var(--card-bg-dark);
}

.card:hover {
  transform: scale(1.03);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.card a {
  display: inline-block;
  text-decoration: none;
  background-color: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.card a:hover,
.card a:focus {
  background-color: var(--primary-dark);
  outline: none;
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  background: #e6e6e6;
  margin-top: 30px;
}

body.dark-mode footer {
  background: #1c1c1c;
  color: #aaa;
}

@media (max-width: 600px) {
  .card {
    width: 90%;
  }
}