/* ===================================
   HEADER AUTH CONTROLS - Inline in Header
   ================================== */

.header-auth-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-right: auto;
  padding-right: 0.75rem;
  white-space: nowrap;
}

.auth-actions-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  width: 100%;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 5px;
  font-weight: 500;
  white-space: nowrap;
  width: 100%;
  text-align: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}

.btn-sm:hover {
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.btn-sm.btn-danger {
  background: #dc2626;
  color: white;
  border: 1px solid #b91c1c;
}

.btn-sm.btn-danger:hover {
  background: #b91c1c;
  border-color: #991b1b;
}

/* Hide spinner by default, show only when loading */
.auth-spinner-inline {
  display: none;
  font-size: 0.75rem;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

.auth-spinner-inline:not([hidden]) {
  display: block;
}

.notifications-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.notifications-toggle:hover {
  background: #f3f4f6;
}

.notifications-counter {
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
  line-height: 1;
}

/* Mobile - ultra compact */
@media (max-width: 768px) {
  .header-auth-controls {
    gap: 0.2rem;
    padding-right: 0.25rem;
  }
  
  .auth-actions-inline {
    gap: 0.2rem;
  }
  
  .notifications-toggle .btn-text {
    display: none;
  }
  
  .notifications-toggle {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }
  
  .btn-sm {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }
  
  .notifications-counter {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
    min-width: 14px;
  }
}

/* ===================================
   HEADER LAYOUT
   ================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-top-actions::-webkit-scrollbar {
  display: none;
}

/* Jump to objective container - below nav */
.jump-to-objective-container {
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.jump-to-objective-container #jumpToObjective {
  padding: 0.625rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.jump-to-objective-container #jumpToObjective:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* ===================================
   USER STATS SECTION - Combined Profile + Metrics
   ================================== */

.user-stats-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  padding: 0.75rem;
  background: #ffffff;
}

/* Profile Card - Compact */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-radius: 12px;
  color: white;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
}

.user-profile-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
  flex-shrink: 0;
}

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

.profile-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
  color: white;
  line-height: 1.2;
}

.profile-status {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
}

/* Stats Cards Grid - Compact */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
}

.metric-card {
  padding: 0.625rem 0.75rem;
  min-height: auto;
  transition: all 0.2s ease;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.metric-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

.metric-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  color: #6b7280;
  display: block;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  line-height: 1.1;
  color: #2563eb;
  display: block;
}

.metric-subtext {
  font-size: 0.625rem;
  line-height: 1.2;
  margin-top: 0.2rem;
  color: #9ca3af;
  display: block;
}

/* Progress Bar Styles */
.metric-progress {
  margin-top: 0.375rem;
}

.metric-progress-track {
  height: 5px;
  background: #e5e7eb;
  border-radius: 2.5px;
  overflow: hidden;
  position: relative;
}

.metric-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
  transition: width 0.5s ease;
  border-radius: 2.5px;
  position: absolute;
  top: 0;
  left: 0;
}

.metric-progress-fill.is-width-zero {
  width: 0%;
  opacity: 0;
}

.metric-progress-text {
  font-size: 0.625rem;
  margin-top: 0.3rem;
  color: #6b7280;
  display: block;
  line-height: 1.2;
}

/* ===================================
   MOBILE OPTIMIZATION
   ================================== */

@media (max-width: 768px) {
  .user-stats-section {
    grid-template-columns: 1fr;
    padding: 0.6rem;
    gap: 0.45rem;
  }
  
  .user-profile-card {
    padding: 0.625rem;
    gap: 0.5rem;
  }
  
  .profile-avatar {
    width: 45px;
    height: 45px;
  }
  
  .profile-name {
    font-size: 0.875rem;
  }
  
  .profile-status {
    font-size: 0.65rem;
  }
  
  .stats-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .metric-card {
    padding: 0.5rem;
  }
  
  .metric-label {
    font-size: 0.6rem;
  }
  
  .metric-value {
    font-size: 1.25rem;
  }
  
  .metric-subtext {
    font-size: 0.55rem;
  }
  
  .metric-progress-text {
    font-size: 0.55rem;
  }
}

/* Extra small screens - ultra compact */
@media (max-width: 480px) {
  .user-stats-section {
    padding: 0.5rem;
  }
  
  .user-profile-card {
    padding: 0.5rem;
  }
  
  .profile-avatar {
    width: 40px;
    height: 40px;
  }
  
  .profile-name {
    font-size: 0.8rem;
  }
  
  .profile-status {
    font-size: 0.6rem;
  }
  
  .metric-card {
    padding: 0.45rem 0.5rem;
  }
  
  .metric-value {
    font-size: 1.1rem;
  }
}

/* Tablet - 2 columns for stats */
@media (min-width: 769px) and (max-width: 1024px) {
  .user-stats-section {
    grid-template-columns: 1fr;
  }
  
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop - keep 3 columns */
@media (min-width: 1025px) {
  .user-stats-section {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  }

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

/* ==============================
   DESKTOP HEADER REFINEMENTS
   Compact, centered global panel
   ============================== */
@media (min-width: 1024px) {
  .app-header {
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.85) 0%, rgba(241, 245, 249, 0.96) 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
    padding: 0.6rem 0 0.75rem;
  }

  .app-header > .header-top,
  .app-header > .user-stats-section,
  .app-header > .header-tabs {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
  }

  .header-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem 0.25rem;
  }

  .header-top .brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
  }

  .header-top .brand-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .header-top-actions {
    flex: 0 0 auto;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 0.25rem 0.1rem;
  }

  .header-actions-primary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .app-header .header-actions-primary .header-link {
    padding: 0.4rem 0.8rem;
    min-height: 36px;
    border-radius: 999px;
    font-size: 0.9rem;
  }

  .header-tabs {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.4rem 1.25rem 0.7rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
  }

  .app-header .header-tab {
    min-width: 0;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.9rem;
  }

  .app-header .brand img {
    width: 64px;
    height: 64px;
  }

  .app-header .brand-title .brand-name {
    font-size: 1.35rem;
  }

  .app-header .tagline {
    font-size: 0.95rem;
    max-width: 40ch;
  }

  .app-header > .user-stats-section {
    margin-top: 0.35rem;
    padding: 0.6rem 0.85rem;
    border-radius: 18px;
  }

  .app-header .brand .user-stats-section {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  }

  .user-profile-card {
    padding: 0.65rem;
    gap: 0.55rem;
  }

  .profile-avatar {
    width: 46px;
    height: 46px;
  }

  .stats-cards {
    gap: 0.5rem;
  }

  .metric-card {
    padding: 0.5rem 0.7rem;
  }

  .metric-value {
    font-size: 1.35rem;
  }
}

/* ==============================
   GLOBAL HEADER EMOJI ICONS
   Added via CSS to keep i18n intact
   ============================== */
.auth-actions-inline [data-auth="login"]::before {
  content: "🔐 ";
}

.auth-actions-inline [data-auth="guest"]::before {
  content: "🎮 ";
}

.auth-actions-inline [data-auth="logout"]::before {
  content: "🚪 ";
}

#tripsHomeSection .btn.btn-primary.primary::before {
  content: "🧭 ";
}

#hotelsHomeSection .btn.btn-primary.primary::before {
  content: "🏨 ";
}

.user-stats-section .metric-card .metric-label::before {
  content: "✨ ";
}
