/* ============================================================================
   FAB - Golden Stamp Style (matches homepage camera sticker)
   ============================================================================ */

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  background: linear-gradient(180deg, var(--brass-shine) 0%, var(--brass) 50%, var(--brass-light) 100%);
  color: var(--leather-dark);
  border: 3px solid var(--leather-dark);
  border-radius: 50%;
  box-shadow:
    0 4px 16px rgba(184, 134, 11, 0.5),
    inset 0 2px 4px rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 50;
  font-size: 28px;  /* For camera emoji */
}

/* Camera icon inside FAB */
.fab > span,
.fab > svg {
  position: relative;
  z-index: 3;
}

/* Decorative inner ring */
.fab::before {
  content: '';
  position: absolute;
  width: 52px;
  height: 52px;
  border: 2px solid var(--leather-dark);
  border-radius: 50%;
  opacity: 0.2;
  pointer-events: none;
  z-index: 1;
}

.fab::after {
  content: '';
  position: absolute;
  width: 42px;
  height: 42px;
  border: 1px solid var(--leather-mid);
  border-radius: 50%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

.fab:hover {
  background: linear-gradient(180deg, #FFE066 0%, var(--brass-shine) 50%, var(--brass) 100%);
  transform: scale(1.1);
  box-shadow:
    0 8px 28px rgba(184, 134, 11, 0.6),
    inset 0 2px 4px rgba(255,255,255,0.5),
    inset 0 -2px 4px rgba(0,0,0,0.1);
}

.fab:focus-visible {
  outline: 3px solid var(--leather-dark);
  outline-offset: 4px;
}

.fab:active {
  transform: scale(0.95);
}

/* FAB pulse animation - onboarding nudge to create first yoink */
.fab.fab-pulse {
  animation: fabPulseRing 2s ease-out infinite;
}

.fab.fab-pulse::after {
  /* Reuse the ::after pseudo-element for the pulse ring */
  content: '';
  position: absolute;
  width: 64px;
  height: 64px;
  border: 3px solid var(--brass);
  border-radius: 50%;
  opacity: 0;
  animation: fabPulseExpand 2s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes fabPulseRing {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(1.08); }
  20% { transform: scale(1); }
}

@keyframes fabPulseExpand {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* FAB tooltip - sits above the FAB */
.fab-tooltip {
  position: fixed;
  bottom: 100px;
  right: 16px;
  background: var(--leather-dark);
  color: var(--paper-cream);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 49;
  animation: fabTooltipIn 0.4s ease-out;
  pointer-events: none;
}

.fab-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: var(--leather-dark);
  transform: rotate(45deg);
  border-radius: 2px;
}

@keyframes fabTooltipIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Share button pulse – mirrors the FAB pulse pattern */
.share-btn-pulse {
  animation: shareBtnPulse 2s ease-out infinite;
  position: relative;
  z-index: 2; /* lift above siblings so the glow is visible */
}

@keyframes shareBtnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(184, 134, 11, 0.4); }
  15% { transform: scale(1.12); box-shadow: 0 0 12px 4px rgba(184, 134, 11, 0.5); }
  30% { transform: scale(1); box-shadow: 0 0 0 0 rgba(184, 134, 11, 0); }
}

/* Tooltip below the Share button */
.share-btn-tooltip {
  position: fixed;
  transform: translateX(-50%);
  background: var(--leather-dark);
  color: var(--paper-cream);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 200;
  pointer-events: none;
  animation: fabTooltipIn 0.4s ease-out;
}

.share-btn-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--leather-dark);
  border-radius: 2px;
}

/* ============================================================================
   MODALS - Vintage Travel Trunk Style
   ============================================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(61, 41, 20, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--paper-cream);
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 8px 32px rgba(45, 36, 22, 0.4),
    inset 0 0 0 2px var(--paper-dark);
  z-index: 1001;
  border: 3px solid var(--brass);
}

/* Decorative corner accents */
.modal-content::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid var(--paper-dark);
  border-radius: 4px;
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--paper-aged);
  border: 2px solid var(--brass);
  font-size: 24px;
  color: var(--leather-mid);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: var(--brass);
  color: var(--leather-dark);
  transform: rotate(90deg);
}

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

/* ============================================================================
   AUTH MODAL
   ============================================================================ */

.auth-modal-content {
  max-width: 440px;
  background-image: url("../../images/atlas-map.jpg");
}

.auth-modal-body {
  padding: 40px 32px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 8px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px var(--shadow);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label,
.form-label-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.form-group input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.auth-error {
  display: none;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: var(--error);
  font-size: 14px;
  line-height: 1.5;
}

.auth-error::before {
  content: "⚠️ ";
  margin-right: 4px;
}

.auth-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth-btn-primary {
  background: var(--primary);
  color: white;
}

.auth-btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.auth-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
}

.auth-btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.auth-btn-google {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-btn-google:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  text-align: right;
  padding: 0;
  margin: -8px 0 0 0;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth-help-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}

.auth-success {
  display: none;
  text-align: center;
  padding: 20px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}

.auth-success h2,
.auth-success h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-success p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ============================================================================
   CATEGORY MANAGEMENT MODAL
   ============================================================================ */

.category-modal-content {
  max-width: 600px;
  max-height: 80vh;
}

.category-modal-body {
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

.category-modal-header {
  margin-bottom: 24px;
  flex-shrink: 0;
}

.category-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.category-modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Category Tree */
.category-tree {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-secondary);
}

.category-tree-item {
  margin-bottom: 4px;
}

.category-tree-parent {
  margin-bottom: 8px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  cursor: default;
  transition: all 0.2s;
  user-select: none;
}

.category-item:hover {
  background: var(--primary-light);
}

.category-item.followed {
  background: var(--success-light);
  border-left: 3px solid var(--success);
}

/* Expand/Collapse Triangle */
.category-expand {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
}

.category-expand:hover {
  background: var(--border);
}

.category-expand:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.category-expand.expanded {
  transform: rotate(90deg);
}

.category-expand-icon {
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.category-expand-placeholder {
  width: 24px;
  flex-shrink: 0;
}

/* Category Info */
.category-info-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.category-emoji-inline {
  font-size: 20px;
  flex-shrink: 0;
}

.category-name-inline {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-count-inline {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Follow Toggle Button */
.category-follow-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.category-follow-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-follow-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.category-follow-btn.following {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.category-follow-btn.following:hover {
  background: var(--success);
  opacity: 0.9;
}

/* Child Categories (nested) */
.category-children {
  margin-left: 24px;
  margin-top: 4px;
  display: none;
}

.category-children.expanded {
  display: block;
}

/* Modal Footer */
.category-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#category-follow-count {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.btn-primary {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

/* Responsive */
@media (max-width: 640px) {
  .category-modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .category-modal-body {
    padding: 24px 16px 16px;
  }
  
  .category-children {
    margin-left: 16px;
  }
}

