/* Find Tile - Simple photo tile with overlays */

.find-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-medium);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.find-tile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.find-tile-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
}

/* Bottom bar - spans full width */
.find-tile-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(250, 246, 240, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-sizing: border-box;
}

/* Username overlay - top left, 50% transparent */
.find-tile-user {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dark);
  background: rgba(250, 246, 240, 0.5);
  padding: 3px 6px;
  border-radius: 4px;
  max-width: calc(100% - 50px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* DateTime - inside bottom bar, left side */
.find-tile-datetime {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  display: flex;
  align-items: center;
  line-height: 1;
}

/* Rating stars - inside bottom bar, right side */
.find-tile-rating {
  display: flex;
  align-items: center;
  gap: 1px;
}

.find-tile-rating .star {
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.find-tile-rating .star svg {
  width: 100%;
  height: 100%;
  fill: var(--bg-medium);
  stroke: var(--text-light);
  stroke-width: 1;
}

.find-tile-rating .star.full svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* Comment badge - top right */
.find-tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--espresso);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
}

.find-tile-badge.unread {
  background: #e74c3c;
}

/* Grid layout for find tiles - always 2 columns minimum */
.find-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px;
}

/* Single tile (for modal) */
.find-tile.modal-tile {
  aspect-ratio: 4 / 3;
  max-height: 200px;
}

.find-tile.modal-tile .find-tile-user {
  font-size: 0.8rem;
}

.find-tile.modal-tile .find-tile-bottom-bar {
  height: 32px;
}

.find-tile.modal-tile .find-tile-rating .star {
  width: 14px;
  height: 14px;
}

.find-tile.modal-tile .find-tile-datetime {
  font-size: 0.7rem;
}

/* Responsive - scale overlays on small screens, keep 2 columns */
@media (max-width: 400px) {
  .find-tile-grid {
    gap: 6px;
    padding: 6px;
  }

  .find-tile {
    border-radius: 8px;
  }

  .find-tile-user {
    top: 4px;
    left: 4px;
    font-size: 0.6rem;
    padding: 2px 4px;
    max-width: calc(100% - 36px);
  }

  .find-tile-bottom-bar {
    height: 22px;
    padding: 0 4px;
  }

  .find-tile-rating .star {
    width: 10px;
    height: 10px;
  }

  .find-tile-datetime {
    font-size: 0.55rem;
  }

  .find-tile-badge {
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
  }
}

/* Hover effect */
.find-tile:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.find-tile:active {
  transform: scale(0.98);
}

/* Map popup styles - tile fills the bubble */
.find-tile-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
}

.find-tile-popup .leaflet-popup-content {
  margin: 0;
  width: 160px !important;
}

.map-popup-tile {
  width: 160px;
}

.map-popup-tile .find-tile {
  border-radius: 0;
  box-shadow: none;
}

.map-popup-tile .find-tile-user {
  font-size: 0.65rem;
  padding: 2px 5px;
  top: 5px;
  left: 5px;
}

.map-popup-tile .find-tile-bottom-bar {
  height: 26px;
  padding: 0 6px;
}

.map-popup-tile .find-tile-datetime {
  font-size: 0.6rem;
}

.map-popup-tile .find-tile-rating .star {
  width: 11px;
  height: 11px;
}
