/**
 * Forayz Standalone Page Styles
 *
 * Standalone-specific UI elements for /forayz/ page
 * Includes: loading indicators, user menu, profile dropdown, notifications
 *
 * Last updated: 2026-02-12
 */

/* ============================
   Loading & Error Indicators
   ============================ */

/* Loading indicator */
#loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px 40px;
  border-radius: 8px;
  font-size: 18px;
  z-index: 9999;
  display: none;
}

#loading-indicator.active {
  display: block;
}

/* Error display */
#error-display {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336;
  color: white;
  padding: 15px 30px;
  border-radius: 5px;
  z-index: 9999;
  display: none;
  max-width: 90%;
}

#error-display.active {
  display: block;
}

/* ============================
   User Menu (Authentication)
   ============================ */

/* Sign In link (logged-out state) */
#user-menu #login-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--sm-brand-navy);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

#user-menu #login-btn:hover {
  color: #1a4570;
  text-decoration: underline;
}

#user-menu #login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================
   Profile Menu (Logged-in State)
   ============================ */

/* Profile Menu Styles */
.profile-menu-wrapper {
  position: relative;
}

.profile-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--sm-brand-navy);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.profile-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile-initials {
  color: white;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.pro-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #ffd700;
  color: #333;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.profile-dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  background: var(--surface-card, white);
  border-radius: 8px;
  box-shadow: var(--sh-card, 0 4px 20px rgba(0, 0, 0, 0.15));
  min-width: 250px;
  z-index: 1001;
  overflow: hidden;
}

.profile-dropdown-header {
  padding: 15px;
  background: var(--forest-800, #234b39);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-dropdown-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-dropdown-email {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.profile-dropdown-pro {
  font-size: 12px;
  background: #ffd700;
  color: #333;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.profile-dropdown-free {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.profile-dropdown-menu {
  padding: 8px 0;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary, #333);
  text-decoration: none;
  background: var(--surface-card, white);
  border: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-menu-item:hover {
  background: var(--surface-sunken, #f5f5f5);
}

.profile-menu-item i,
.profile-menu-item .svg-icon {
  width: 16px;
  text-align: center;
  color: var(--text-secondary, #666);
}

.profile-menu-upgrade {
  color: #ffd700;
  font-weight: 600;
}

.profile-menu-upgrade i,
.profile-menu-upgrade .svg-icon {
  color: #ffd700;
}

.profile-menu-logout {
  color: #f44336;
  border-top: 1px solid var(--divider, #eee);
}

.profile-menu-logout i,
.profile-menu-logout .svg-icon {
  color: #f44336;
}

/* ============================
   User Status Notifications
   ============================ */

/* User Status Notifications */
.user-status-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  min-width: 300px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.user-status-notification .notification-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.user-status-notification h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.user-status-notification p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.user-status-notification .notification-close {
  position: absolute;
  top: -5px;
  right: -10px;
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.user-status-notification .notification-close:hover {
  color: #333;
}

.user-status-success {
  border-left: 4px solid #4caf50;
}

.user-status-info {
  border-left: 4px solid #2196f3;
}

/* ============================
   Responsive Design
   ============================ */

@media only screen and (max-width: 768px) {
  #user-menu {
    position: static;
    gap: 6px;
  }
}

/* ============================
   Inline SVG Icons (replacing Font Awesome)
   ============================ */

/* Inline SVG icons (replacing Font Awesome) */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}
.svg-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* ============================
   Map Tour (Shepherd.js) — layer over the layer-control modal
   ============================
   The layer-control-modal-redesigned overlay is z-index 10000. Shepherd's
   defaults (tooltip 9999, overlay 9997) render the tour BEHIND the layer
   modal's semi-transparent backdrop. Bump our map-tour tooltip + overlay
   above 10000 so steps that attach inside the layer modal stay visible. */
.shepherd-element.foray-map-tour-step {
  z-index: 10003;
}
.shepherd-modal-overlay-container {
  z-index: 10001;
}

/* ============================
   Dropped-Pin Popup (long-press / empty-map click)
   Implements cross-platform spec at
   /Users/JJC/morel-maps/docs/data-contracts/LONG-PRESS-POPUP-SPEC.md
   ============================ */

.dropped-pin-marker {
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.dropped-pin-popup .maplibregl-popup-content {
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--divider, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  box-shadow: var(--sh-card, 0 4px 12px rgba(0, 0, 0, 0.15));
  padding: 10px 12px;
  font-family:
    'DM Sans',
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--text-primary, #1b3a2d);
}

.dropped-pin-popup .maplibregl-popup-tip {
  border-top-color: var(--surface-card, #ffffff);
}

.dropped-pin-popup .maplibregl-popup-close-button {
  font-size: 18px;
  padding: 2px 6px;
  color: var(--text-secondary, #5a6e63);
  right: 4px;
  top: 2px;
}

.dropped-pin-popup .dpp-elevation {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1b3a2d);
  margin-bottom: 2px;
  /* Reserve space for the close button */
  padding-right: 18px;
}

.dropped-pin-popup .dpp-coords {
  font-size: 12px;
  color: var(--text-secondary, #5a6e63);
  margin-bottom: 6px;
}

.dropped-pin-popup .dpp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  /* Fade in when content arrives */
  animation: dpp-fade-in 250ms ease-out;
}

.dropped-pin-popup .dpp-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-sunken, #f4efe8);
  color: var(--text-secondary, #5a6e63);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.dropped-pin-popup .dpp-chip-icon {
  font-size: 11px;
  line-height: 1;
}

.dropped-pin-popup .dpp-disclaimer {
  font-size: 10px;
  color: var(--text-tertiary, #8a9b92);
  margin-top: 2px;
  animation: dpp-fade-in 250ms ease-out;
}

.dropped-pin-popup .dpp-trees {
  font-size: 12px;
  color: var(--text-secondary, #5a6e63);
  margin-top: 6px;
  animation: dpp-fade-in 250ms ease-out;
}

@keyframes dpp-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
