/* UpJord Clean Design */
/* Inspired by modern fitness apps */

/* Drop and Circle Icon Colors */
.drop-icon .fa-droplet {
  color: #3b82f6; /* Blue color for droplet */
}

.drop-icon .fa-circle {
  color: #9ca3af; /* Gray color for circle */
}


/* Adventure Notes Link Styling */
.adventure-notes-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: background-color 0.2s ease;
}

/* Photo Modal Styles */
.photo-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Photo hover effect */
.adventure-photo {
  cursor: pointer;
  transition: transform 0.2s ease;
}

:root {
  /* Natural Color Palette */
  --sage-green: #8FA68E;
  --forest-green: #4A5D3A;
  --earth-brown: #8B7355;
  --warm-beige: #F5F1E8;
  --stone-gray: #9CA3AF;
  --soft-white: #FEFCF7;
  --deep-green: #2D5016;

  /* Text Colors */
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-white: #FFFFFF;

  /* Background Colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --bg-accent: #F0F9FF;

  /* Border Colors */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;

  /* Status Colors */
  --error-red: #DC2626;
  --warning-orange: #D97706;
  --success-green: #059669;

  /* Spacing System */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 25px;
  --space-2xl: 24px;
  --space-3xl: 25px;
  --space-4xl: 48px;

  /* Typography */
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 32px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-offset: 0px 3px 0px 0px rgb(0 0 0 / 10%);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Layout */
  --sidebar-width: 320px;
  --header-height: 64px;
  --max-width: 1400px;
  --profile-avatar-size: 80px;
  --badge-height: 24px; /* visual height of level badge */
  --badge-offset: 12px; /* overlap distance below avatar */

  --drop-down-menu-bg: #e2e2e2;
  --drop-down-menu-options-bg: #f2f2f2;

  --button-selected-bg: #000000;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {

    --adventure-card-bg: #17202f;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;

    --bg-primary: #111827;
    --bg-secondary: #18202b;
    --bg-tertiary: #374151;
    --bg-accent: #1E293B;

    --border-light: #374151;
    --border-medium: #4B5563;

    --sage-green: #86C5A0;
    --forest-green: #6B9B7A;
    --earth-brown: #A89078;

    --error-red: #EF4444;
    --warning-orange: #F59E0B;
    --success-green: #10B981;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-offset: 0px 3px 0px 0px rgb(255 255 255 / 10%);

    --drop-down-menu-bg: #58606c;
    --drop-down-menu-options-bg: #454f5e;

    --button-selected-bg: #374151;
  }
}

/* ========== BASE STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== LAYOUT ========== */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  grid-template-rows: var(--header-height) 1fr auto;
  min-height: 100vh;
  gap: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--bg-secondary);
  grid-template-areas:
    "header header header"
    "left-sidebar main-content right-sidebar"
    "footer footer footer";
}

/* Collapse layout when no right sidebar (adventure detail view) */
.app-container.no-right-sidebar {
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas:
    "header header"
    "left-sidebar main-content"
    "footer footer";
}

.app-container.no-right-sidebar .right-sidebar { display: none; }

/* Header */
.app-header {
  grid-area: header;
  background: var(--bg-primary);
  border-bottom: none;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
  border-radius: 0 0 10px 10px;
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  height: var(--header-height);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-right {
  display: flex;
  align-items: center;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: var(--space-xl);
}

/* Profile dropdown (right-top) */
.menu {
  position: relative;
  margin-left: var(--space-xl);
}

.menu-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: transparent;
  border: 2px solid transparent;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
}

.menu-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.profile-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.profile-menu-icon {
  font-size: 22px;
  color: var(--text-secondary);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  display: none;
  z-index: 100;
}

.menu-dropdown.open {
  display: block;
}

.dropdown-item {
  display: block;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-item.logout {
  color: var(--error-red);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
  border: 2px solid transparent;
}

.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.nav-link.active {
  background: var(--sage-green);
  color: var(--text-white);
  border-color: var(--forest-green);
}

.logout-link:hover {
  background: var(--error-red);
  color: var(--text-white);
  border-color: var(--error-red);
}

/* Header search and icon buttons */
.header-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 2px solid var(--border-medium);
  padding: 6px 10px;
  border-radius: 999px;
  margin-right: var(--space-lg);
  cursor: text;
}

.header-search .search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  width: 0;
  min-width: 0;
  transition: width var(--transition-normal);
}

.header-search .search-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.header-search.expanded .search-input { width: 220px; min-width: 220px; }
.header-search.expanded .search-close { display: inline-flex; }

.icon-button {
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 8px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-right: var(--space-lg);
}

.icon-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* ========== NOTIFICATIONS (HEADER) ========== */
.notifications { position: relative; margin-right: var(--space-lg); }
.notifications-button { position: relative; }
.notifications-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--error-red);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 420px;
  display: none;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 40; /* keep below sticky header-edge overlays */
}
.notifications-dropdown.open { display: block; }
.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
}
.notifications-refresh {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 6px 8px;
}
.notifications-refresh:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.notifications-content { position: relative; max-height: 340px; overflow-y: auto; }
.notifications-loading { padding: 12px; text-align: center; }
.notifications-list { list-style: none; margin: 0; padding: 0; }
.notifications-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.notifications-item:hover { background: var(--bg-tertiary); }
.notifications-item i { font-size: 18px; color: var(--text-secondary); margin-top: 2px; }
.notifications-text { min-width: 0; }
.notifications-title { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notifications-body { color: var(--text-secondary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notifications-time { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--text-secondary);
  gap: 6px;
}
.notifications-empty i { font-size: 22px; color: var(--stone-gray); }
.notifications-footer { padding: 8px 12px; border-top: 1px solid var(--border-light); background: var(--bg-primary); }
.notifications-manage { text-decoration: none; color: var(--text-secondary); font-size: 13px; }
.notifications-manage:hover { color: var(--text-primary); }

.nav-icon {
  font-size: var(--font-size-lg);
}

.nav-text {
  display: none;
}

@media (min-width: 768px) {
  .nav-text {
    display: inline;
  }
}



/* Main Content */
.main-content {
  grid-area: main-content;
  background: var(--bg-secondary);
  padding: var(--space-2xl) var(--space-4xl);
  overflow-y: auto;
  min-height: calc(100vh - var(--header-height));

  justify-content: center;
}

@media (min-width: 1024px) {
  .main-content {
    padding: 25px 0 25px 0;
  }
}

/* Disable inner scroll on adventure detail view */
.main-content.adventure-detail {
  overflow-y: visible;
}

/* Right Sidebar */
.right-sidebar {
  grid-area: right-sidebar;
  padding: 25px 0 0 25px;
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
}

/* Footer */
.footer {
  grid-area: footer;
}

/* ========== HEADER ELEMENTS ========== */
.app-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.app-logo-icon {
  font-size: 28px;
  color: var(--forest-green);
  background: var(--bg-secondary);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.app-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--forest-green);
  margin: 0;
  letter-spacing: -0.025em;
}

.app-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  font-weight: var(--font-weight-medium);
}

/* ========== ACTIVITY FEED ========== */
.adventure-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin: 0 auto;
}

.adventure-card {
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-normal);
  border: 1px solid var(--border-light);
}

.adventure-card:hover {
  background: var(--bg-secondary);
  box-shadow: var(--shadow-offset);
}

/* Activity Header */
.adventure-header {
  display: flex;
  align-items: flex-start;
  padding: var(--space-lg);
  gap: var(--space-md);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  border: 2px solid var(--border-light);
  transition: var(--transition-fast);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.user-profile-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-light);
}

.avatar-fallback i {
  font-size: 20px;
  color: var(--sage-green);
}

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

.user-info h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
  line-height: 1.3;
}

.user-level {
  background: var(--sage-green);
  color: var(--text-white);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 12px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  display: inline-block;
}

.adventure-date {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: var(--space-xs) 0 0 0;
}

/* Activity Photo */
.adventure-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-tertiary);
  display: block;
}

.adventure-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-normal);
}

/* Photo overlay */
.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
  color: var(--text-white);
}

.photo-location {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.photo-weather {
  font-size: var(--font-size-base);
  opacity: 0.9;
}

/* Activity Actions */
.adventure-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
}

.action-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: var(--radius-md);
}

.action-button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.action-button.active {
  color: var(--forest-green);
  background: rgba(138, 166, 142, 0.1);
}

/* Activity Notes */
.adventure-notes {
  padding: 0 var(--space-lg) var(--space-lg);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  font-size: medium;
}

.adventure-notes p {
  margin: 0;
  color: var(--text-primary);
}



/* ========== PROFILE COMPONENTS ========== */
.profile-mini {
  padding: calc(var(--space-xl) + 120px) var(--space-xl) var(--space-xl);
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  position: relative;
  border: 1px solid var(--border-light);
}

.profile-mini:hover {
  box-shadow: var(--shadow-offset);
  background: var(--bg-secondary);
}

.profile-mini::before { display: none; }

.profile-cover-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  z-index: 1;
}

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

.cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.cover-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cover-content .avatar-wrapper {
  margin-bottom: var(--space-xl);
}

.cover-content .profile-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  text-align: center;
  margin: 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.profile-cover-background.no-cover {
  background: linear-gradient(135deg, var(--success-green), var(--forest-green));
}

/* Custom Profile Page Cover Styles (Full Size) */
.profile-page-cover-background {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.profile-page-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.profile-page-cover-image:hover {
  transform: scale(1.02);
}

.profile-page-cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 2;
}

.profile-page-cover-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
  color: white;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);
  padding: 2rem;
}

.profile-page-avatar-container {
  margin-bottom: 1.5rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-page-avatar {
  width: 140px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-page-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.profile-page-avatar-icon {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.profile-page-avatar-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.profile-page-level-badge {
  position: absolute;
  bottom: -10px;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.profile-page-cover-content .profile-name {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
  color: white;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
}

.profile-page-cover-content {
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  margin: 0.5rem 0 0 0;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.profile-page-cover-background.no-cover {
  background: linear-gradient(135deg, #1a4d3a, #2d6a4f, #40916c);
  position: relative;
}

.profile-page-cover-background.no-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="30" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding-top: 25px;
}

.profile-avatar-section {
  position: absolute;
  /* Center the combined avatar+badge cluster within 120px cover area */
  top: calc((120px - (var(--profile-avatar-size) + var(--badge-height) - var(--badge-offset))) / 2);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.profile-name-section .profile-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.profile-name-section {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
  text-transform: capitalize;
}

/* Level badge pill; gradient background injected inline from PHP */
.level-badge {
  display: inline-block;
  padding: 4px 10px;
  color: #FFFFFF;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.2px;
  box-shadow: none;
  border: none;
}

/* Level badge positioned at bottom center of avatar */
.avatar-wrapper {
  position: relative;
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
}

.avatar-level {
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--badge-offset));
  transform: translateX(-50%);
  white-space: nowrap;
}

.last-adventure-display {
  text-align: center;
}

.last-adventure-display .stat-number {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* Make last adventure clickable and add hover background */
.last-adventure-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  border-radius: 999px;
}

.last-adventure-link:hover .stat-number {
  background: var(--bg-secondary);
}

.last-adventure-icon { color: var(--text-secondary); }

.last-adventure-display .stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-avatar {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  border-radius: 50%;
  object-fit: cover;
  border: none;
  margin: 0 auto;
  display: block;
  transition: var(--transition-fast);
  box-shadow: none;
}

.profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  border-radius: 50%;
  margin: 0 auto;
  border: none;
}

.profile-icon i {
  font-size: 48px;
  color: var(--forest-green);
}

.profile-avatar:hover { transform: none; }

.profile-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.3;
}

.profile-stats {
  display: flex;
  text-align: center;
}

.profile-stats li {
  width: 33.333%;
  justify-content: center;
  position: relative;
  display: flex;
  border-right: 1px solid var(--border-light);
  margin: 0 !important;
  padding-left: 1rem;
  padding-right: 1rem;
}

.profile-stats li:first-child {
  padding-left: 0;
}

.profile-stats li:last-child {
  border-right: none;
  padding-right: 0;
}

.recent-adventures {
  margin-top: var(--space-2xl);
}

.recent-adventures .recent-header h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.recent-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  position: relative;
}

.recent-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-placeholder i {
  font-size: 22px;
  color: var(--stone-gray);
}

.recent-time {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
}



.stat-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
}

.stat-link:hover {
  text-decoration: none;
}

.stat-container {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 15px;
  transition: var(--transition-fast);
}

.stat-container:hover {
  background: var(--bg-primary);
}

.stat-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--primary-text);
  font-weight: 300;
}

.stat-number {
  font-size: 20px;
  line-height: 25px;
  white-space: nowrap;
  color: var(--text-primary);
}

/* ========== LEADERBOARD COMPONENTS ========== */
.top-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.top-card {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  border: 1px solid var(--border-light);
}

.top-card:hover {
  box-shadow: var(--shadow-offset);
  background: var(--bg-secondary);
}

.top-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  line-height: 1.3;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.top-item {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: var(--transition-fast);
  border: 1px solid var(--border-light);
}

.top-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  transform: translateX(2px);
}

/* ========== POPULAR ADVENTURES COMPONENTS ========== */
.popular-item {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: var(--transition-fast);
  border: 1px solid var(--border-light);
  margin-bottom: var(--space-xs);
}

.popular-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.popular-location {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
  margin: 0;
}

.no-data {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-style: italic;
}

.top-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  background: var(--stone-gray);
  color: var(--text-white);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.top-rank.gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: var(--text-primary);
}

.top-rank.silver {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: var(--text-primary);
}

.top-rank.bronze {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: var(--text-white);
}

.top-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  position: relative;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.top-user-avatar:hover {
  border-color: var(--sage-green);
  transform: scale(1.05);
}

/* Top user avatar fallback */
.top-user-avatar + .avatar-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-forest), var(--accent-forest1));
  color: white;
  border-radius: 50%;
  font-weight: var(--font-weight-bold);
  font-size: 11px;
  text-transform: uppercase;
  border: 1px solid var(--accent-forest2);
}

.top-user-info h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.top-user-score {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
}

/* ========== BUTTON COMPONENTS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--forest-green);
  color: var(--text-white);
  border: 2px solid var(--forest-green);
}

.btn-primary:hover {
  background: var(--deep-green);
  border-color: var(--deep-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ========== LOGIN COMPONENTS ========== */
.login-section {
  text-align: center;
  padding: var(--space-3xl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.login-button {
  background: var(--forest-green);
  color: var(--text-white);
  border: 2px solid var(--forest-green);
  padding: var(--space-lg) var(--space-3xl);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.login-button:hover {
  background: var(--deep-green);
  border-color: var(--deep-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ========== LOAD MORE BUTTON ========== */
.load-more-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-medium);
  padding: var(--space-lg) var(--space-2xl);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  margin: var(--space-xl) auto;
  display: block;
}

.load-more-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.load-more-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ========== STATES ========== */
.loading-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

.empty-state {
  text-align: center;
  padding: var(--space-4xl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin: var(--space-xl) 0;
}

.empty-icon {
  font-size: var(--font-size-4xl);
  color: var(--sage-green);
  margin-bottom: var(--space-xl);
  display: block;
}

.empty-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.3;
}

.empty-message {
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
  font-size: var(--font-size-lg);
}

/* Left Sidebar */
.left-sidebar {
  grid-area: left-sidebar;
  padding: 25px 25px 0 0;
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
}



/* Navigation Button Styling */
.nav-button {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1rem;
  margin: 1rem 0  1rem 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-button:hover {
  box-shadow: var(--shadow-offset); 
  background: var(--bg-secondary);
}

/* Explore Button Styling */
.explore-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--success-green);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-fast);
}

.explore-button:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

/* Stat Item Styling */
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.stat-item span:first-child {
  font-size: 0.95rem;
  color: var(--secondary-text);
}

.stat-item span:last-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-text);
}

/* Activity Stats Container */

.activity-stats h4 {
  font-size: 0.9rem;
  color: var(--secondary-text);
  margin-bottom: 0.5rem;
}

/* Compact Stat Item */
.stat-item-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.stat-item-compact span:first-child {
  font-size: 0.9rem;
  color: var(--secondary-text);
}

.stat-item-compact span:last-child {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-text);
}

/* No Photos Empty State */
.no-photos {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--secondary-text);
}

.no-photos .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.no-photos .empty-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-text);
}

.no-photos .empty-subtitle {
  font-size: 0.9rem;
  opacity: 0.7;
}

.no-photos .empty-actions {
  margin-top: 2rem;
}

/* Adventures Page Gallery Styling */
.photos-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Visual cue when scrolled to deep-linked item */
.highlight-target {
  outline: 2px solid var(--forest-green);
  outline-offset: 2px;
}

.gallery-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Anchor wrapping gallery content */
.gallery-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 1rem;
  color: white;
}

.gallery-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-meta {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

.stats-header {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  border: 1px solid var(--border-light);
}

.stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 0.5rem;
}

.stats-label {
  font-size: 0.9rem;
  color: var(--secondary-text);
}

/* Responsive design for gallery */
@media (max-width: 768px) {
  .photos-gallery {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .gallery-image {
    height: 180px;
  }
}

/* More Button Styling */
.more-button {
  transition: all 0.2s ease;
}

.more-button:hover {
  background: var(--primary-color-hover, #2563eb) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.more-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* ========== MAIN CONTENT & FEED ========== */

.adventure-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  flex: 1;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: var(--space-2xl);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
  font-weight: var(--font-weight-medium);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
}

.footer-links a:hover {
  color: var(--forest-green);
  background: var(--bg-secondary);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 280px;
  }

  .adventure-feed {
    max-width: 500px;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }

  .adventure-feed {
    max-width: 480px;
  }
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr auto;
    gap: 0;
  }

  .left-sidebar, .right-sidebar {
    display: none;
  }

  /* Show left sidebar on larger mobile screens in landscape */
  @media (max-width: 768px) and (orientation: landscape) {
    .left-sidebar {
      display: block;
      padding: 15px 15px 0 0;
    }

    .app-container {
      grid-template-columns: 280px 1fr;
    }
  }
}

/* Show sidebars on tablets and larger screens */
@media (min-width: 769px) {
  .left-sidebar, .right-sidebar {
    display: block;
  }

  .main-content {
    padding: 25px 0 25px 0;
  }

  .header-content {
    padding: var(--space-lg) var(--space-xl);
  }

  .header-nav {
    margin-left: var(--space-md);
    gap: var(--space-md);
  }

  .nav-text {
    display: none;
  }

  .adventure-feed {
    max-width: none;
    gap: var(--space-lg);
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .app-container {
    margin: 0;
  }

  .main-content {
    padding: var(--space-lg);
  }

  .header-content {
    padding: var(--space-md) var(--space-lg);
  }

  .header-nav {
    margin-left: var(--space-sm);
    gap: var(--space-sm);
  }

  .adventure-actions {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .profile-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .top-item {
    padding: var(--space-md);
  }

  .login-section {
    padding: var(--space-2xl);
  }
}

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.hidden { display: none; }
.flex { display: flex; }
.flex-column { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ========== ACCESSIBILITY & POLISH ========== */

/* Selection styling */
::selection {
  background: rgba(138, 166, 142, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(138, 166, 142, 0.3);
  color: var(--text-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--stone-gray);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--earth-brown);
}

/* Smooth animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply animations */
.adventure-card {
  animation: fadeInUp 0.5s ease-out;
}

.top-item {
  animation: slideInFromLeft 0.4s ease-out;
}

/* Loading spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-light);
  border-top: 2px solid var(--forest-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* ========== GLOBAL UI SCALE ========== */
/* Reduce overall UI size to 75% */
:root {
  --ui-scale: 0.75;
}

/* Primary (WebKit/Blink) */
body {
  zoom: var(--ui-scale);
}

/* Fallback for browsers without zoom support */
@supports not (zoom: 1) {
  body {
    transform: scale(var(--ui-scale));
    transform-origin: top left;
    width: calc(100% / var(--ui-scale));
  }
}

/* Per-page override: force 100% scale */
.ui-scale-100 {
  zoom: 1 !important;
}

@supports not (zoom: 1) {
  .ui-scale-100 {
    transform: scale(1) !important;
    transform-origin: top left !important;
    width: 100% !important;
  }
}

/* Custom Profile Page Stats Card */
.profile-page-stats-card {
  margin-bottom: 2rem;
}

/* ========== PROFILE PAGE STYLES ========== */

/* Adventure Statistics Graph Styles - Matching Admin Page */
.adventure-stats-graph-section {
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    height: 100%;
}

.chart-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.chart-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.left-controls, .right-controls { display: flex; align-items: center; }
.chart-legend { display: flex; align-items: center; justify-content: center; gap: 1rem; flex: 1; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--secondary-text, #6b7280);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.primary { background: #4169E1; }
.legend-dot.success { background: #228B22; }
.legend-dot.warning { background: #FF7F50; }
.legend-dot.peak { background: var(--peak-color); }
.legend-dot.height { background: var(--height-color); }

/* Strava-style Activity Graph */
#interval-graph {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.text-callout {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.left {
    float: left;
}

.right {
    float: right;
}

.clear {
    clear: both;
}

.drop-down-menu {
    position: relative;
    display: inline-block;
    border: 1px solid var(--border-light);
    border-radius: 15px;
}

.drop-down-menu .selection {
    background: var(--secondary-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    min-width: 200px;
    text-align: center;
}

.drop-down-menu .options {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--drop-down-menu-options-bg);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    margin-top: 1px;
    display: none;
}

.drop-down-menu.enabled .selection:hover + .options,
.drop-down-menu.enabled .options:hover {
    display: block;
}

.drop-down-menu .options li {
    display: flex;
    justify-content: center;
    border-radius: 15px;
}

.drop-down-menu .options li:last-child {
    border-bottom: none;
}

.drop-down-menu .options li:hover {
    background: var(--drop-down-menu-bg);
}

.drop-down-menu .options a {
    display: block;
    padding: 0.75rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    text-align: center;
    transition: background-color 0.2s;
}

.drop-down-menu .options a:hover {
    background: var(--secondary-light);
}

.unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.athlete-graph {
    position: relative;
    margin: 1rem 0;
}

.y-axis {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.y-axis .label {
    position: absolute;
    right: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transform: translateY(50%);
}

.intervals {
    position: absolute;
    left: 40px;
    right: 0;
    top: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    height: 113px;
}

.interval {
    position: absolute;
    bottom: 0;
    height: 100%;
}

.interval .bar {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.interval .bar a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.interval .fill {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transition: all 0.2s ease;
    min-height: 2px;
}

.interval:hover .fill {
    width: 8px;
    background: var(--primary);
    opacity: 0.8;
}

.interval.selected .fill {
    background: var(--success);
    width: 8px;
}

/* Line chart styling */
.line-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.line-point:hover {
    width: 8px;
    height: 8px;
    background: var(--primary);
}

.interval.selected .line-point {
    background: var(--success);
    width: 8px;
    height: 8px;
}

/* Connect line points for line chart */
.intervals.line-mode::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 113px;
    background: linear-gradient(to right,
        transparent 0%,
        var(--primary) 10%,
        var(--primary) 90%,
        transparent 100%);
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.x-axis {
    position: relative;
    height: 20px;
    margin-top: 10px;
    margin-left: 40px;
    margin-bottom: 5px;
}

.x-axis .tick {
    position: absolute;
    bottom: 0;
    width: 1px;
    height: 5px;
    background: var(--border);
}

.x-axis .label {
    position: absolute;
    bottom: 0;
    transform: translate(-50%, 100%);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    z-index: 10;
}

.x-axis {
    position: relative;
    height: 30px;
    margin-top: 10px;
    margin-left: 40px;
    margin-bottom: 10px;
}

#interval-graph-controls {
    margin-top: 1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

#interval-graph-controls ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

#interval-graph-controls li {
    display: flex;
}

.switches {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 15px;
}

.switches.small li {
    border-right: 1px solid var(--border-light);
    display: flex;
}

.switches.small li.last-child {
    border-right: none;
}

.switches.small li a {
    min-width: 60px;
    text-align: center;
}



.button {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--secondary-light);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.button:hover,
.button.selected {
    background: var(--button-selected-bg);
    color: white;

}

.btn-xs {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Responsive adjustments for Strava chart */
@media (max-width: 768px) {
    #interval-graph {
        padding: 1rem;
    }

    .text-callout {
        font-size: 1rem;
    }

    .drop-down-menu .selection {
        min-width: 150px;
    }

    .athlete-graph {
        height: 100px;
    }

    .intervals {
        height: 93px;
    }

    .y-axis .label {
        font-size: 0.7rem;
    }

    .x-axis .label {
        font-size: 0.7rem;
    }

    #interval-graph-controls ul {
        flex-direction: column;
        gap: 0.75rem;
    }

    #interval-graph-controls li {
        margin-bottom: 0.5rem;
    }

    .switches.small {
        flex-wrap: wrap;
    }

    .switches.small li {
        margin-bottom: 0.25rem;
    }
}