/* ============================================================================
   HEADER - Leather Trunk Style
   ============================================================================ */

#main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--leather-dark);
  background-image: url("../../images/atlas-leather.jpg");
  background-size: cover;
  background-position: center;
  color: var(--paper-cream);
  box-shadow:
    0 4px 12px rgba(45, 36, 22, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

/* Top stitching decoration */
#main-header::before {
  content: '';
  display: block;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 10px,
    var(--brass) 10px,
    var(--brass) 20px
  );
  opacity: 0.6;
}

/* Header Rows */
.header-row {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* Row 1: Logo + Auth (left-aligned) */
.header-row-primary {
  justify-content: flex-start;
  padding: 12px 16px;
}

/* Row 2: Core Actions (centered) */
.header-row-actions {
  justify-content: center;
  padding: 0 16px 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-button {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--brass-shine) 0%, var(--brass) 50%, var(--brass-light) 100%);
  border: 2px solid var(--brass-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
}

.logo-button svg {
  stroke: var(--leather-dark);
}

.logo-button:hover {
  transform: scale(1.08);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.2);
}

.icon-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Core Action Buttons: Discover • Log • Share - Brass Tag Style */
.header-actions-core {
  display: flex;
  gap: 10px;
}

.btn-core {
  padding: 10px 22px;
  background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 50%, var(--brass-light) 100%);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--leather-dark);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.15),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-core:hover {
  background: linear-gradient(180deg, var(--brass-shine) 0%, var(--brass-light) 50%, var(--brass-shine) 100%);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.15),
    0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-core:focus-visible {
  outline: 2px solid var(--brass-shine);
  outline-offset: 2px;
}

/* Button icon/text setup - icons hidden by default on larger screens */
.btn-core {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon {
  display: none;
  font-size: 16px;
  line-height: 1;
}

.btn-text {
  /* Text shown by default */
}

.btn-secondary,
#login-btn {
  background: linear-gradient(180deg, var(--leather-light) 0%, var(--leather-mid) 100%);
  color: var(--paper-cream);
  border: 2px solid var(--brass);
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-secondary:hover,
#login-btn:hover {
  background: linear-gradient(180deg, var(--leather-mid) 0%, var(--leather-dark) 100%);
  border-color: var(--brass-light);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

/* Help button (shown when logged out) */
.help-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper-aged);
  border: 2px solid var(--brass);
  color: var(--leather-dark);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-button:hover {
  background: var(--brass);
  color: var(--leather-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-menu-button {
  position: relative;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: white;
  transition: transform 0.2s;
  background-size: cover;
  background-position: center;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  min-width: 200px;
  overflow: hidden;
  z-index: 1001;
}

.user-menu-dropdown.active {
  display: block;
}

.user-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.user-menu-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-menu-email {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* .user-menu-signout styles moved to .user-menu-item section below */

/* Mobile Header Adjustments */
@media (max-width: 480px) {
  .header-row-primary {
    padding: 10px 12px;
  }
  
  .header-row-actions {
    padding: 0 12px 10px;
  }
  
  .header-left {
    gap: 8px;
  }
  
.logo-button {
  width: 36px;
  height: 36px;
}

.logo-button svg {
  width: 20px;
  height: 20px;
}
  
  .btn-core {
    padding: 6px 14px;
    font-size: 13px;
  }
  
  #login-btn,
  .btn-secondary {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

#main-content {
  min-height: calc(100vh - 64px);
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: hidden; /* V1 pattern: Prevent horizontal scroll on mobile */
}

#yoink-app {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Extra containment layer to prevent profile content overflow */
}

/* Mobile: reduce padding */
@media (max-width: 480px) {
  #main-content {
    padding: 8px;
  }
  .user-panel-container {
    max-width: calc(100vw - 16px); /* viewport minus reduced #main-content padding */
    padding: 8px;
  }
}

#main-content:focus {
  outline: none;
}

/* ============================================================================
   CONTEXT PANELS - Show/Hide Logic
   ============================================================================ */

.context-panel {
  display: none;
  overflow: hidden; /* V1 pattern: Prevent rotated cards from causing horizontal scroll */
}

.context-panel.active {
  display: block;
}

/* ============================================================================
   PANEL HEADER (shared styles for Category, User, Location panels)
   ============================================================================ */

.panel-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

