* {
  box-sizing: border-box;
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
}

body {
  background: #0f172a;
  color: #e2e8f0;
}

.app {
  max-width: 1100px;
  margin: 40px auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 25px;
}

.subtitle {
  color: #94a3b8;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

input {
  width: 60%;
  padding: 12px;
  border-radius: 8px;
  border: none;
}

button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #22c55e;
  color: #000;
  cursor: pointer;
  font-weight: 600;
}

button:hover { background: #16a34a; }
button.primary { background: #3b82f6; color: #fff; }
button.primary:hover { background: #2563eb; }

#alerts {
  text-align: center;
  margin-bottom: 15px;
}

.alert {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.error { background: #dc2626; }
.success { background: #16a34a; }

.hidden { display: none; }

/* Loader */
.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #334155;
  border-top: 5px solid #22c55e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loader {
  text-align: center;
  margin: 20px 0;
}

/* Stats */
.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
  flex-wrap: wrap;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.card {
  position: relative;
  background: #1e293b;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, border .08s ease;
  border: 2px solid transparent;
}

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

.card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
}

.card p {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.2;
}

/* Selection visuals */
.card.selected {
  border-color: #22c55e;
}

.overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #22c55e;
  color: white;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  display: none;
}

.card.selected .overlay {
  display: inline-block;
}

/* --- Add to bottom of style.css --- */

#downloadOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  text-align: center;
}

.overlay-content {
  background: #1e293b;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  max-width: 500px;
  border: 1px solid #334155;
}

.overlay-content h2 {
  color: #f8fafc;
  margin-top: 25px;
  font-size: 1.5rem;
}

.quote {
  margin-top: 15px;
  font-style: italic;
  color: #38bdf8;
  font-size: 1.1rem;
  line-height: 1.5;
}

.large-spinner {
  width: 60px;
  height: 60px;
  border-width: 6px;
  border-top-color: #38bdf8;
}

#downloadOverlay.hidden {
  display: none !important;
}#downloadOverlay.hidden {
  display: none !important;
}