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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f0f0f0;
  color: #333;
  min-height: 100vh;
}

/* Header - Pinterest style */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e60023;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header p {
  display: none;
}

/* Search bar style */
.search-box {
  flex: 1;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 24px;
  background: #f0f0f0;
  font-size: 0.95rem;
  outline: none;
  transition: background 0.2s;
}

.search-box input:focus {
  background: #e1e1e1;
}

/* Filters */
.filters {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  z-index: 99;
  background: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid #e5e5e5;
}

.filter-btn {
  padding: 0.6rem 1rem;
  border: none;
  background: #f0f0f0;
  color: #333;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: #e1e1e1;
}

.filter-btn.active {
  background: #000;
  color: #fff;
}

/* Main content */
main {
  padding: 140px 1.5rem 2rem;
}

/* Masonry - Pinterest style */
.masonry {
  column-count: 2;
  column-gap: 1rem;
}

@media (min-width: 768px) {
  .masonry {
    column-count: 3;
  }
}

@media (min-width: 1024px) {
  .masonry {
    column-count: 4;
  }
}

@media (min-width: 1400px) {
  .masonry {
    column-count: 5;
  }
}

/* Image card - Pinterest style */
.image-card {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.image-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.image-card img {
  width: 100%;
  display: block;
  transition: transform 0.3s;
}

.image-card:hover img {
  transform: scale(1.05);
}

/* Overlay on hover */
.image-card .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4) 100%);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.image-card:hover .overlay {
  opacity: 1;
}

.image-card .overlay-text {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 16px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading {
  text-align: center;
  padding: 3rem;
  color: #888;
  display: none;
}

.loading.show {
  display: block;
}

/* Modal - Pinterest style */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .modal-content {
    flex-direction: row;
    max-width: 1000px;
  }
}

.modal-content img {
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
  display: block;
  background: #f5f5f5;
}

@media (min-width: 768px) {
  .modal-content img {
    max-height: 80vh;
    max-width: 60%;
  }
}

.modal-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #f0f0f0;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 1rem;
  text-transform: capitalize;
}

#modal-prompt {
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #333;
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
}

.copy-btn {
  width: 100%;
  padding: 0.9rem;
  background: #e60023;
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #ad081b;
}

.copy-btn.copied {
  background: #22c55e;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  color: #333;
  z-index: 10;
  border: none;
  transition: background 0.2s;
}

.close:hover {
  background: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
