.moodboard-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.moodboard-header { text-align: center; margin-bottom: 60px; }

/* Selection Counter */
.selection-counter { 
  text-align: center; 
  padding: 12px 20px; 
  background: linear-gradient(135deg, #eb9500 0%, #d4800a 100%); 
  color: white; 
  border-radius: 50px; 
  margin-bottom: 30px; 
  box-shadow: 0 4px 12px rgba(235, 149, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

.selection-counter p { 
  margin: 0; 
  font-weight: 600; 
  font-size: 14px;
}

.selection-counter span {
  font-weight: 700;
  font-size: 16px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-tabs { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.category-btn { 
  padding: 10px 20px; 
  border: 2px solid #eb9500; 
  background: transparent; 
  color: #3a5a40; 
  cursor: pointer; 
  border-radius: 50px; 
  font-weight: 600; 
  transition: all 0.3s; 
}
.category-btn.active { background: #eb9500; color: white; }
.category-btn:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 4px 12px rgba(235, 149, 0, 0.2);
}

/* Styles for selected items within the justified gallery */
#moodboardGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    width: 100%;
}

#moodboardGrid > a {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    aspect-ratio: auto;
}

#moodboardGrid > a img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #f5f5f5;
}

#moodboardGrid > a.selected {
    border: 4px solid #eb9500;
    box-shadow: 0 0 16px rgba(235, 149, 0, 0.6);
    transform: scale(0.98);
}

#moodboardGrid > a.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #eb9500;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    animation: popIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes popIn {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

#moodboardGrid > a:hover img {
    transform: scale(1.05);
}

#moodboardGrid > a:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.moodboard-controls { 
  background: rgba(249, 245, 240, 0.8); 
  padding: 24px; 
  border-radius: 12px; 
  margin-bottom: 40px; 
  display: flex; 
  gap: 16px; 
  flex-wrap: wrap; 
  justify-content: center;
  backdrop-filter: blur(10px);
}

.btn-control { 
  padding: 12px 24px; 
  border: none; 
  border-radius: 50px; 
  cursor: pointer; 
  font-weight: 600; 
  transition: all 0.3s; 
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary { 
  background: linear-gradient(135deg, #eb9500 0%, #d4800a 100%); 
  color: white; 
}

.btn-primary:hover { 
  background: linear-gradient(135deg, #d4800a 0%, #b36a08 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(235, 149, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary { 
  background: white; 
  color: #3a5a40; 
  border: 2px solid #3a5a40; 
}

.btn-secondary:hover { 
  background: #f9f5f0; 
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 90, 64, 0.15);
}

.btn-secondary:active {
  transform: translateY(0);
}

.preview-section { 
  background: linear-gradient(135deg, #f9f5f0 0%, #faf8f6 100%);
  padding: 40px; 
  border-radius: 12px; 
  margin-bottom: 40px;
  border: 1px solid rgba(235, 149, 0, 0.1);
}

.preview-title { 
  font-size: 24px; 
  font-weight: 600; 
  margin-bottom: 20px; 
  text-align: center;
  color: #3a5a40;
}

.preview-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
  gap: 12px; 
}

.preview-item { 
  position: relative; 
  border-radius: 8px; 
  overflow: hidden; 
  aspect-ratio: 1;
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-item img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover;
}

.preview-remove { 
  position: absolute; 
  top: 4px; 
  right: 4px; 
  background: rgba(235, 149, 0, 0.9); 
  color: white; 
  border: none; 
  width: 28px; 
  height: 28px; 
  border-radius: 50%; 
  cursor: pointer; 
  font-size: 14px; 
  font-weight: 700;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-remove:hover {
  background: #eb9500;
  transform: scale(1.2);
}

.code-section { 
  background: white; 
  padding: 24px; 
  border-radius: 12px; 
  border: 1px solid #e0e0e0;
  animation: slideInUp 0.3s ease-out;
}

.code-section h3 {
  color: #3a5a40;
  font-size: 20px;
}

.code-box { 
  background: #f5f5f5; 
  padding: 16px; 
  border-radius: 8px; 
  margin: 12px 0; 
  word-break: break-all; 
  font-family: 'Courier New', monospace; 
  font-size: 12px; 
  max-height: 200px; 
  overflow-y: auto;
  border: 1px solid #e0e0e0;
}

.copy-btn { 
  padding: 10px 18px; 
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white; 
  border: none; 
  border-radius: 50px; 
  cursor: pointer; 
  font-size: 13px; 
  margin-top: 8px;
  margin-right: 8px;
  font-weight: 600;
  transition: all 0.3s;
}

.copy-btn:hover { 
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.copy-btn:active {
  transform: translateY(0);
}

.empty-state { 
  text-align: center; 
  padding: 40px; 
  color: #999;
  font-size: 16px;
}

