/* ============================================================================
   USER PANEL (Step 6)
   ============================================================================ */

/* User Menu Dropdown - Expanded */
.user-menu-items {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  transition: background 0.2s;
}

.user-menu-item:hover {
  background: var(--bg-secondary);
}

.user-menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* User Panel Header */
.user-panel-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-panel-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.user-header-text {
  flex: 1;
  min-width: 0;
}

.user-header-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.user-header-stats {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* User's Category Pills (for filtering within panel) */
.user-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

/* Responsive */
@media (max-width: 480px) {
  .user-panel-avatar {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
  
  .user-header-title {
    font-size: 20px;
  }
}

/* User Panel Category Pills */
.user-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.user-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-secondary, #f3f4f6);
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-category-pill:hover {
  background: var(--bg-tertiary, #e5e7eb);
}

.user-category-pill.active {
  background: var(--accent-color, #4f46e5);
  color: white;
  border-color: var(--accent-color, #4f46e5);
}

/* Collapsed state when filtering by category */
.user-category-pills-collapsed {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-category-pill-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-secondary, #f3f4f6);
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-category-pill-clear:hover {
  background: var(--bg-tertiary, #e5e7eb);
  color: var(--text-primary, #1f2937);
}

.user-category-pill-clear .clear-icon {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

/* ============================================================================
   LOCATION PANEL (Step 7)
   ============================================================================ */

/* Location Panel Header */
.location-panel-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.location-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.location-panel-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.location-header-text {
  flex: 1;
  min-width: 0;
}

.location-header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.location-header-address {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
}

.location-header-stats {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Location Category Pills */
.location-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.location-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.location-category-pill:hover {
  background: var(--bg-tertiary, #e5e7eb);
  border-color: var(--primary);
}

.location-category-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.location-category-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Responsive */
@media (max-width: 600px) {
  .location-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .location-panel-icon {
    width: 64px;
    height: 64px;
    font-size: 32px;
  }
  
  .location-header-title {
    font-size: 20px;
  }
}

/* ============================================================
   LOCATION PANEL - RICH DETAILS
   ============================================================ */

.location-rich-details {
  margin: 16px 0;
  padding: 0 16px;
}

.location-detail-row {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.location-detail-row:last-child {
  border-bottom: none;
}

.location-detail-label {
  flex: 0 0 80px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.location-detail-value {
  flex: 1;
  font-size: 14px;
  color: #1f2937;
}

.location-detail-link {
  color: #4f46e5;
  text-decoration: none;
}

.location-detail-link:hover {
  text-decoration: underline;
}

/* Hours - stacked lines */
.location-detail-hours .location-detail-value {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hours-line {
  font-size: 13px;
  line-height: 1.4;
}

/* Google Maps link - standalone button style */
.location-maps-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f3f4f6;
  color: #374151;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.location-maps-link:hover {
  background: #e5e7eb;
  text-decoration: none;
}

/* Description - full width, italic */
.location-detail-description {
  display: block;
  padding: 12px 0;
}

.location-detail-description p {
  margin: 0;
  font-size: 14px;
  font-style: italic;
  color: #4b5563;
  line-height: 1.5;
}

/* ============================================
   CATEGORY STATS GRID (Top Collectors, Latest Yoinks, Uncollected, In This View)
   ============================================ */

.category-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.category-stats-grid > .category-stats-card {
  margin: 0 !important;
  min-width: 0;
  overflow: hidden;
}

/* Mobile: Stack vertically */
@media (max-width: 600px) {
  .category-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================
   CATEGORY LEADERBOARD (Mini)
   ============================================ */

.category-leaderboard {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-leaderboard .leaderboard-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.category-leaderboard .leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-leaderboard .leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.category-leaderboard .leaderboard-row:hover,
.category-leaderboard .leaderboard-row:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.category-leaderboard .leaderboard-row:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-color);
}

.category-leaderboard .leaderboard-rank {
  font-size: 14px;
  min-width: 24px;
  text-align: center;
}

.category-leaderboard .leaderboard-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.category-leaderboard .leaderboard-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.category-leaderboard .leaderboard-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-leaderboard .leaderboard-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Mobile: Stack leaderboard below stats */
@media (max-width: 768px) {
  .category-leaderboard {
    margin-top: 16px;
  }
}

/* ============================================
   CATEGORY PANEL - Progress Bar
   ============================================ */

.category-progress-section {
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ============================================
   CATEGORY PANEL - In This View Leaderboard
   ============================================ */

.category-leaderboard-view {
  margin-top: 12px;
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.15);
}

.category-leaderboard-view .leaderboard-title {
  color: var(--primary);
}

.view-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}

.leaderboard-compact .leaderboard-row {
  padding: 6px 10px;
}

.leaderboard-compact .leaderboard-avatar {
  width: 24px;
  height: 24px;
}

.leaderboard-compact .leaderboard-name {
  font-size: 13px;
}

.leaderboard-compact .leaderboard-count {
  font-size: 12px;
  padding: 1px 6px;
}

/* ============================================
   CATEGORY PANEL - Uncollected Nearby
   ============================================ */

.category-uncollected-section {
  margin: 16px 0;
  padding: 16px;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.15);
}

.category-uncollected-section .section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

.uncollected-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uncollected-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 0;
}

.uncollected-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.uncollected-item .location-emoji {
  font-size: 16px;
}

.uncollected-item .location-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uncollected-item .location-distance {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   CATEGORY PANEL - Latest Yoinks
   ============================================ */

.category-latest-section {
  margin: 16px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-latest-section .section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

.latest-yoinks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.latest-yoink-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.latest-yoink-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.latest-yoink-item .yoink-emoji {
  font-size: 16px;
}

.latest-yoink-item .yoink-info {
  flex: 1;
  min-width: 0;
}

.latest-yoink-item .yoink-location {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-yoink-item .yoink-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.latest-yoink-item .yoink-meta a {
  color: var(--accent-color);
  text-decoration: none;
}

.latest-yoink-item .yoink-meta a:hover {
  text-decoration: underline;
}

/* ============================================
   MAP PINS - Collected vs Uncollected
   ============================================ */

/* Custom marker styling for collected/uncollected */
.map-marker-collected {
  background: var(--success);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.map-marker-uncollected {
  background: #f59e0b;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ============================================
   USER PANEL - Enhanced Header
   ============================================ */

.user-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-header-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.user-panel-bio {
  margin: 12px 0 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 600px;
}

.user-panel-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s;
}

.social-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* ============================================
   EDIT PROFILE MODAL
   ============================================ */

.edit-profile-modal-content {
  max-width: 480px;
  width: 100%;
}

.edit-profile-body {
  padding: 24px;
}

.edit-profile-body h2 {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 600;
}

.edit-profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Avatar Upload */
.avatar-upload-group {
  margin-bottom: 8px;
}

.avatar-upload-container {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 8px;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview-initial {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.avatar-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-upload-btn {
  cursor: pointer;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  color: var(--error-color);
  text-decoration: underline;
}

/* Input with prefix */
.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.input-prefix {
  padding: 10px 0 10px 12px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding-right: 8px;
}

.input-with-prefix input {
  border: none;
  border-radius: 0;
  flex: 1;
}

.input-with-prefix input:focus {
  outline: none;
  box-shadow: none;
}

.input-with-prefix:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.2);
}

/* Character count */
.char-count {
  text-align: right;
}

.char-count.over-limit {
  color: var(--error-color);
}

/* Form error */
.form-error,
.edit-profile-error {
  color: var(--error-color);
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(var(--error-color-rgb), 0.1);
  border-radius: 6px;
}

/* Actions */
.edit-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .avatar-upload-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .user-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

