/* =============================================
   GoBebop Auth & Saved Locations Styles
   ============================================= */

/* ---- Saved Button (Desktop Header) ---- */
#saved-btn {
  width: auto;
  min-width: 48px;
  height: 48px;
  border-radius: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  transition: all 0.2s ease;
  color: #333;
}

#saved-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#saved-btn .nav-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  #saved-btn:hover {
    background: rgba(0, 0, 0, 0.05);
  }
}

/* ---- Account Button (Desktop Header) ---- */
#account-btn {
  width: auto;
  min-width: 48px;
  height: 48px;
  border-radius: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  transition: all 0.2s ease;
  color: #333;
}

#account-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#account-btn .nav-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  #account-btn:hover {
    background: rgba(0, 0, 0, 0.05);
  }
}

/* Account avatar in header */
.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #4daabb;
}

.account-avatar-mobile {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #4daabb;
}

.account-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4daabb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
}

/* ---- Account Dropdown ---- */
#account-dropdown {
  position: fixed;
  top: 70px;
  right: 16px;
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 3000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

#account-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#account-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2999;
  display: none;
}

#account-backdrop.active {
  display: block;
}

.account-dropdown-header {
  padding: 16px;
}

.account-dropdown-name {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: #333;
  font-family: 'Quicksand', sans-serif;
}

.account-dropdown-email {
  display: block;
  font-size: 13px;
  color: #888;
  margin-top: 2px;
  word-break: break-all;
}

.account-dropdown-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 0;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  font-family: 'Quicksand', sans-serif;
  transition: background 0.15s ease;
  text-align: left;
}

.account-dropdown-item:hover {
  background: #f5f5f5;
}

.account-dropdown-item:active {
  background: #eee;
}

.account-dropdown-item svg {
  flex-shrink: 0;
  color: #666;
}

.account-dropdown-item.sign-in-btn {
  padding: 14px 16px;
}

.saved-count-badge {
  margin-left: auto;
  background: #4daabb;
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ---- Save/Bookmark Button on Location Sheets ---- */
.save-location-btn {
  background: rgba(240, 240, 240, 0.9);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.save-location-btn svg {
  stroke: #666;
  transition: all 0.2s ease;
}

.save-location-btn.saved svg {
  fill: #e74c3c;
  stroke: #e74c3c;
}

.save-location-btn:active {
  transform: scale(0.9);
}

@media (hover: hover) and (pointer: fine) {
  .save-location-btn:hover {
    background: rgba(224, 224, 224, 0.95);
    transform: scale(1.1);
  }
  
  .save-location-btn:hover svg {
    stroke: #e74c3c;
  }
}

/* Desktop sheet: position save button next to share */
.sheet-save {
  position: absolute;
  top: 16px;
  right: 104px; /* share is at 60px, close is at 16px */
  z-index: 10;
}

/* Save button animation */
@keyframes save-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.save-location-btn.just-saved {
  animation: save-pop 0.3s ease;
}

/* ---- Saved Locations List View ---- */
#saved-list-view {
  position: fixed;
  top: 70px;
  right: 0;
  width: 440px;
  max-width: 100%;
  height: calc(100% - 70px);
  background: white;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  transform: translateX(100%);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

#saved-list-view.active {
  transform: translateX(0);
}

#saved-list-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#saved-list-backdrop.active {
  display: block;
  opacity: 1;
}

.saved-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  background: white;
}

.saved-list-header h3 {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  color: #333;
}

.saved-list-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#saved-list-count {
  font-size: 13px;
  color: #888;
  font-weight: 600;
}

.saved-list-close {
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.saved-list-close:hover {
  background: #e0e0e0;
}

#saved-list-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  background: #f8f9fa;
}

/* Saved list items - reuse existing .list-item styles */
.saved-list-item {
  cursor: pointer;
}

.saved-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: #999;
}

.saved-remove-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #e74c3c;
}

.saved-remove-btn:hover svg {
  stroke: #e74c3c;
}

.saved-remove-btn:active {
  transform: scale(0.9);
}

/* Empty state */
.saved-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
}

.saved-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin: 16px 0 4px;
  font-family: 'Quicksand', sans-serif;
}

.saved-empty-subtitle {
  font-size: 14px;
  color: #888;
  margin: 0 0 20px;
  line-height: 1.5;
}

.saved-sign-in-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.saved-sign-in-btn:hover {
  background: #f8f8f8;
  border-color: #ccc;
}

.saved-sign-in-btn:active {
  background: #f0f0f0;
  transform: scale(0.98);
}

/* ---- Sign-In Prompt Modal ---- */
.signin-prompt-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 320px;
  max-width: calc(100% - 40px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 4001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.signin-prompt-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.signin-prompt-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 4000;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.signin-prompt-backdrop.active {
  display: block;
  opacity: 1;
}

.signin-prompt-content {
  padding: 28px 24px;
  text-align: center;
  position: relative;
}

.signin-prompt-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.signin-prompt-close svg {
  width: 14px;
  height: 14px;
}

.signin-prompt-content h3 {
  margin: 14px 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  font-family: 'Quicksand', sans-serif;
}

.signin-prompt-content p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #888;
  line-height: 1.4;
}

.signin-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.signin-prompt-btn:hover {
  background: #f8f8f8;
  border-color: #ccc;
}

.signin-prompt-btn:active {
  background: #f0f0f0;
  transform: scale(0.98);
}

/* ---- Mobile Overrides ---- */
@media (max-width: 600px) {
  /* Hide desktop account and saved buttons on mobile */
  #account-btn,
  #saved-btn {
    display: none;
  }
  
  /* Account dropdown on mobile: full-width bottom sheet style */
  #account-dropdown {
    top: auto;
    bottom: 70px; /* above mobile nav */
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  
  #account-dropdown.active {
    transform: translateY(0);
  }
  
  /* Saved list: full screen on mobile like other drawers */
  #saved-list-view {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100% - 60px);
    max-height: 90vh;
    max-height: 90dvh;
    transform: translateY(100%);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }
  
  #saved-list-view.active {
    transform: translateY(0);
  }
}