/* Custom styles for Chat2Photos mini-app */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  overscroll-behavior: none;
}

/* Tab buttons */
.tab-btn {
  color: #9ca3af;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

/* Photo grid item */
.photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

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

.photo-item .score-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.photo-item.low-quality {
  opacity: 0.5;
}

/* Theme card */
.theme-card {
  background: #1f2937;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.theme-card:active {
  background: #374151;
}

.theme-card .theme-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.theme-card .theme-count {
  color: #9ca3af;
  font-size: 14px;
}

/* Sub-theme chips */
.sub-theme-chip {
  display: inline-block;
  background: #374151;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  margin: 4px;
  cursor: pointer;
}

.sub-theme-chip:active {
  background: #4b5563;
}

/* Timeline date header */
.timeline-date {
  position: sticky;
  top: 90px;
  background: #111827;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  z-index: 5;
}

/* Modal */
#photo-modal {
  touch-action: pan-y;
}

#modal-info {
  max-height: 40vh;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}

.score-row .label {
  color: #9ca3af;
}

.score-bar {
  height: 4px;
  background: #374151;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
}

/* Theme badge in modal */
.theme-badge {
  display: inline-block;
  background: #374151;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  margin: 4px 4px 4px 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

/* Pull to refresh indicator */
.pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #374151;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pull-indicator.visible {
  opacity: 1;
}
