/* Copyright 2025 Renofy Ltd. All rights reserved. */
/* Photo Upload Component Styles - Mobile First */

.photo-upload {
  width: 100%;
}

.photo-upload__help {
  margin-bottom: 0.75rem;
  color: var(--color-text-secondary);
}

.photo-upload__count {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-bottom: 0.3rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.photo-upload__preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.photo-upload__thumbnail {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-base);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  transition: var(--transition-fast);
}

.photo-upload__thumbnail:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-upload__thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-upload__thumbnail--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
}

.photo-upload__thumbnail--placeholder:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-upload__thumbnail--add {
  border: 2px solid var(--color-border);
  background: var(--color-bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  overflow: visible;
  /* Reset button default styles */
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.photo-upload__thumbnail--add:hover {
  border-color: var(--color-pink);
  background: rgba(215, 0, 96, 0.02);
}

.photo-upload__thumbnail--add:focus {
  outline: 2px solid var(--color-pink);
  outline-offset: 2px;
  border-color: var(--color-pink);
}

.photo-upload__thumbnail--add:focus:not(:focus-visible) {
  outline: none;
}

.photo-upload__add-icon {
  color: var(--color-text-secondary);
  opacity: 0.6;
  transition: var(--transition-fast);
}

.photo-upload__thumbnail--add:hover .photo-upload__add-icon {
  color: var(--color-pink);
  opacity: 1;
}

.photo-upload__add-text {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-align: center;
  transition: var(--transition-fast);
}

.photo-upload__thumbnail--add:hover .photo-upload__add-text {
  color: var(--color-pink);
}

.photo-upload__remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition-fast);
  padding: 0;
}

.photo-upload__thumbnail:hover .photo-upload__remove {
  opacity: 1;
}

.photo-upload__remove:hover {
  background: var(--color-danger);
  transform: scale(1.1);
}

.photo-upload__remove:active {
  transform: scale(0.95);
}

@media (min-width: 821px) {
  .photo-upload__preview {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
  }

  .photo-upload__remove {
    width: 28px;
    height: 28px;
    top: 0.5rem;
    right: 0.5rem;
  }

  .photo-upload__add-icon {
    width: 40px;
    height: 40px;
  }
}
