/* ===== GeoSolvr: My passport (passport.html, js/passport.js) =====
   Loaded after styles.css and discoveries.css (which give the page, header and menu). */

.pp-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.pp-title-row h2 {
  margin: 0;
}

/* ---- Profile ---- */
.pp-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 28px;
  background: var(--surface-1);
  border-radius: 14px;
}

.pp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-3);
  flex-shrink: 0;
}

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

/* No avatar chosen: your initial */
.pp-avatar-none {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
}

.pp-avatar-lg {
  width: 88px;
  height: 88px;
}

.pp-avatar-lg.pp-avatar-none {
  font-size: 38px;
}

.pp-avatar-btn {
  position: relative;
  padding: 0;
  background: none;
  border-radius: 50%;
}

.pp-avatar-btn:active {
  transform: none;
}

.pp-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-primary);
  background: var(--surface-0);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pp-who {
  min-width: 0;
}

.pp-name {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pp-name-none {
  color: var(--text-secondary);
}

.pp-country {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.pp-flag {
  width: 24px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pp-link {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: none;
}

.pp-link:active {
  transform: none;
}

/* ---- Sections ---- */
.pp-section {
  margin-bottom: 32px;
}

.pp-heading-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pp-heading {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.pp-count {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---- Stats ---- */
.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
}

.pp-stat {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  background: var(--surface-1);
  border-radius: 12px;
}

/* "View" link after Places discovered */
.pp-stat .pp-view {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-left: 6px;
}

@media (hover: hover) {
  .pp-stat .pp-view:hover {
    text-decoration: underline;
  }
}

.pp-stat dd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.pp-stat dd a {
  color: inherit;
  text-decoration: none;
}

.pp-of {
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral);
}

.pp-stat dt {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pp-stat-streak svg {
  width: 22px;
  height: 22px;
  fill: var(--accent);
  margin-bottom: 4px;
}

/* ---- Achievements ---- */
.pp-group {
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ach-colour, var(--accent));      /* the group's colour (styles.css) */
}

.pp-badges {
  display: grid;
  /*grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));*/
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.pp-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--surface-1);
  border: none;
  border-radius: 12px;
  cursor: pointer;                     /* tap for the achievement's card */
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pp-badge:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .pp-badge:hover {
    opacity: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

/* The icon and its roundel (.pp-badge-icon is also .ach-icon): sizes and colours are in styles.css,
   under "Achievement badges", with the colour for each group */

.pp-badge-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pp-badge-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.pp-badge-desc {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
  text-wrap: balance;
}

/* Not earned yet: a little faded */
.pp-badge:not(.is-earned) .pp-badge-title {
  color: var(--text-secondary);
}

.pp-progress {
  display: block;
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: 2px;
}

.pp-progress span {
  display: block;
  height: 100%;
  background: var(--ach-bar, var(--ach-colour, var(--accent)));   /* the group's colour, unless --ach-bar is set */
  border-radius: 2px;
}

/* ---- One achievement's card (tap a badge) ---- */
.pp-ach-modal {
  max-width: 340px;
}

.pp-ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 4px;
  text-align: center;
}

.pp-ach-group {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ach-colour, var(--accent));
}

.pp-ach-card .pp-ach-icon {
  width: 96px;
  height: 96px;
  margin: 14px 0 16px;
}

.pp-ach-card .pp-ach-icon .ach-glyph {
  width: 64px;
  height: 64px;
}

.pp-ach-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.pp-ach-desc {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-secondary);
  text-wrap: balance;
}

.pp-ach-status {
  margin: 18px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pp-ach-earned {
  color: var(--ach-colour, var(--accent));
}

.pp-ach-progress {
  align-self: stretch;
  margin-top: 18px;
}

.pp-ach-progress .pp-progress {
  height: 6px;
  margin: 0;
  border-radius: 3px;
}

.pp-ach-progress-text {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pp-soon {
  align-self: flex-start;
  margin-top: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-3);
  border-radius: 4px;
}

/* ---- Modals: avatar picker, edit details ---- */
.pp-modal {
  position: relative;
  max-width: 460px;
  padding: 24px;
  text-align: left;
}

.pp-modal-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
}

.pp-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 12px;
}

.pp-avatar-pick {
  display: flex;
  justify-content: center;
  padding: 6px;
  background: none;
  border-radius: 50%;
}

.pp-avatar-pick .pp-avatar {
  width: 64px;
  height: 64px;
}

.pp-avatar-pick.is-on .pp-avatar {
  box-shadow: 0 0 0 3px var(--accent);
}

.pp-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pp-form label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

.pp-form input,
.pp-form select {
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-0);
}

.pp-note {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.pp-error {
  min-height: 1em;
  margin: 4px 0 0;
  font-size: 13px;
  color: #c0392b;
}

.pp-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ===== Tabs: My record, Friends, Achievements ===== */
.pp-tabs {
  display: flex;
  gap: 12px;
}

.pp-tab {
  flex: 0 1 175px;
  min-width: 0;
  padding: 14px 12px 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--neutral);
  background: linear-gradient(to bottom, var(--surface-2), var(--surface-3));
  border-radius: 12px 12px 0 0;
  transition: 0.3s ease-in-out;
}

.pp-tab[aria-selected="true"] {
  color: var(--text-primary);
  background: var(--surface-1);
}

.pp-tab:active {
  transform: none;
}

@media (hover: hover) {
  .pp-tab:not([aria-selected="true"]):hover {
    color: var(--text-primary);
    opacity: 1;
  }
}

/* The panel joins on to the open tab */
.pp-panel {
  padding: 28px;
  margin-bottom: 32px;
  background: var(--surface-1);
  border-radius: 0 14px 14px 14px;
}

.pp-panel[hidden] {
  display: none;
}

.pp-panel .pp-section:last-child {
  margin-bottom: 0;
}

/* My record: profile on the left, stats on the right */
.pp-record {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 32px;
}

.pp-panel .pp-profile {
  flex: 0 0 315px;
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
}

.pp-record .pp-stats {
  flex: 1;
}

/* On the grey panel, tiles are white */
.pp-panel .pp-stat,
.pp-panel .pp-badge,
.pp-panel .fr-row,
.pp-panel .fr-tool {
  background: var(--surface-0);
}

.pp-panel .pp-heading-row .pp-heading,
.pp-panel #ppFriends > .pp-heading-row,
.pp-panel #ppAchievements:first-child {
  margin-top: 0;
}

.pp-panel .pp-group:first-child {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .pp-record {
    flex-direction: column;
    gap: 20px;
  }

  .pp-panel .pp-profile {
    flex: none;
  }

  .pp-record .pp-stats {
    width: 100%;
  }

  .pp-badge {
    flex-direction: column;
    text-align: center;
  }
}


@media (max-width: 900px) {

  .pp-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .pp-stat {
    padding: 14px 16px;
  }

  .pp-profile {
    padding: 16px;
    gap: 16px;
  }

  .pp-avatar-lg {
    width: 72px;
    height: 72px;
  }

  .pp-name {
    font-size: 19px;
  }

  .pp-tabs {
    gap: 6px;
  }

  .pp-tab {
    flex: none;
    font-size: 12px;
    letter-spacing: 0.02em;
    min-width: 90px;
  }

  .pp-panel {
    padding: 16px;
  }

  .pp-badges {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pp-badge {
    padding: 12px;
    flex-direction: row;
    text-align: left;
  }

  .pp-badge-desc {
    text-wrap: pretty;
  }

  .pp-badge-icon {
    width: 50px;
    height: 50px;
  }

  .pp-badge-icon .ach-glyph {
    width: 30px;
    height: 30px;
  }

  .pp-badge-text {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .pp-tab {
    font-size: 11px;
    letter-spacing: 0;
  }
}


