* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f6f6f6;
}

#root {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px;
  max-width: 1300px;
  margin: auto;
}

.card {
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ddd;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.card h1 {
  font-size: 16px;
  padding: 12px 16px 18px;
  text-align: center;
  color: #2E51A2;
  line-height: 1.4;
}

.card p {
  text-align: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #444;
}

.top-bar {
  max-width: 1100px;
  margin: 20px auto;
  padding: 15px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  background: white;
  border: 1px solid #ddd;

  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.top-bar input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
}

.top-bar select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.top-bar button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #2E51A2;
  color: white;
}

.top-bar button:hover {
  background: #3b6cc4;
}

.pagination {
  display: flex;
  gap: 8px;
}

/* DARK MODE */

body.dark {
  background: #121212 !important;
  color: white;
}

body.dark .card {
  background-color: #1e1e1e;
  border: 1px solid #333;
  box-shadow: 0 8px 20px rgba(255,255,255,0.05);
}

body.dark .card:hover {
  box-shadow: 0 16px 30px rgba(255,255,255,0.1);
}

body.dark .card h1 {
  color: #3b6cc4;
}

body.dark .card p {
  color: #cccccc;
}

body.dark .top-bar {
  background: #1e1e1e;
  border: 1px solid #333;
}

body.dark .top-bar input,
body.dark .top-bar select {
  background: #1e1e1e;
  color: white;
  border: 1px solid #444;
}

body.dark .top-bar button {
  background: #3b6cc4;
}

/* tablet */
@media (max-width: 1200px) {
  #root {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* small tablet */
@media (max-width: 900px) {
  #root {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* mobile */
@media (max-width: 500px) {
  #root {
    grid-template-columns: 1fr;
  }
}
