/* =====================================================
   Profile Page Stylesheet
   PeakList - Profile Settings
   ===================================================== */

/* Page Layout */
.profile-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  min-height: 100vh;
  background: var(--bg);
}

.is-hidden {
  display: none !important;
}

body.public-profile-mode .owner-only {
  display: none !important;
}

/* Header */
.profile-header {
  margin-bottom: 32px;
}

.profile-header h1 {
  margin: 0 0 8px 0;
  color: var(--ink);
  font-size: clamp(24px, 5vw, 32px);
}

.profile-header .subtitle {
  color: var(--ink-weak);
  font-size: 14px;
}

.profile-header .settings-header-actions {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-weak);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.back-link:hover {
  color: var(--accent);
  background: var(--input-bg);
}

/* Cards */
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  transition: box-shadow 0.2s;
}

.profile-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.profile-card h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-card-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-card-heading h2 {
  flex: 1;
  margin-bottom: 20px;
}

.profile-avatar-edit-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}

.profile-avatar-edit-button span {
  transform: translateY(-0.5px);
}

.profile-avatar-edit-button.is-open {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.card-count,
.section-count {
  margin-left: auto;
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.card-count.is-empty,
.section-count.is-empty {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--ink-weak);
}

.profile-card h2 .card-icon {
  font-size: 20px;
}

/* Avatar Section */
.profile-avatar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6b8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  font-weight: 600;
  border: 3px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
  overflow: hidden;
  position: relative;
}

.profile-avatar-icon.has-image {
  background: #0d1117;
}

.profile-avatar-icon.has-image span {
  opacity: 0;
}

.profile-avatar-media,
.profile-avatar-media picture {
  position: absolute;
  inset: 0;
  display: block;
}

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

.profile-avatar-info h3 {
  margin: 0 0 4px 0;
  color: var(--ink);
  font-size: 20px;
}

.profile-avatar-info p {
  margin: 0;
  color: var(--ink-weak);
  font-size: 14px;
}

.profile-avatar-info .user-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.profile-avatar-editor {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.profile-avatar-editor-url {
  margin-bottom: 0;
}

.settings-avatar-field {
  display: grid;
  gap: 16px;
}

.settings-avatar-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-avatar-picker {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.settings-avatar-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, var(--accent), #6b8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.settings-avatar-preview.has-image {
  background: #0d1117;
}

.settings-avatar-preview picture,
.settings-avatar-option-image picture {
  width: 100%;
  height: 100%;
  display: block;
}

.settings-avatar-preview-image,
.settings-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-avatar-selection-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.settings-avatar-selection-name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.settings-avatar-selection-description {
  color: var(--ink-weak);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.settings-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.settings-avatar-option {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 10px;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.settings-avatar-option:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.settings-avatar-option:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.95);
  outline-offset: 2px;
}

.settings-avatar-option.is-selected {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.22), 0 14px 26px rgba(0, 0, 0, 0.12);
}

.settings-avatar-option-image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(107, 140, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-avatar-option-image-img,
.settings-avatar-option-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-avatar-option-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

/* Info Grid */
.info-grid {
  display: grid;
  gap: 0;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  color: var(--ink-weak);
  font-size: 14px;
  font-weight: 500;
}

.info-item .value {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}

.info-item .value.subtle {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 11px;
  color: var(--ink-weak);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress Header with List Selector */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.progress-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.dashboard-header {
  gap: 18px;
  align-items: flex-start;
}

.dashboard-header-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dashboard-subtitle {
  margin: 0;
  color: var(--ink-weak);
  font-size: 14px;
  line-height: 1.5;
}

.list-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-selector .select {
  min-width: 150px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.list-selector .select:hover {
  border-color: var(--accent);
}

.list-selector .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-grid-primary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats-grid-ytd {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-value.accent { color: var(--accent); }
.stat-value.gold { color: #d4af37; }
.stat-value.red { color: #dc2626; }
.stat-value.blue { color: #3b82f6; }

#dashboardStats.loading .progress-header,
#dashboardStats.loading .stats-grid,
#dashboardStats.loading .dashboard-lists-layout,
#dashboardStats.loading .pulse-section {
  opacity: 0.55;
  filter: saturate(0.6);
  pointer-events: none;
}

#dashboardStats .main-loading {
  margin-bottom: 12px;
}

.stat-label {
  font-size: 13px;
  color: var(--ink-weak);
  font-weight: 500;
}

.stat-card-inline {
  text-align: left;
}

.dashboard-lists-layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.dashboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-panel-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.dashboard-panel-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-completion-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-completion-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-completion-metric strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.dashboard-completion-metric span {
  color: var(--ink-weak);
  font-size: 12px;
}

.dashboard-list-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-list-row.is-active {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12) inset;
}

.dashboard-list-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-list-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.dashboard-list-meta {
  color: var(--ink-weak);
  font-size: 12px;
}

.dashboard-list-value {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-secondary-note {
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.dashboard-note {
  margin: -6px 0 24px;
  color: var(--ink-weak);
  font-size: 12px;
  line-height: 1.6;
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.achievement-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-card.locked:hover {
  opacity: 0.6;
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.achievement-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-icon picture {
  width: 100%;
  height: 100%;
  display: block;
}

.achievement-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.achievement-icon-emoji {
  font-size: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card .btn-group .btn-primary,
.profile-card form .btn-primary {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.profile-card .btn-group .btn-primary:hover,
.profile-card form .btn-primary:hover {
  background: #16a34a;
  border-color: #16a34a;
}

.achievement-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 11px;
  color: var(--ink-weak);
  line-height: 1.3;
}

.achievement-date {
  font-size: 10px;
  color: var(--accent);
  margin-top: 8px;
  display: block;
}

.achievement-card.locked .achievement-date {
  color: var(--ink-weak);
}

/* Achievement Progress Bar */
.achievement-progress {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievement-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.achievement-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.achievement-progress-text {
  font-size: 10px;
  color: var(--ink-weak);
  text-align: center;
}

/* Hide progress on earned achievements */
.achievement-card:not(.locked) .achievement-progress {
  display: none;
}

.achievements-legacy-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.achievements-legacy-header {
  margin-bottom: 14px;
}

.achievements-legacy-header h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: var(--ink);
}

.achievements-legacy-header p {
  margin: 0;
  color: var(--ink-weak);
  font-size: 12px;
  line-height: 1.55;
}

/* Pulse Graph */
.pulse-section {
  margin-top: 24px;
}

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

.pulse-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
}

.pulse-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-weak);
}

.pulse-subtitle {
  font-size: 12px;
  color: var(--ink-weak);
  margin-bottom: 12px;
}

.pulse-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.activity-graph {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 720px;
}

.activity-graph-months {
  display: grid;
  grid-template-columns: 34px repeat(52, minmax(10px, 1fr));
  gap: 4px;
  align-items: end;
  font-size: 10px;
  color: var(--ink-weak);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-graph-month:first-child {
  grid-column: 2;
}

.activity-graph-body {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.activity-graph-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  gap: 4px;
  font-size: 10px;
  color: var(--ink-weak);
  line-height: 10px;
}

.activity-graph-weeks {
  display: grid;
  grid-template-columns: repeat(52, minmax(10px, 1fr));
  gap: 4px;
}

.activity-graph-week {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  gap: 4px;
}

.activity-graph-cell {
  width: 100%;
  min-width: 10px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.activity-graph-cell.intensity-0 {
  background: rgba(255, 255, 255, 0.05);
}

.activity-graph-cell.intensity-1 {
  background: rgba(34, 197, 94, 0.18);
}

.activity-graph-cell.intensity-2 {
  background: rgba(34, 197, 94, 0.38);
}

.activity-graph-cell.intensity-3 {
  background: rgba(34, 197, 94, 0.62);
}

.activity-graph-cell.intensity-4 {
  background: #22c55e;
}

.activity-graph-summary {
  color: var(--ink-weak);
  font-size: 12px;
  line-height: 1.5;
}

.activity-graph-empty {
  color: var(--ink-weak);
  font-size: 13px;
  padding: 10px 2px;
}

.pulse-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-weak);
}

.pulse-legend-dots {
  display: flex;
  gap: 2px;
}

.pulse-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-group .hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-weak);
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-group-vertical {
  flex-direction: column;
}

/* Messages */
.message {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--good);
  border-left: 3px solid var(--good);
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-left: 3px solid #ef4444;
}

.message.info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-left: 3px solid #3b82f6;
}

.message.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-left: 3px solid #f59e0b;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-banner {
  min-width: 240px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(14, 17, 23, 0.96);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  pointer-events: auto;
  animation: toast-slide-in 0.22s ease;
}

.toast-banner.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.35);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.35);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.35);
}

.toast-copy {
  flex: 1;
  font-size: 14px;
  line-height: 1.35;
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--ink-weak);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

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

/* Hike Logs Table - Clean Layout */
/* Override global table styles from styles.css */
.hike-logs-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-top: 8px;
  table-layout: auto;
}

.hike-logs-table thead tr {
  display: table-row;
  background: transparent;
  border: none;
  border-radius: 0;
}

.hike-logs-table thead th {
  display: table-cell;
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-weak);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  width: auto;
}

/* Column widths */
.hike-logs-table thead th:nth-child(1) { width: 130px; }
.hike-logs-table thead th:nth-child(3) { width: 120px; }
.hike-logs-table thead th:nth-child(4) { width: 110px; text-align: right; }
.hike-logs-table thead th:nth-child(5) { width: 120px; text-align: right; }
.hike-logs-table thead th:nth-child(6) { width: 132px; text-align: center; }

.hike-logs-table tbody tr {
  display: table-row;
  cursor: pointer;
  transition: background 0.15s;
  background: transparent;
  border: none;
  border-radius: 0;
}

.hike-logs-table tbody tr:hover {
  background: var(--input-bg);
  border-color: transparent;
  box-shadow: none;
}

.hike-logs-table tbody tr:nth-child(odd) {
  background: transparent;
}

.hike-logs-table tbody td {
  display: table-cell;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  border-left: none;
  border-radius: 0;
  vertical-align: middle;
  width: auto;
}

.table-link {
  color: inherit;
  text-decoration: none;
}

.table-link:hover {
  color: var(--accent);
}

.hike-logs-table tbody tr:last-child td {
  border-bottom: none;
}

/* Date column - override global styles */
.hike-logs-table tbody td:nth-child(1) {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-weak);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: left;
  width: 130px;
}

/* Peak name column - override global styles */
.hike-logs-table tbody td:nth-child(2) {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  width: auto;
}

/* List column - override global styles */
.hike-logs-table tbody td:nth-child(3) {
  font-size: 12px;
  color: var(--ink-weak);
  white-space: nowrap;
  width: 120px;
}

.hike-logs-table tbody td:nth-child(4),
.hike-logs-table tbody td:nth-child(5) {
  font-size: 12px;
  color: var(--ink-weak);
  text-align: right;
  white-space: nowrap;
}

.hike-logs-table tbody td:nth-child(4) {
  width: 110px;
}

.hike-logs-table tbody td:nth-child(5) {
  width: 120px;
}

.hike-logs-table tbody td:nth-child(6) {
  width: 132px;
  text-align: center;
}

/* Social Card Button */
.social-card-btn {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  line-height: 1;
}

.social-card-btn:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--accent);
  transform: scale(1.1);
}

.postcard-btn:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: #60a5fa;
}

.edit-hike-btn:hover {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.45);
}

.recent-hike-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.no-logs-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-weak);
  font-size: 14px;
}

.no-logs-message .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.favorites-list,
.user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.favorite-item,
.user-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.favorite-item:hover,
.user-item-link:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.08);
}

.favorite-item-copy {
  min-width: 0;
  flex: 1;
}

.favorite-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.favorite-subtitle {
  color: var(--ink-weak);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-chevron {
  color: var(--ink-weak);
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.list-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.list-skeleton-text {
  flex: 1;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line-lg {
  width: 62%;
}

.skeleton-line-sm {
  width: 38%;
}

/* Social Section */
.social-container {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.social-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.social-section.full-width {
  grid-column: 1 / -1;
}

.social-summary-card {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(255, 255, 255, 0.02));
}

.social-section h3 {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h3 {
  margin: 0;
}

.social-status-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.social-status-banner.has-alert {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.social-status-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.social-status-detail {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-weak);
}

.social-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.social-summary-stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.social-summary-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.social-summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-weak);
}

.coming-soon-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(34, 197, 94, 0.05));
  border-style: dashed;
}

.coming-soon-text {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.social-description {
  color: var(--ink-weak);
  font-size: 13px;
  margin: 0 0 12px 0;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

@media (max-width: 560px) {
  .share-buttons {
    grid-template-columns: 1fr;
  }
}

.social-section .btn-primary {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.social-section .btn-primary:hover {
  background: #16a34a;
  border-color: #16a34a;
}

.social-card-select {
  display: flex;
  gap: 10px;
  align-items: center;
}

.social-card-select select {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
}

.helper-text {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-weak);
}

.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box button {
  padding: 10px 20px;
  white-space: nowrap;
}

/* User Lists */
.user-list,
.friend-list,
.request-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.friend-list,
.request-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-item,
.friend-item,
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.2s;
  background: var(--card);
}

.user-item:hover,
.friend-item:hover,
.request-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.user-list .user-item,
.friend-list .user-item,
.request-list .user-item {
  margin-bottom: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.user-info-link {
  color: inherit;
  text-decoration: none;
}

.user-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6b8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.user-details .name {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .email {
  font-size: 12px;
  color: var(--ink-weak);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .meta {
  font-size: 12px;
  color: var(--ink-weak);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .meta-secondary {
  margin-top: 4px;
  white-space: normal;
}

.action-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-icon {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--ink-weak);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-accepted {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent);
}

.badge-member {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.toggle-info {
  flex: 1;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}

.toggle-description {
  font-size: 12px;
  color: var(--ink-weak);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Danger Zone */
.danger-zone {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid rgba(239, 68, 68, 0.3);
}

.danger-zone h3 {
  color: #ef4444;
  margin: 0 0 8px 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-zone p {
  color: var(--ink-weak);
  font-size: 13px;
  margin: 0 0 20px 0;
}

/* Secondary button style */
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--input-bg-hover);
  border-color: var(--accent);
}

.danger-zone .btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.danger-zone .btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.danger-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Export Section */
.export-section {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.export-btn:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.export-btn .icon {
  font-size: 18px;
}

/* Preferences Section */
.preference-grid {
  display: grid;
  gap: 0;
}

/* Loading States */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

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

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h3 {
  margin: 0 0 12px 0;
  color: var(--ink);
  font-size: 18px;
}

.modal p {
  margin: 0 0 24px 0;
  color: var(--ink-weak);
  font-size: 14px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-page {
    padding: 20px 16px 40px;
  }
  
  .profile-avatar {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-avatar-info {
    text-align: center;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    width: 100%;
  }
  
  .social-container {
    grid-template-columns: 1fr;
  }

  .social-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .social-section.full-width {
    grid-column: auto;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid-primary,
  .stats-grid-ytd,
  .dashboard-lists-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-completion-summary {
    grid-template-columns: 1fr;
  }
  
  .hike-logs-table {
    font-size: 13px;
  }
  
  .hike-logs-table th,
  .hike-logs-table td {
    padding: 10px 8px;
  }
  
  .danger-actions {
    flex-direction: column;
  }
  
  .danger-actions .btn {
    width: 100%;
  }
  
  .export-section {
    flex-direction: column;
  }
  
  .export-btn {
    width: 100%;
    justify-content: center;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .info-item .value {
    text-align: left;
  }

  .favorite-item,
  .user-item-link,
  .user-item {
    padding: 12px 14px;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast-banner {
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stats-grid-primary,
  .stats-grid-ytd {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 16px 12px;
  }
  
  .stat-value {
    font-size: 26px;
  }
  
  .pulse-container {
    padding: 12px;
  }
}
