/* ────────────────────────────────────────────────
   PetMap Social — Login, FAB, Modals, Posts UI
   ──────────────────────────────────────────────── */

/* Header buttons */
.btn-auth, .btn-notif {
  display: flex; align-items: center; justify-content: center;
  height: 36px; min-width: 36px; padding: 0 14px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff;
  font: 600 13px/1 'Inter',system-ui,sans-serif; cursor: pointer;
  position: relative; transition: background .15s;
}
.btn-auth:hover, .btn-notif:hover { background: rgba(255,255,255,.22); }
.btn-notif { padding: 0 10px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #ea580c;
}

/* Social filter chips */
.filter-social {
  background: linear-gradient(135deg, #fef3c7, #fed7aa) !important;
  color: #9a3412 !important; border-color: #fdba74 !important;
}
.filter-social.active {
  background: #dc2626 !important; color: #fff !important; border-color: #dc2626 !important;
}

/* FAB — desktop: top-right under header (avoids zoom + attribution).
   Mobile: bottom-right above the results panel (z-index over panel). */
.fab-publish {
  position: fixed;
  top: calc(var(--pm-header-h, 56px) + var(--pm-search-h, 88px) + 12px);
  right: 16px;
  z-index: 1100;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #ea580c, #dc2626); color: #fff;
  box-shadow: 0 6px 20px rgba(220,38,38,.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.fab-publish:hover { transform: scale(1.06); box-shadow: 0 8px 28px rgba(220,38,38,.55); }
.fab-publish:active { transform: scale(.96); }
@media (max-width: 768px) {
  /* En móvil el panel "collapsed" mide ~80px; el FAB queda justo encima. */
  .fab-publish {
    top: auto;
    bottom: 100px;
    right: 14px;
    width: 56px; height: 56px;
  }
}

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: #fff; border-radius: 16px; max-width: 420px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 28px 24px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: slideUp .25s ease;
}
.modal-card-wide { max-width: 560px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: #f3f4f6; color: #6b7280; font-size: 18px; cursor: pointer;
}
.modal-close:hover { background: #e5e7eb; color: #111827; }
.modal-card h2 { margin: 0 0 16px; font: 700 22px/1.2 'Inter',sans-serif; color: #111827; }

/* Login */
.login-hero { text-align: center; margin-bottom: 20px; }
.login-icon { font-size: 48px; }
.login-hero h2 { margin: 12px 0 6px; }
.login-hero p { margin: 0; color: #6b7280; font-size: 14px; }
.google-signin { display: flex; justify-content: center; margin: 20px 0 12px; }
.login-foot { font-size: 11px; color: #9ca3af; text-align: center; margin: 0; line-height: 1.5; }

/* Publish form */
.kind-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #f3f4f6; padding: 4px; border-radius: 10px; }
.kind-tab {
  flex: 1; padding: 8px 12px; border: none; background: transparent;
  border-radius: 7px; cursor: pointer; font: 600 13px/1 'Inter',sans-serif;
  color: #6b7280; transition: all .15s;
}
.kind-tab:hover { color: #111827; }
.kind-tab.active { background: #fff; color: #ea580c; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.publish-form label {
  display: block; font: 600 12px/1.4 'Inter',sans-serif; color: #374151;
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: .03em;
}
.publish-form input[type=text],
.publish-form input[type=tel],
.publish-form input[type=number],
.publish-form input:not([type]),
.publish-form select,
.publish-form textarea {
  width: 100%; padding: 9px 12px; margin-top: 4px;
  border: 1px solid #d1d5db; border-radius: 8px; font: 400 14px/1.4 'Inter',sans-serif;
  background: #fff; color: #111827; box-sizing: border-box; text-transform: none; letter-spacing: 0;
}
.publish-form textarea { resize: vertical; min-height: 80px; }
.publish-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.publish-form .row label { margin-bottom: 8px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; padding-top: 22px !important; text-transform: none !important; font-weight: 500 !important; }
.file-label { padding: 12px; border: 2px dashed #d1d5db; border-radius: 8px; text-align: center; cursor: pointer; background: #f9fafb; }
.file-label input { display: none; }
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.photo-thumb {
  position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.7); color: #fff; cursor: pointer;
}
.loc-picker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; background: #f3f4f6; border-radius: 8px; margin-bottom: 12px;
}
.loc-status { flex-basis: 100%; font-size: 12px; color: #6b7280; }
.btn-primary {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #ea580c, #dc2626); color: #fff;
  font: 700 15px/1 'Inter',sans-serif; cursor: pointer; transition: opacity .15s;
}
.btn-primary:hover { opacity: .92; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary {
  padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: #374151; font: 600 13px/1 'Inter',sans-serif; cursor: pointer;
}
.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-text { background: none; border: none; color: #ea580c; font-weight: 600; cursor: pointer; font-size: 13px; }

/* Notifications */
.notif-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.notif-head h2 { margin: 0; }
.notif-list { max-height: 50vh; overflow-y: auto; margin: 0 -8px; }
.notif-item { padding: 12px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { background: #fff7ed; }
.notif-item.unread .notif-title::before { content: '● '; color: #dc2626; }
.notif-title { font: 600 14px/1.3 'Inter',sans-serif; color: #111827; margin-bottom: 4px; }
.notif-body { font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.notif-time { font-size: 11px; color: #9ca3af; }
.notif-empty { text-align: center; padding: 24px; color: #9ca3af; font-size: 14px; }
.notif-foot { padding-top: 14px; border-top: 1px solid #e5e7eb; margin-top: 14px; text-align: center; }

/* Post markers + popup */
.post-marker { background: transparent !important; border: none !important; }
.post-pin {
  width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.3); border: 3px solid #fff;
  animation: postPulse 2s ease-in-out infinite;
}
.post-pin > * { transform: rotate(45deg); }
@keyframes postPulse {
  0%,100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.08); }
}
.post-popup { min-width: 240px; max-width: 280px; }
.popup-photo { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.popup-kind { font-size: 11px; font-weight: 700; color: #dc2626; text-transform: uppercase; letter-spacing: .05em; }
.popup-title { font: 700 15px/1.3 'Inter',sans-serif; color: #111827; margin: 4px 0; }
.popup-desc { font-size: 13px; color: #4b5563; line-height: 1.4; }
.popup-reward { margin-top: 6px; padding: 4px 8px; background: #fef3c7; color: #92400e; border-radius: 6px; font-size: 12px; font-weight: 600; display: inline-block; }
.popup-meta { font-size: 11px; color: #9ca3af; margin: 8px 0; }
.popup-reply-btn {
  width: 100%; padding: 8px; border: none; border-radius: 8px;
  background: #ea580c; color: #fff; font-weight: 600; cursor: pointer; font-size: 13px;
}
.popup-reply-btn:hover { background: #dc2626; }

/* Toast */
.pm-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #111827; color: #fff; padding: 12px 20px; border-radius: 10px;
  font: 600 14px/1.4 'Inter',sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  z-index: 5000; opacity: 0; transition: all .25s ease;
  max-width: 90vw;
}
.pm-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.pm-toast-success { background: #16a34a; }
.pm-toast-error { background: #dc2626; }
